Android

interface_cast and asBinder Explanation

Binder in Android are used for Inter Process Communication. In Android code base, interface_cast and asBinder function are used at multiple places in context of Binder. This article tries to explain the interpretation of these API. interface_cast Let's analyze it based on the following ICameraClient example: // https://android.googlesource.com/platform/frameworks/av/+/refs/heads/master/camera/ICamera.cpp sp<ICameraClient> cameraClient [...]

2022-06-10T19:20:20+05:30Categories: Android|

Binder Native and Proxy Object in Android

Binder framework takes an object-oriented approach in its design principle and every entity that is capable of serving inter-process calls is a user-space object. In native user space the IBinder is the base class of all kinds of Binder objects i.e. proxy objects and native objects. All native Binder objects [...]

2022-06-07T18:53:22+05:30Categories: Android|Tags: |

What is Binder in Android ?

There are several techniques to achieve IPC (Inter-process communication) like files, sockets, signals, pipes, message queues, semaphores, shared memory, etc. Binder is an Android-specific IPC mechanism, which enables an RPC (remote procedure call) mechanism between the client and server processes. Client process can execute remote methods in the server process [...]

2022-03-30T19:55:33+05:30Categories: Android|Tags: |

MessageQueue, Handler and Looper in Android

Looper, Handler, MessageQueue, and HandlerThread are useful in asynchronous programming. Handler and Looper working Message Message is a data object. It contains payload of the message. Message class implements Parcelable interface (so that it can be put in extras to bundles and intents). Primarily it is: int what — message [...]

2022-01-07T10:03:16+05:30Categories: Android|Tags: |

ADB commonly used commands

Introduction ADB is a command-line tool that lets you communicate with a device. The adb command facilitates a variety of device actions, such as installing and debugging apps, and it provides access to a Unix shell that you can use to run a variety of commands on a device. It [...]

2022-07-15T17:17:21+05:30Categories: Android|Tags: |

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 [...]

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 [...]

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 [...]

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 [...]

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 view.android:layout_gravity : Sets the gravity of the View or Layout relative to its parent. It arranges a view in its layout. [...]

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