Android Architecture & Activity Lifecycle

 

Hello Developers, before starting the Android development let's first understand Android architecture & activity lifecycle. 

Android Architecture:


Android architecture is categorized into mainly 5 parts:
  1. Linux Kernel
  2. Native Libraries
  3. Android Runtime
  4. Application Framework
  5. Application
Linux Kernel is the heart of Android architecture. It is responsible for device drivers, power management, device management & resource access.

On top of the Linux kernel, there are Native Libraries such as OpenGL, SQLite, SSL, Media, etc. SQLite library is for databases, Free Type for font support, and Media for playing audio and video.

Core libraries and DVM (Dalvik Virtual Machine) reside in Android Runtime. DVM is like JVM but it is optimized for mobile devices. It consumes less memory and provides fast performance.

On top of Android Runtime & Native Libraries, there is Android Framework. It includes Android APIs like Content Provider, Window Manager, Activity Manager, etc.

At the top, we have an Application. It contains all applications using the Android framework like Home, contact, browser, etc.

Android Activity Lifecycle: 

When a user navigates through the app, various activities are called & all the activities in the app have various methods. The lifecycle of an activity is shown below:

The activity provides a core set of six callbacks, onCreate(), onStart(), onResume(), onPause(), onStop(), and onDestroy(). 

onCreate() callback is implemented when the first time activity is created. 

onStart() is invoked when an activity is visible to the user.

onResume() is invoked when an activity starts interacting with the user.

onPause() is called when activity is going into the background but not yet killed by the user.

onStop() is invoked when the activity is no longer visible to the user.

onRestart() is called when the user navigates back to the activity.

onDestroy() is called when the activity is destroyed.

Conclusion

In this post, I have provided the basic details of Android Architecture and Android Activity Lifecycle. In the next post, we will create our first android app from which we will understand the concept of different views in Android.









Comments

Popular posts from this blog

Set up Android Studio