Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Name the custom manifest  file AndroidManifest.xml, and put it in the directory platform/android beneath your application's root project directory. 

    Create the platform directory if you need to, ensuring that the directory is a sibling of the "Resources" directory, (right below your project root).



  • If you do have a custom manifest, generates a file named AndroidManifest.xml.gen in the build/android directory during each build. You can use this to see the AndroidManifest.xml that would be generated by default.

Ensuring Android Shuts Down Apps Cleanly

The are times when an application needs to be shut down by the platform outside of the application context, such as when the user changes fundamental system settings or lets the app sleep for long periods. Unfortunately, Android's primitive kill process sometimes leads to a known problem where the app is only partially shut down. The solution for Titanium apps is to set the alwaysRetainTaskState parameter in the AndroidManifest.xml file, as follows (this one is taken from the KitchenSink):

Code Block
langxml
<activity android:configChanges="keyboardHidden|orientation" android:label="KitchenSink" android:name=".KitchensinkActivity" android:alwaysRetainTaskState="true" android:theme="@style/Theme.Titanium">
  <intent-filter>
    <action android:name="android.intent.action.MAIN"/>
    <category android:name="android.intent.category.LAUNCHER"/>
  </intent-filter>
</activity>
Note

Be aware that this setting increases memory usage, so only enable it where your app is experiencing the problem.