0

The problem is there....

My app download a content like audio,video and images the download is perfect working...

But when I use Lenovo mobile device then download was not working..

and also the problem i found... the sd card name path is /sdcard0 and my perfect download is working in /sdcard/ path

On more thing, that is my downloading content is approximately out of 2 GB of data... and some device have not more storage space, it need more space from external sd card

what should I do.... my app was downloaded so many devices. and problem occurs now...

One big problem....

when I write downloaded content in sd card in to write easily.. but most of the mobile device does not write in to sd card..

if it is work only for path

i given a path like this childrenbible/sdcard/ChildrenBible/images/

in more than one device it will work properly.... but in some few device work not

help me....

I am in big Trouble

Shihab Uddin
  • 6,699
  • 2
  • 59
  • 74
Alpan
  • 518
  • 1
  • 6
  • 20

3 Answers3

1

Sorry had to laugh but I feel for you!

Could you post your current code for what path you are selecting?

And could you clarify if you main problem is selecting the external storage path that will have sufficient space?

For android there are 2 positions

a) internal

b) external (still on device on some devices)

c) external (sdcard on some devices)

Option C is device specific.

either way, the readily availablle path can be found with

http://developer.android.com/reference/android/os/Environment.html#getExternalStorageDirectory%28%29

This is the function I use to find the best cache directory (for pictures, just change the subdir to whatever is most appropriate).

public static File getBestExtDir(Context applicationContext) {
    File path;

    if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
        path = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator + "Pictures");
    }
    else {
        //lets try internal storage
        path = applicationContext.getCacheDir();
    }

    if (path.exists()) {
        return path;
    }
    if (path.mkdirs()) {
        return path;
    }

    return null;
}
Pork 'n' Bunny
  • 6,740
  • 5
  • 25
  • 32
  • OK, now it will Solved but again I have a problem When i clear a catch then all the download content will be remove from their – Alpan Apr 29 '13 at 07:22
  • and also i can see some other app store content in Android/data/ApplicationContext/myfile/myfile2 – Alpan Apr 29 '13 at 07:28
1

please follow this may be it will help you..

here these are some hard coded path given for devices and to get path use Environment.getExternalStorageDirectory

SQLite Database in external Micro Sdcard

inside my link there are two link read them also

Community
  • 1
  • 1
Monty
  • 3,205
  • 8
  • 36
  • 61
  • again one problem When i clear catch then all the downloaded data will be lose – Alpan Apr 29 '13 at 07:18
  • yes you are right you can not prevent this ....if you clear it all data will be loss ..its depend on you where you want to save the data....internally or externally ..in externally you can prevent the data loss on clear – Monty Apr 29 '13 at 07:21
  • And how we can Store data externally same as a data/data/applicationcontext/myfile/myfile2 – Alpan Apr 29 '13 at 07:33
  • i think you did not gone through my given link .....you need to give your external sdcard given path. – Monty Apr 29 '13 at 08:43
0

Use Environment.getExternalStorageDirectory to find path to SD card.

Alexander Kulyakhtin
  • 47,782
  • 38
  • 107
  • 158
  • OK, now it will Solved but again I have a problem When i clear a catch then all the download content will be remove from their – Alpan Apr 29 '13 at 07:19