android - Writing to database located on sdcard in phonegap is not working -


i working on phonegap application, here condition,

i have sqlite database saved on sdcard, want access through phonegap.

i able access using following code

var db = window.opendatabase("../../../../mnt/sdcard/test", "1.0", "test db", 1000000);

but same code not working devices. above code working on emulator, samsung tab2. when deployed application on mobile phone not working.

following manifest file.

<uses-permission android:name="android.permission.camera" /> <uses-permission android:name="android.permission.vibrate" /> <uses-permission android:name="android.permission.access_coarse_location" /> <uses-permission android:name="android.permission.access_fine_location" /> <uses-permission android:name="android.permission.access_location_extra_commands" /> <uses-permission android:name="android.permission.internet" /> <uses-permission android:name="android.permission.receive_sms" /> <uses-permission android:name="android.permission.record_audio" /> <uses-permission android:name="android.permission.record_video"/> <uses-permission android:name="android.permission.modify_audio_settings" /> <uses-permission android:name="android.permission.read_contacts" /> <uses-permission android:name="android.permission.write_contacts" />    <uses-permission android:name="android.permission.write_external_storage" />    <uses-permission android:name="android.permission.access_network_state" /> <uses-permission android:name="android.permission.get_accounts" /> <uses-permission android:name="android.permission.broadcast_sticky" />   <application android:icon="@drawable/icon" android:label="@string/app_name"     android:hardwareaccelerated="true"     android:debuggable="true">     <activity android:name="test" android:label="@string/app_name"             android:theme="@android:style/theme.black.notitlebar"             android:configchanges="orientation|keyboardhidden|keyboard|screensize|locale">         <intent-filter>             <action android:name="android.intent.action.main" />             <category android:name="android.intent.category.launcher" />         </intent-filter>     </activity> </application>  <uses-sdk android:minsdkversion="7" android:targetsdkversion="17"/> 

add <uses-permission android:name="android.permission.read_external_storage" /> permission in manifest file.

refer read_external_storage documentation.

hope helps.


Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -