Service in Android

In Android, service is a process which doesn’t need user interaction. It is a component which keep an app running in the background to perform long-running operations. Types of Services These are the three different types of services: Foreground : A foreground service performs some operation that is noticeable to the user. When you use a foreground service, you must

2020-11-14T23:46:33+05:30Categories: Android|

Building Blocks of Android Application

Android apps can be written using Kotlin, Java, and C++ languages. The Android SDK tools compile your code and generate Android package (APK). APK is an archive file with an .apk suffix. App components are the building blocks of an Android application. Each component is an entry point through which the system or a user can enter your app. Different

2020-11-14T17:09:22+05:30Categories: Android|

Register Application Class in Android

Application is the base class for maintaining global application state. You can provide your own implementation by creating a subclass and specifying the name of this subclass as the android:name attribute in <application> of AndroidManifest.xml. The Application class, or your subclass of the Application class, is instantiated before any other class when the process for your application/package is created. Application

2020-11-01T23:03:03+05:30Categories: Android|

Custom Attributes to a View in Android

Android framework provides a set of base classes and XML tags to create a custom view. For example, say we need to set typeface to our text views. All of the view classes defined in the Android framework extend View. A custom view can also extend View directly, or can extending one of the existing view subclasses. A custom view

2020-10-18T20:46:49+05:30Categories: Android|Tags: |

Gravity and Layout_Gravity in Android

Gravity attributes defined in Android are android:gravity : Sets the gravity of the contents (i.e. its subviews) of the View it's used on. Gravity arranges the content inside the : Sets the gravity of the View or Layout relative to its parent. It arranges a view in its layout. So gravity arranges the content inside the view. layout_gravity arranges

2020-09-17T13:15:31+05:30Categories: Android|

FrameLayout in Android

Introduction Framelayout in Android is a ViewGroup subclass. It is used to specify the position of View instances it contains on the top of each other to display only single View inside the FrameLayout. It is designed to block out an area on the screen to display a single item. Multiple children can be added to FrameLayout. To control position

2020-09-17T14:29:41+05:30Categories: Android|

Relative Positioning in ConstraintLayout

Relative positioning in ConstraintLayout is the basic building blocks of creating layouts. Constraints used in relative positioning allow to position a given widget relative to another one. A widget can be constrained on both the horizontal and vertical axis i.e. Horizontal Axis: It allows to constraint left, right, start and end sidesVertical Axis: It allows to constraint top, bottom sides

2020-08-16T20:56:52+05:30Categories: Android|

GuideLine and Barrier in ConstraintLayout

A ConstraintLayout is a android.view.ViewGroup used to position and size widgets in a flexible way. GuideLine and Barrier in ConstraintLayout are special helper objects to help you with your layout. Both are used to constraint layout. Guideline Guidelines are invisible lines that you can place at particular positions in your layout. Widgets can then be positioned by constraining them to

2020-08-16T17:16:23+05:30Categories: Android|

Layout Editor in Android Studio

Layout Editor in Android Studio is used for building layouts. It enables you to build layouts by dragging UI elements into a visual design editor instead of writing layout XML. The design editor can preview layout on different Android devices and versions. You can position the elements in the layout, add constraints, and set attributes. Layout Editor appears when you

2020-08-16T13:09:01+05:30Categories: Android|Tags: |

Unique Device ID for Android Devices

There are several occasions when the unique identifier of a device is required. For instance to generate encryption keys or to track installations. On Android there are several ways to get such an ID. This tutorial examines various solution to associate unique identifier to a android device. Using IMEI, MEID or ESN To get the IMEI number of Android phone,

2020-07-12T16:26:06+05:30Categories: Android|
Go to Top