Android Question Error installing on emulator

Alberto Michelis

Well-Known Member
Licensed User
Longtime User
Installing my app in an emulator with SD card set to 512 is ok.
Installing it without SD card I get an error, see image.
Does this means my app will only install in devices with SD card?
Im using DirDefaultExternal, is this ok?
Thanks
 

Attachments

  • erroremu.png
    erroremu.png
    44.2 KB · Views: 161

EnriqueGonzalez

Well-Known Member
Licensed User
Longtime User
Check with File.ExternalWritable if there is a SD Card and if you have access to it. if false use File.DirInternal
 
Upvote 0

Alberto Michelis

Well-Known Member
Licensed User
Longtime User
Ok, I can test it but...
I dont need to install my app/files in any particular dir, my questions are:
- If I use DirDefaultExternal to install my files, does the user need an SD card to install?
(I have an SD card in my phone but when I install I see my files in the Phone/Android/data.... and not in the sd card.)
- Which is the best dir in which install to be the most compatible with all devices and users.
Thanks
 
Upvote 0

EnriqueGonzalez

Well-Known Member
Licensed User
Longtime User
when the app is installed, unless stated by the manifest it will install in the memory of the phone, after the installation you can verify the existence of the SD CARD and transfer the app data there.

which is the best dir??? i would say defaultinternal, but i think that is up to the User and their phones, particulary Low end phones comes with very low memory and expansion lot, middle range phones come with high internal memory and no expansion lot, high end do whatever they want.
 
Upvote 0

Alberto Michelis

Well-Known Member
Licensed User
Longtime User
When I install my app in my phone, that does have an SD card, the files installed in DirDefaultExternal are in the Phone/Android/Data/package dir, then they do not get installed in de SD card even if the phone has one.
Then why am I getting this error in an emulator without SD card and dont get it with SD card ?
Does this means my app need a SD card to install even if it does not use it to get installed?
 
Upvote 0

EnriqueGonzalez

Well-Known Member
Licensed User
Longtime User
i think your app crashes because you use the DirDefaultExternal somewhere in your code without looking if the sd card actually exists.

when you have the sd card, have you looked for the files in the sd card? , may be they are in both places, phone and sd card, of course that is if you are writing them with dirdefaultexternal and not deleting them on the phone.

for your last question: no, your app does not need to be installed in the sd card to work just verify the existence of the sd card before trying to write there.
 
Upvote 0
Top