[android-developers] app2sd restrictions - sharing a workaround to allow moving your app to SD card

2011-09-02 Thread mot12
Android recommends that certain apps should not be moved to SD card,
e.g. alarm clocks, etc.
See http://developer.android.com/guide/appendix/install-location.html

The reason for that is, among other things, that when the sd card is
unmounted, registrations with the alarm service are canceled, and the
app is no longer accessible. When the SD card is mounted again, there
is no way to launch the app to reregister those services.

So how do you get such apps to work on SD card anyways? I got my app
(Gentle Alarm) to work on SD card with a little trick that I share
here.

Notice: Of course the app won't work if the SD card is unmounted. So
this is NOT a solution for apps that need to remain accessible all the
time such as live wallpapers.

1) Create an additional small app that remains in memory. If you have
a widget for your app, you can use that as widget must stay in
internal memory anyways. I will call this app B.

2) If the SD card is unmounted, your app A is no longer accessible.
App B can notify the user accordingly if desired.

3) If the SD card is mounted again, there is no way to start app A
directly. But app B can listen to the event that external apps are now
available and then send an event to app A which can then reregister
anything that got broken by unmounting the sd card (e.g. alarm
service).

4) If you need to start your app right after a reboot, app A can no
longer be started after a reboot because the SD card is not mounted
yet. You can simply get rid of the event receiver because step 3
already accomplishes what you need. After reboot, the sd card
eventually is mounted and the external apps will become available. App
B will listen to this even and trigger app A.

Hope this will help some people to move their apps to the sd card. My
app has been used with this feature for 3 months by 40+ users and
I had no complaints.

Martin Hunke
mobitobi
Gentle Alarm, Sleep Now

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] app2sd - not working

2011-01-05 Thread André
I've just updated my app so the user can choose to install it on the
sd card or not. But I keep getting some comments that it's not
possible for them to install it on the sd card. Can anyone see if I've
made anything wrong or if you have any other suggestions?

André

?xml version=1.0 encoding=utf-8?
manifest xmlns:android=http://schemas.android.com/apk/res/android;
package=com.someapp.fun
android:versionCode=1
android:versionName=3.0
android:installLocation=auto 

uses-permission android:name=android.permission.INTERNET /
uses-permission
android:name=android.permission.ACCESS_NETWORK_STATE /
uses-permission
android:name=android.permission.WRITE_EXTERNAL_STORAGE /
uses-permission android:name=android.permission.READ_PHONE_STATE /

uses-permission android:name=android.permission.VIBRATE /

uses-sdk android:minSdkVersion=4 /

application android:icon=@drawable/icon android:label=@string/
app_name

...

/application
/manifest

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] app2sd - not working

2011-01-05 Thread YuviDroid
Just a guess:
the problem might be here: uses-sdk android:minSdkVersion=4 /

you should probably also specify the targetSdkVersion to be = 8.

Again, it's just a guess ;)

On Wed, Jan 5, 2011 at 11:51 AM, André pha...@hotmail.com wrote:

 I've just updated my app so the user can choose to install it on the
 sd card or not. But I keep getting some comments that it's not
 possible for them to install it on the sd card. Can anyone see if I've
 made anything wrong or if you have any other suggestions?

 André

 ?xml version=1.0 encoding=utf-8?
 manifest xmlns:android=http://schemas.android.com/apk/res/android;
package=com.someapp.fun
android:versionCode=1
android:versionName=3.0
android:installLocation=auto 

uses-permission android:name=android.permission.INTERNET /
uses-permission
 android:name=android.permission.ACCESS_NETWORK_STATE /
uses-permission
 android:name=android.permission.WRITE_EXTERNAL_STORAGE /
uses-permission android:name=android.permission.READ_PHONE_STATE
 /
 
uses-permission android:name=android.permission.VIBRATE /

uses-sdk android:minSdkVersion=4 /

application android:icon=@drawable/icon android:label=@string/
 app_name

...

/application
 /manifest

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en




-- 
YuviDroid
Check out Launch-X http://android.yuvalsharon.net/launchx.php (a widget to
quickly access your favorite apps and contacts!)
http://android.yuvalsharon.net

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] App2SD

2010-10-08 Thread { Devdroid }
On 8 October 2010 02:16, Zaid zaid.a...@gmail.com wrote:
 i added  android:installLocation=auto to my manifest and changed
 the project target api in eclipse to 8(was 3 b4) so my app can be
 installed to SD card, but i kept the minisdkversion to 3, so people
 with android 1.5 can use my app.

 my question is, can people with android version 1.5 still be able to
 download my app from the market after changing my target api to 8?

Yes. Target API is one thing, but android:minSdkVersion is what limits
in that case

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] App2SD

2010-10-07 Thread Zaid
i added  android:installLocation=auto to my manifest and changed
the project target api in eclipse to 8(was 3 b4) so my app can be
installed to SD card, but i kept the minisdkversion to 3, so people
with android 1.5 can use my app.

my question is, can people with android version 1.5 still be able to
download my app from the market after changing my target api to 8?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] App2SD

2010-10-07 Thread Mark Murphy
On Thu, Oct 7, 2010 at 8:16 PM, Zaid zaid.a...@gmail.com wrote:
 i added  android:installLocation=auto to my manifest and changed
 the project target api in eclipse to 8(was 3 b4) so my app can be
 installed to SD card, but i kept the minisdkversion to 3, so people
 with android 1.5 can use my app.

 my question is, can people with android version 1.5 still be able to
 download my app from the market after changing my target api to 8?

Yes, they should be able to download your app.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Training...At Your Office: http://commonsware.com/training

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] app2sd backward compatibility

2010-09-04 Thread Laszlo Fogas
Hello guys,

I recently enabled the app2sd functionality in my app.
To remain compatible with Android 1.5 i left intentionally the minSdkVersion
at 3 and added android:installLocation=preferExternal attribute to my
manifest. Basically I followed what is listed in the following article:
http://developer.android.com/guide/appendix/install-location.html

When i test the apk on my NexusOne (2.2) the app goes to the SD card,
perfect! But when i publish the app on the market and install the same apk
from the market on the same Nexus, the app2sd function is missing, I can't
install it to my SD card.

Has anybody had the same problem before?

Thanks in advance!

Laszlo

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en