Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set install location for Android 1.6?

I'm writing an application that is compatible with Android 1.6, but I would like to give users running Android 2.2 the option of moving the application installation to their sd card.

How can I compile my application for 1.6, but still allow 2.2 users to install it to their sd?

like image 249
Kleptine Avatar asked Dec 17 '22 23:12

Kleptine


1 Answers

In your manifest:

  • In <manifest>, add "android:installLocation="preferExternal"
  • Keep your current uses-sdk as "<uses-sdk android:minSdkVersion="4">"

Then go to Project > Properties > Android (on the left), change the build target to 2.2, and you're all set.

Your project will build using 2.2 (but still only requires 1.6), but devices running 1.6 will simply ignore your new "installLocation" setting in the manifest. Just be careful not to add any 2.2-introduced material in your actual code, since the compiler will no longer catch it.

like image 193
Andy Zhang Avatar answered Dec 28 '22 07:12

Andy Zhang