Make Custom Android Launcher

Image
There are thousands of Android Launcher available in Play Store. Each and every Android mobile user loves to customize their mobile with different Android Launcher. If you want to develop your own launcher, this post helps you to fulfill your wish. In this post, you will find a demo launcher with layout and code which include many features like Drag & Drop , rearrange the installed application, change the background wallpaper etc. Here is an example of demo launcher which display all the installed applications in 3*3 Grid View format compatible to all devices. First of all we need to find all the installed applications from device so we should implement a subclass of AsyncTaskLoader that loads the currently installed applications from the package manager. If you want to display all the installed applications in  List View you can use official Android Developer reference .

Android Activity

To start an activity, we need to register each and every activity in the manifest file
<activity android:label="@string/app_name"
                        android:name=".MainActivity">
</activity>
In the above code, an activity name is MainActivity.

Activity Life Cycle

The Activity Manager manages the life cycle of activities. Following are the different states of activity life cycle.
  • Starting State
          The Activity Manager starts the activity using onStart(), onCreate(), onResume() method.

  • Running State
         The Activity Manager allocates the memory and resources for particular activity.
         In this state, only one activity(which is in focus) can be displayed on screen.

  • Paused State
         An Activity is in paused state when it’s not in focus or can be visible on screen.
         The Activity Manager calls onPause() method to put an activity into this state.
         For example, Any toast notification or dialog box come up in front of any activity.

  • Stopped State

         An Activity is in stopped state when it’s not visible on screen, but memory not released.
         The Activity Manager calls onStop() method to put an activity into this state.

  • Destroyed State
         An activity is destroyed and released from memory.
         The Activity Manager calls onDestroy() method to put an activity into this state.

Comments

Popular posts from this blog

Make Custom Android Launcher

Layouts for Fragment