Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Same problem I am facing, but after a long thorough reading over phonegap-cordova library, I found its lacking to provide the flexibility for selecting path. </p> <p>Reason may be because of cross platform limitation, library bound you to use the default app path so on different platform, library could get the file easily.</p> <p>but what!! there is a trick to achieve the target ....</p> <pre><code>function onDeviceReady() { var db = window.openDatabase("test", "1.0", "Test DB", 1000000); } </code></pre> <p>actually when JavaScript call the 'openDatabase()' function, its do following things</p> <ul> <li>add <strong>'/data/data/&lt; package_name_of_your_app>/'</strong> before db_name</li> <li>and add <strong>'.db'</strong> after db_name</li> </ul> <p>i.e : in above case resultant will be;</p> <blockquote> <p>/data/data/&lt; package_name_of_your_app>/test.db</p> </blockquote> <p>so the trick goes here;</p> <pre><code>function onDeviceReady() { var db = window.openDatabase("../../../../mnt/sdcard/test", "1.0", "Test DB", 1000000); } </code></pre> <ul> <li>add '../../../../mnt/sdcard/' before db_name, don't add extension since library add '.db' itself, if you add any extension then your db file will be <strong>db_name.(yourextension).db</strong></li> </ul> <p>now what! it will;</p> <ul> <li>add <strong>'/data/data/&lt; package_name_of_your_app>/'</strong> before db_name</li> <li>and add <strong>'.db'</strong> after db_name</li> <li>it will take your db_name '../../../../mnt/sdcard/test'</li> </ul> <p>therefore, resultant will be;</p> <blockquote> <p>/data/data/&lt; package_name_of_your_app>/../../../../mnt/sdcard/test.db</p> </blockquote> <p>so, it will back to root of your mobile and then <strong>/mnt/sdcard</strong></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload