Importing word lists

Support forum for our fast, user-friendly offline Chinese language study apps for Google Android devices:

Hanping Chinese Dictionary (Lite & Pro)
Hanping Cantonese Dictionary
Hanping Chinese Camera
Hanping Chinese Popup
chriskie
Posts: 14
Joined: 21 Nov 2011, 08:23

Re: Importing word lists

Post by chriskie »

Ok, still can't seem to make that work. I couldn't drop columns using SQLite browser, so I exported as SQL, modified and re-created the database without the key1 column, as follows:

CREATE TABLE android_metadata (locale TEXT);
INSERT INTO android_metadata VALUES('en_GB');
CREATE TABLE list (_id INTEGER PRIMARY KEY,key2 TEXT,key3 TEXT);
INSERT INTO list VALUES(1,'的',' de5 ');
INSERT INTO list VALUES(2,'是',' shi4 ');
INSERT INTO list VALUES(3,'个',' ge4 ');
INSERT INTO list VALUES(4,'见',' jian1 ');

However, trying to access this list on the app crashes it ("stopped unexpectedly"). What am I doing wrong?

hanping
Site Admin
Posts: 470
Joined: 18 Mar 2010, 08:52

Re: Importing word lists

Post by hanping »

That should work. Please can you look at the logs. CatLog (from Android Market) should help you with that.

chriskie
Posts: 14
Joined: 21 Nov 2011, 08:23

Re: Importing word lists

Post by chriskie »

Got the log entries, but don't seem to be able to attach a file on this forum? The jist of it seems to be:

11-23 12:38:53.636 I/SubjectService(25288): Attaching db: /mnt/sdcard/Android/data/com.embermitre.dictroid/zh/lists/new3.wls
11-23 12:38:53.636 I/i (25288): Running static list query for id: new3
11-23 12:38:53.916 I/SearchActivity(25288): queryText changed to:
11-23 12:38:53.916 D/SearchActivity(25288): hideSoftInput: false
11-23 12:38:53.976 D/AndroidRuntime(25288): Shutting down VM
11-23 12:38:53.976 W/dalvikvm(25288): threadid=1: thread exiting with uncaught exception (group=0x400259f8)
11-23 12:38:53.986 E/c (25288): uncaughtException
11-23 12:38:53.986 E/c (25288): java.lang.NullPointerException: hanzi is null

Then blah blah and then:

11-23 12:38:53.996 I/c (25288): uncaughtException: NullPointerException: {stack00=java.lang.NullPointerException: hanzi is null, stack01=at com.embermitre.dictroid.b.av.a(SourceFile:189), stack02=at com.embermitre.dictroid.b.au.a(SourceFile:107), stack03=at com.embermitre.dictroid.b.au.b(SourceFile:66), stack04=at com.embermitre.dictroid.b.au.a(SourceFile:48), stack05=at com.embermitre.dictroid.b.l.a(SourceFile:59), stack06=at com.embermitre.dictroid.b.a.a(SourceFile:96), stack07=at com.embermitre.dictroid.framework.as.a(SourceFile:133), stack08=at com.embermitre.dictroid.framework.ar.bindView(SourceFile:98), stack09=at android.widget.CursorAdapter.getView(CursorAdapter.java:186), stack10=at com.embermitre.dictroid.util.p.getView(SourceFile:63), stack11=at android.widget.AbsListView.obtainView(AbsListView.java:1294), stack12=at android.widget.ListView.measureHeightOfChildren(ListView.java:1198), stack13=at android.widget.ListView.onMeasure(ListView.java:1109), stack14=at android.view.View.measure(View.java:8172), stack15=at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3140), stack16=at android.widget.FrameLayout.onMeasure(FrameLayout.java:245), stack17=at android.view.View.measure(View.java:8172), stack18=at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3140), stack19=at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1012), stack20=at android.widget.LinearLayout.measureVertical(LinearLayout.java:381), stack21=at android.widget.LinearLayout.onMeasure(LinearLayout.java:304), stack22=at android.view.View.measure(View.java:8172), stack23=at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3140), stack24=at android.widget.FrameLayout.onMeasure(FrameLayout.java:245), stack25=at android.view.View.measure(View.java:8172), stack26=at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3140), stack27=at android.widget.FrameLayout.onMeasure(FrameLayout.java:245), stack28=at android.view.View.measure(View.java:8172), stack29=at android.view.ViewRoot.performTraversals(ViewRoot.java:805), stack30=at android.view.ViewRoot.handleMessage(ViewRoot.java:1744), stack31=at android.os.Handler.dispatchMessage(Handler.java:99), stack32=at android.os.Looper.loop(Looper.java:144), stack33=at android.app.ActivityThread.main(ActivityThread.java:4937), stack34=at java.lang.reflect.Method.invokeNative(Method.java:-2), stack35=at java.lang.reflect.Method.invoke(Method.java:521), stack36=at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868), stack37=at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626), stack38=at dalvik.system.NativeStart.main(NativeStart.java:-2), thread=main, envLocale=en_GB, envBuild=8|HTC Desire|FRF91}
11-23 12:38:54.026 E/AndroidRuntime(25288): FATAL EXCEPTION: main
11-23 12:38:54.026 E/AndroidRuntime(25288): java.lang.NullPointerException: hanzi is null

hanping
Site Admin
Posts: 470
Joined: 18 Mar 2010, 08:52

Re: Importing word lists

Post by hanping »

Thanks very much. Are your display settings set to Traditional chars or Simplified?

chriskie
Posts: 14
Joined: 21 Nov 2011, 08:23

Re: Importing word lists

Post by chriskie »

Ah.. They were set to Simplified [ Traditional ]. When I set them to simplified only, it works :) Thanks.

hanping
Site Admin
Posts: 470
Joined: 18 Mar 2010, 08:52

Re: Importing word lists

Post by hanping »

Ok, that sounds like a bug - I will look into it :)

chriskie
Posts: 14
Joined: 21 Nov 2011, 08:23

Re: Importing word lists

Post by chriskie »

I guess until you have people like me messing around with your lists, it's a bug no one's going to notice ..

hanping
Site Admin
Posts: 470
Joined: 18 Mar 2010, 08:52

Re: Importing word lists

Post by hanping »

Hi Chris - I just checked the problem, and it's an easy fix so you will see the fix in the next Hanping update. Are you in a rush for it?

hanping
Site Admin
Posts: 470
Joined: 18 Mar 2010, 08:52

Re: Importing word lists

Post by hanping »

Here is a (potentially) fun exercise. Create a list using the 100 most common Chinese surnames:

http://bjx.mingba.cn

If anyone would like to share their lists then I can set up a topic to keep them all together.

Post Reply