jawdoss
Android Fan
Profile
Posts: 359
Reg: Jun 10, 2012
Gold Coast, Que...
9,090
06/18/12 01:37 AM (13 years ago)

Being able to save an app to the sd card on android?

It would be a great feature if we were able to set the app to allow it to save to the sd card rather then the android phone in the installing.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
06/18/12 01:52 AM (13 years ago)
You can! Open up AndroidManifest.xml, and look for this line: android:versionName="1.0" (the number might be different) Now add this line below it: android:installLocation="preferExternal"> That whole section should look like this: <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.yourappname" android:versionCode="1" android:versionName="1.0" android:installLocation="preferExternal"> <uses-sdk android:minSdkVersion="8"/> Now go down to the section where you see the following: <uses-permission android:name="android.permission.READ_PHONE_STATE" /> That's in the Required Device Permissions section. Add this line below it: <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> That's it! It'll now save to external storage if any is available. Mark
 
jawdoss
Android Fan
Profile
Posts: 359
Reg: Jun 10, 2012
Gold Coast, Que...
9,090
like
06/18/12 05:48 AM (13 years ago)
Ok i will give it a go!
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
06/18/12 06:36 AM (13 years ago)
The Buzztouch Process (Android) article in my guide will walk you through this step and many other necessary steps. Only the following is necessary: Add: android:installLocation="preferExternal" Just above <uses-sdk android:minSdkVersion="8"> www.MySkylla.com Fred
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
06/18/12 09:30 AM (13 years ago)
I think the android.permission.WRITE_EXTERNAL_STORAGE string is also required from what I read in the Android documentation. It's the portion of the manifest that actually provides permission to...well...write to external storage! Mark
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
06/18/12 09:56 AM (13 years ago)
@Mark, yes I sure it's required, but as with many other things Buzztouch provides. The Buzztouch manifest already had the required permissions and the only modification (for this step) is adding the one line. Strongly recommend users learn the other modifications that are needed. Details in my article, The Buzztouch Process (Android) Fred
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
06/18/12 10:00 AM (13 years ago)
Just looked back through some old manifest files. It appears that WRITE_EXTERNAL_STORAGE is only provided as default in BT v2, and not in BT v1.5. Either way...it's best to check that it's there. Mark
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
06/18/12 10:33 AM (13 years ago)
If so, then WRITE_EXTERNAL_STORAGE is not required, as I've never taken that step. Been adding the one line only since McApple gave me the link to a stackoverflow article back in Oct last year. Works well for both my BTv1.5 apps and BTv2.0 apps. Will not work for BTv1.4 (will also cause error). Therefore, use the one line only. Fred
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
06/18/12 10:38 AM (13 years ago)
It may work, but that doesn't mean it's entirely correct. Part of publishing an Android app is letting the user know what your app will be asking to do..in effect, getting permissions for those activities. If you don't let a user know that you're going to be writing to the external storage, and you do it anyway, there could be repercussions about it. Google seems pretty adamant about exposing permissions. "Works" doesn't always mean complete solution. Any arguments with it, bring it up with Android. Mark
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
06/18/12 10:47 AM (13 years ago)
Then again, my "if so" qualified the answer. As I said "I'm sure it's there, it's not necessary" and all permission are declared if included in manifest. So, one last time, it's not necessary. Fred
 
jawdoss
Android Fan
Profile
Posts: 359
Reg: Jun 10, 2012
Gold Coast, Que...
9,090
like
06/18/12 03:04 PM (13 years ago)
Can someone please give me the link to the STACKOVERFLOW article? So far I have put 2 lines in but its not working yet, and its not picking up the androidstor location its just leaving it as straight black text...
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
06/18/12 03:09 PM (13 years ago)
Ah! We're talking about installing the app itself on external storage...not any data you generate in the app. At least that's not what I'm talking about! Sounds like you're trying to save text from an HTML document or something? Mark
 
jawdoss
Android Fan
Profile
Posts: 359
Reg: Jun 10, 2012
Gold Coast, Que...
9,090
like
06/18/12 08:31 PM (13 years ago)
I would like the app to install tot he sd card and not the device??? can anyone post the steps for this?
 
jawdoss
Android Fan
Profile
Posts: 359
Reg: Jun 10, 2012
Gold Coast, Que...
9,090
like
06/18/12 08:31 PM (13 years ago)
I would like the app to install tot he sd card and not the device??? can anyone post the steps for this?
 
jawdoss
Android Fan
Profile
Posts: 359
Reg: Jun 10, 2012
Gold Coast, Que...
9,090
like
06/18/12 08:31 PM (13 years ago)
I would like the app to install tot he sd card and not the device??? can anyone post the steps for this?
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
06/18/12 08:49 PM (13 years ago)
The steps I provided above will work for installing the app to the external storage. Mark
 
jawdoss
Android Fan
Profile
Posts: 359
Reg: Jun 10, 2012
Gold Coast, Que...
9,090
like
06/18/12 11:39 PM (13 years ago)
i have followed your steps and it still doesn't try and install into my sd card?
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
06/19/12 12:16 AM (13 years ago)
 
jawdoss
Android Fan
Profile
Posts: 359
Reg: Jun 10, 2012
Gold Coast, Que...
9,090
like
06/19/12 12:16 AM (13 years ago)
Ok i will tomorrow. thanks mate
 
yenael
Aspiring developer
Profile
Posts: 100
Reg: Sep 17, 2013
Detroit
2,950
like
11/03/13 07:29 AM (12 years ago)
I know this is a year old post but at first it din't work for me either because of a syntax error. The line above the android:installLocation="preferExternal"> has a > there, so if you just copy and paste, the added line will stay black indicating that it is still wrong. So, remove the > on the line that says android:versionName="1.0"> then it should change the colors to match the rest. We can overlook stuff sometimes. I tried it a week ago and got the error and then came back to inspect, so I missed the little > problem until now.
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.