I have an App that compiles against SDK 1.5 for compatibility reasons, I would like to try and keep it that way. I am allowing user’s to save images to the external memory, which at the time I was sure was always an SD-card. I want the images (files) to stay even if the user uninstall the App, otherwise I could have saved to internal memory and App would delete upon uninstall.
Up until now I have had no problems loading images from my test devices, but now I got an Toshiba Thrive tablet that besides internal DDR ram, have 8GB internal Flash memory and an SD-Card slot. My App saves the images fine on the Toshiba declaring storage location like this:
// Note: First I create a folder for my App - Not shown here, but it works fine
file = new File(Environment.getExternalStorageDirectory()+ File.separator + "MyApp" + File.separator + "test.png);
On the Toshiba tablet it always saves with the above method on the internal flash device, which is fine, however using same declaration the same file won’t load, which I find really strange.
I load using this very simple method;
file = new File(Environment.getExternalStorageDirectory()
+ File.separator + "MyApp" + File.separator + "test.png);
bitmap = BitmapFactory.decodeFile(file);
And then display bitmap
I have not had a previous need to set any file permissions, other that if I compile against SDK 1.6 or higher I need in the manifest this
uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
Even so I thought that was only to allow writing.
Sorry people, I had to change my code handling rotation as values for orientation was different, the way I used to do it, from my other devices, plus the tablet was connected via USB to PC which had locked access to folder – duh 🙁