thanks,

it seems the sqlite database opening mechanism is very complicated in
android.

even if i specify the file name to "0000000000000001.db" like the
followings:

      1. path = path + "/file__0/0000000000000001.db";
      2. path = path + "/../databases/webview.db";
      3. path = path + "/Databases.db";

i can see all these give error messages.
1, 3 declare the local table is missing.
2 can be initialized but not the database where the webview data is stored.

it is every different from the origin api from sqlite c;

because my application is based on webview,
it is not a good way to change it again to java api based which may cause
the data lose for users.

and web apps will be my focus later.

2011/8/20 Mark Murphy <[email protected]>

> On Sat, Aug 20, 2011 at 8:18 AM, 李白|字一日 <[email protected]> wrote:
> > hello everyone,
> > i have a problem in retrieving data stored in webview by using html
> > database.
> > and it is working perfectly on the html page.
> > as the application involves, there is a demand that i get the stored data
> > from the webview.
> > after investigating into the sdk, i didn't find a way to get the data,
> > because the webview database is named privately with names like
> > "0000000000000001.db"
> > and in directories like
> > "file__0".
> > i only set the database path by the following code:
> >     databasePath = this.getApplicationContext()
> >         .getDir("database", Context.MODE_PRIVATE).getPath();
> >     settings.setDatabasePath(databasePath);
> > which is different from the "0000000000000001.db" file name, and
> "file__0"
> > directory name.
> > so i can get the database data using given apis?
>
> I doubt it.
>
> Rather than having the JavaScript use an HTML database, you should
> have the JavaScript call an API your application exposes to the
> WebView via addJavascriptInterface(). This will allow you to keep all
> your business rules in the Java code, with a side benefit of being
> able to consistently use SQLiteOpenHelper and such for accessing the
> database.
>
> --
> Mark Murphy (a Commons Guy)
> http://commonsware.com | http://github.com/commonsguy
> http://commonsware.com/blog | http://twitter.com/commonsguy
>
> _The Busy Coder's Guide to Android Development_ Version 3.6 Available!
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to