I went through some online material both blogs and videos, and managed to
rectify the code. However, now i get a NullPointerException,

12-17 12:48:44.184: INFO/dalvikvm(327):     at
android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:203)
12-17 12:48:44.194: INFO/dalvikvm(327):     at
android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:98)
12-17 12:48:44.194: INFO/dalvikvm(327):     at
android.test.JavaScriptInterface.insertvalues(test.java:32)
12-17 12:48:44.224: INFO/dalvikvm(327):     at
android.test.JavaScriptInterface.gotit(test.java:23)
12-17 12:48:44.224: INFO/dalvikvm(327):     at
android.webkit.WebViewCore.nativeTouchUp(Native Method)
12-17 12:48:44.224: INFO/dalvikvm(327):     at
android.webkit.WebViewCore.nativeTouchUp(Native Method)
12-17 12:48:44.244: INFO/dalvikvm(327):     at
android.webkit.WebViewCore.access$3300(WebViewCore.java:52)
12-17 12:48:44.254: INFO/dalvikvm(327):     at
android.webkit.WebViewCore$EventHub$1.handleMessage(WebViewCore.java:1150)
12-17 12:48:44.264: INFO/dalvikvm(327):     at
android.os.Handler.dispatchMessage(Handler.java:99)
12-17 12:48:44.304: INFO/dalvikvm(327):     at
android.os.Looper.loop(Looper.java:123)
12-17 12:48:44.304: INFO/dalvikvm(327):     at
android.webkit.WebViewCore$WebCoreThread.run(WebViewCore.java:621)
12-17 12:48:44.334: INFO/dalvikvm(327):     at
java.lang.Thread.run(Thread.java:1096)


It would be helpful if someone could provide some pointers to handle this. I
could use catch and finally blocks, but the database should open atleast.

Thanks.

Cuil



On Thu, Dec 16, 2010 at 6:23 PM, cuil yahoo <[email protected]> wrote:

> Hello,
>
> I am trying to use a database to store a huge text in it serially(using a
> primary key, for easy searching).
>
> I have already done the following things,
>
> 1. Created a SQLite database(named database) using the SQLite Database
> Browser, and have imported that to my assets folder in Eclipse. The database
> has two fields one _id(primarykey) and saveme(the text field).
>
> 2. Now, i want to write stuff in this database, however when i try to open
> the database using the code below, i get a SQLite Code 14 type of an error(
> which on a google result showed up error on opening of database).
>
> SQLiteDatabase writedatabase = null;
> writedatabase.openDatabase("file:///android_asset/database",null,0);
> writedatabase.execSQL("INSERT INTO " + "database" + " Values ('1',
> 'first')");
>
>
> It would be really very helpful, if someone could please point the error in
> the steps.
>
> Thanks.
>
> Cuil
>
>
>

-- 
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