More Info on LiveQuery - CBLite Android?

85 views
Skip to first unread message

Pankaj Jakhar

unread,
Feb 11, 2014, 5:28:05 AM2/11/14
to mobile-c...@googlegroups.com


I am currently doing my research work on GrocerySync-Android application. I have separated the classes for creating/starting LiveQuery(es). But often querying or change in rows of an index, I am getting this exception.


02-11 15:47:11.351: E/Database(14237): Error getting last sequence indexed
02-11 15:47:11.431: E/AndroidRuntime(14237): FATAL EXCEPTION: main
02-11 15:47:11.431: E/AndroidRuntime(14237): java.lang.NullPointerException
02-11 15:47:11.431: E/AndroidRuntime(14237): at com.innotion.protean.MainActivity.getRowsFromQueryEnumerator(MainActivity.java:169)
02-11 15:47:11.431: E/AndroidRuntime(14237): at com.innotion.protean.MainActivity.displayRows(MainActivity.java:149)
02-11 15:47:11.431: E/AndroidRuntime(14237): at com.innotion.protean.MainActivity$5.run(MainActivity.java:388)
02-11 15:47:11.431: E/AndroidRuntime(14237): at android.os.Handler.handleCallback(Handler.java:725)
02-11 15:47:11.431: E/AndroidRuntime(14237): at android.os.Handler.dispatchMessage(Handler.java:92)
02-11 15:47:11.431: E/AndroidRuntime(14237): at android.os.Looper.loop(Looper.java:137)
02-11 15:47:11.431: E/AndroidRuntime(14237): at android.app.ActivityThread.main(ActivityThread.java:5306)
02-11 15:47:11.431: E/AndroidRuntime(14237): at java.lang.reflect.Method.invokeNative(Native Method)
02-11 15:47:11.431: E/AndroidRuntime(14237): at java.lang.reflect.Method.invoke(Method.java:511)
02-11 15:47:11.431: E/AndroidRuntime(14237): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
02-11 15:47:11.431: E/AndroidRuntime(14237): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
02-11 15:47:11.431: E/AndroidRuntime(14237): at dalvik.system.NativeStart.main(Native Method)

What might be the cause of this Error?

How exactly a LiveQuery works? Do I need to start LiveQuery at every point when my Activity comes into foreground? How exactly LiveQuery instances work and how should they be created? If I need to call start() and stop() whenever Activity needs LiveQuery and need to release LiveQuery when my work is done on that Activity. 

How exactly the LiveQuery's behavior is? (I know about its functionality but I want to know its exact behavior).

PRASASNNA KUMAR

unread,
Feb 11, 2014, 6:57:23 AM2/11/14
to mobile-c...@googlegroups.com
I think you should first execute the Views(with a view name while creating the local database) before executing LiveQuery,by using that view name we can execute the LiveQuery.

Pankaj Jakhar

unread,
Feb 11, 2014, 8:46:05 AM2/11/14
to mobile-c...@googlegroups.com
That is already taken care. It is the basic part, I can not run LiveQuery without a View.

Traun Leyden

unread,
Feb 17, 2014, 6:21:35 PM2/17/14
to mobile-c...@googlegroups.com
There's an example of using a LiveQuery in GrocerySync.

Can you provide a minimal code example that reproduces this issue?


--
You received this message because you are subscribed to the Google Groups "Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mobile-couchba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/676044f0-14ad-41e5-8d70-dd4d27687beb%40googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages