Android Question Updating program in external storage

Adrian Jansen

Member
Licensed User
Longtime User
I have a program in development, with the Module Attibutes set to "#CanInstallToExternalStorage: True"

When installing to an Android ( version 4.2.2 ) phone for the first time, using the B4A bridge I get the choice to "Install to SD card" presented by the phone. After doing so, and checking that the program is indeed installed on the card, I then did some more debugging, and did another Compile and Run from the IDE. The program is then sent to the phone, and all works ok, but when I check where it went, the program is now installed on the phone internal memory.

I was rather hoping to keep debug installations on the external card, since the Flash has a somewhat limited life, and cards are cheap to replace, if I ever need to.

I also tried editing the manifest to
"SetManifestAttribute("android:installLocation", "preferExternal")"

But that also does not cause a re-installation to go to external storage. Of course I can always delete the current installation, and then re-install, when I get the "Install to SD card" choice again, but that is an extra step.

Any thoughts on how to get a re-installation to go to the SD card automatically ?
 

Adrian Jansen

Member
Licensed User
Longtime User
Thanks Erel. In normal useage, this would not be a problem, I imagine its rare for a user to re-install a package. But for a developer, especially a newbie to B4A like me, while learning how to do things, I find I re-install 10-20 times a day. Hopefully I will get better at writing code that works. I know I could use the PC emulator for some testing, but I find that is very slow, and does not emulate hardware like GPS at all.

Just a thought: Is it possible to programmatically uninstall a package ? Or can it only be done from the Apps manager.
 
Upvote 0

Adrian Jansen

Member
Licensed User
Longtime User

Thanks for that. I guess even at 10 installs per working day, thats only around 2000 re-writes per year. Flash should be good for 10,000 at least, plus the gain from wear-levelling.

Actually the new B4J IDE allows me to do 80% of what I want. Write the program first as a B4J application for the PC, get the logic right and display interface tidied up, check out that the calls to the libraries do what I want them to do. Then its a relatively easy job to port the app to B4A, and get it to run there.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…