Posts

Showing posts from April, 2017

Local Broadcast, less overhead and secure in Android

Image
Broadcast receiver is an Android component which allows you to send or receive Android system or application events. All the registered application are notified by the Android runtime once event happens. It works similar to the publish-subscribe design pattern and used for asynchronous inter-process communication. For example, applications can register for various system events like boot complete or battery low, and Android system sends broadcast when specific event occur. Any application can also create its own custom broadcasts. Basics of broadcast Let’s discuss some basic concepts of broadcast receiver. Register Broadcast There are two ways to register broadcast receiver- Manifest-declared (Statically) : By this receiver can be registered via the AndroidManifest.xml file. Context-registered (Dynamically): By this register a receiver dynamically via the Context.registerReceiver() method. Receive Broadcasts To be able to receive a br...

Autoboxing, a little thing, can cause big problems for Android App Performance

Image
To ensure your app performs well across a wide variety of devices, you always try to use best practices. On that front memory optimization is often a demanding task. Most of the time we always think on the bigger side of it and miss the small thing that can add up to a big problem. Autoboxing is a topic that often goes unnoticed when talking about performance issues. Autoboxing is a great language feature, until you realize how much of your performance is being lost to its convenience. You cannot imagine a simple Autoboxing operations can easily tear through your Application’s memory. What is Autoboxing? Till JDK 1.4, when we work with primitive types, it requires repetitive work of converting the primitive types into wrapper classes and vice-versa. Let’s say if we want to create a List with Integers, we have to explicitly wrap them as Integer and we need to unwrap it to get int value. So since JDK 1.5, Conversion from primitive types to corresponding wrapper ...

Android O: Impact On Running Apps And Developer Viewpoint

Image
It’s been just about a year since Google released Android Nougat. In the next version of its Android operating system, it revealed the first developer preview of Android O (Hoping it’ll named Android Oreo) on 21 March 2017. In this article, we are going to discuss all the important features and changes of Android O from developer’s perspective. The Android O release will be known as Android 8.0. The final version of Android 8.0 will be out sometime in Q3 of 2017 and before that Google has plan to rollout DP #4. Based on DP #1, here are list of major behavioral changes which will impact on all currently running applications when run on Android O platform. ·        Background execution limits ·        Background location limits ·        Handles identifiers(Android ID) differently ·        Account Access ·     ...

Closer Look At Android Runtime: DVM vs ART

Image
Before directly move to Android Runtime, we need to understand what runtime environment is and also understand some basic stuff i.e. the functioning of JVM and Dalvik VM. What is runtime? In a simplest term it is a system used by operating system which takes care of converting the code that you write in a high level language like Java to machine code and understand by CPU/Processor. Runtime comprises of software instructions that execute when your program is running, even if they’re not essentially are a part of the code of that piece of software in particular. CPUs or more general term our computers understand only machine language (binary codes) so to make it run on CPU, the code must be converted to machine code, which is done by translator. So following are the generation of translator in a sequence- 1.     Assemblers : It directly translate assembly codes to machine codes so it was very fast. 2.     Compilers : It ...