Posts

Showing posts from December, 2017

Architecture Patterns for Android

Image
            Every operating system and platform has some guidelines for software architecture. These guidelines are general reusable solution that can be used for recurring problems in software development. The architecture patterns separate and define a clear single role for each component in app. A class is not going to be a multi-tasking component. Nowadays, it's very important to define what is the architecture for the application that   we're going to  develop.  We need to design for maintainability, scalability, and how testable this application is going  to be. Based on maintainability, scalability and testability, we can follow MVC or MVP patterns. Model-View-Controller (MVC) Pattern              MVC is most well known in the work development world right now, where basically it's a separation of parts, in other words, the model contains the entities of representation of...

Activity Lifecycle

Image
Activity Stack              For each running application, the android runtime system maintains an activity stack. When an application is launched, the first of the application’s activities to be started is placed onto the stack. When a second activity is started, it is placed on the top of the stack and the previous activity is pushed down. The activity at the top of the stack is referred to as the active (or running) activity. When the active activity exits, it is popped off the stack by the runtime and the activity located immediately beneath it in the stack becomes the current active activity. Activity Lifecycle              As a user interact with app, the android system will call various lifecycle callback methods on activity. As a user navigates through, out of, and back to your app, the activity instances in your app transition through different states in their lifecycle. T...

Android Process States

Image
            Processes host applications and applications are made up of components. Within an Android system, the current state of a process is defined by the highest-ranking active component within the application that it hosts.     Foreground processes have highest priority & empty process have lowest priority. So android will kill empty processes first in order to free up resources.  Foreground Process :              At any one time, there are unlikely to be more than one or two foreground processes active and these are usually the last to be terminated by the system. A foreground process must meet one or more of the following criteria : Hosts an activity with which the user is currently interacting. Hosts a service connected to the activity with which the user is interacting. Hosts a service that has indicated, via a call to startForeground(), that termination wou...