Nebular Dust Nebular Dust - 1 year ago 96
Android Question

Android 5.1.1 app doesn't see local files

I made a website and turned it into Android app, using Phonegap website. I have files stored on a local storage on ASUS TF300 tablet, and I need an app to access them. To access the files I use links like that:


Now the funny part. If I open this link in Chrome, Firefox or any other browser on my tablet - the image loads up. But if I launch an app with the same link in its index.html, the image doesn't load at all.

What could it be? Is a storage path somehow different for the apps and for browsers?

Answer Source

Looks like you need to add this into your app AndroidManifest.xml :

<manifest ...>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

UPDATE from chat conversation (based on this thread) :

Add config.xml:

<preference name="AndroidPersistentFileLocation" value="Compatibility" /> 
<preference name="AndroidExtraFilesystems" value="sdcard,cache" />

file pathes should be like following:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download