persistant

android:persistent, makes app running at all times

The persistent tag in the Android Manifest is an attribute of the <application> element. It specifies whether the application should remain running at all times. The default value is false, which means that the application will be killed by the system when it is not in use.

Setting the persistent attribute to true will cause the application to remain running even when it is not in use. This is useful for system applications that need to be available at all times, such as the clock or the notification manager.

However, it is important to note that setting the persistent attribute to true can have a negative impact on battery life. This is because the application will continue to run in the background, even when it is not being used.

For most developers, there is no need to use the persistent attribute. It is only intended for certain system applications.

Here is an example of how to use the persistent attribute in the Android Manifest:

Code snippet

<application
    android:persistent="true">
    ...
</application>

In this example, the persistent attribute is set to true, which means that the application will remain running at all times.

I hope this helps! Let me know if you have any other questions.

Last updated