Affects Version/s: Release 2.1.2, Release 2.1.3, Release 3.0.0
SDKs tested: 2.1.2.GA, 2.1.3.v20120927181611, 3.0.0.v20121002103353
Devices tested: Galaxy Nexus 4.0.4, Droid (original) 2.2.3
Android manifest changes in the tiapp.xml file do not replace the "stock" manifest entries created by the build process. Instead, the stock entries are copied after the custom entries, overriding the customizations.
- Create a default Ti project targeting Android
- Build the app (for emulator or device, doesn't matter)
- Open tiapp.xml, view the XML source
- Change the <android tag to be container tags and add manifest tags, like this:
- Open <project>/builds/android/AndroidManifest.xml and copy the <activity> and <service> tags that follow the <!-- TI_APPLICATION --> comment
- Paste the copied text into the tiapp.xml between the <manifest></manifest> tags
- Edit the pasted in code to remove |orientation from each of the <activity configChanges"> attributes
- To each of those tags, add android:screenOrientation="portrait" to force portrait orientation in the app
- Save and build the app
- Open <project>/builds/android/AndroidManifest.xml. It will have both your customized entries followed by the generated stock entries. As a result, the app will display in both portrait and landscape orientation.
Changes in tiapp.xml would override the stock/generated AndroidManifest.xml values
Stock/generated AndroidManifest values pasted in after custom entries, negating the effect of the custom entries.
This is likely a regression as it used to work properly. The tiapp.xml customization technique is taught in the ATMD training course.