Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Activate Apps2SD / Android / Froyo


does anyone know whether it is possible to activate apps2sd for android?

I set the installLocation property in my custom android xml to preferExternal as described here http://android-developers.blogspot.com/2010/07/apps-on-sd-card-details.html .

Since then I always get the error "error: No resource identifier found for attribute 'installLocation' in package 'android'" when launching the simulator. I found a solution on a blog (http://mobile.tutsplus.com/tutorials/android/move-to-sd-card/) "Change the build target by editing the project properties (right-click on the project in Eclipse), and choose a target with at least API Level 8:"

But I do use Titanium not Eclipse. Then I set the "android:targetSdkVersion" to 8 in my custom android xml file and the I sill get this error in Titanium log.


— asked August 13th 2010 by Jicks Steen

1 Answer

  • I found a way to activate apps2sd by doing these steps:

    1. Create a custom Android manifest file as described here http://developer.appcelerator.com/doc/mobile/android-custom-androidmanifest
    2. Add this attribute to the root element manifest: android:installLocation="preferExternal" Further possible values are described here http://developer.android.com/guide/appendix/install-location.html
    3. Change
      <uses-sdk android:minSdkVersion="4" /> to
      <uses-sdk android:minSdkVersion="4" android:targetSdkVersion="8" />
    4. Change "target=android-4" to "target=android-8" in file projectfolder&#x2F;build&#x2F;android&#x2F;default.properties
    5. In the file mobilesdk&#x2F;{windows|linux|mac}&#x2F;{titaniummobilesdkversion}&#x2F;android&#x2F;builder.py change the following lines:
    • self.sdk = AndroidSDK(sdk, 4) to self.sdk = AndroidSDK(sdk, 8)
    • android_sdk_version = &#39;4&#39; to android_sdk_version = &#39;8&#39;
      Please attend that you have to change these values each time you update to a new mobile sdk version.
    1. Change something in tiapp.xml to force a full rebuild of the app…

    That works for me. My app runs perfectly on Android 1.6, 2.1 and 2.2. But I give no warranty that it will work for you or that all Titanium features will work after doing these steps…

    — answered September 5th 2010 by Jicks Steen
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.