--
You received this message because you are subscribed to the Google Groups "Mobile Couchbase" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mobile-couchba...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
If you are using Phonegap, you'll only be able to use views written in Javascript.
--
git clone https://github.com/couchbaselabs/Couchbase-Lite-PhoneGap-Plugin.git
cd project
phonegap local plugin add ../Couchbase-List-PhoneGap-Plugin
phonegap local plugin remove com.couchbase.lite.phonegap
phonegap local plugin add ../Couchbase-List-PhoneGap-Plugin
import com.couchbase.cblite.CBLDatabase;
import com.couchbase.cblite.CBLViewMapBlock;
import com.couchbase.cblite.CBLViewMapEmitBlock;
- CBLView.setCompiler(new CBLJavaScriptViewCompiler());
@@ -41,12 +45,25 @@ public class CBLite extends CordovaPlugin {
CBLURLStreamHandlerFactory.registerSelfIgnoreError();
- CBLView.setCompiler(new CBLJavaScriptViewCompiler());
-
String filesDir = this.cordova.getActivity().getFilesDir()
.getAbsolutePath();
CBLServer server = startCBLite(filesDir);
-
+
+ CBLDatabase db = server.getDatabaseNamed("treatment");
+ CBLView testView = db.getViewNamed("ivetTest/test");
+ testView.setMapReduceBlocks(new CBLViewMapBlock() {
+
+ @Override
+ public void map(Map<String, Object> document, CBLViewMapEmitBlock emitter) {
+ String type = (String)document.get("Type");
+ if( "TreatmentRecord".equals(type) ) {
+ emitter.emit( document.get("_id"), document.get("Location") );
+
+ }
+
+ }
+ }, null, "1.1");
+
listenPort = startCBLListener(DEFAULT_LISTEN_PORT, server);
System.out.println("initCBLite() completed successfully");
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/3bd01641-1b76-41fa-9164-ecf64ef35257%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to mobile-couchbase+unsubscribe@googlegroups.com.
I think there should be examples of that in https://github.com/couchbaselabs/TodoLite-PhoneGap.It should essentially be the same as making a view query via REST to CouchDB, so you can also check the CouchDB docs.@Chris -- I guess the recommended js library for talking to Couchbase Lite from javascript is "coax/hoax" right? Is there any others that people should be aware of that will make their lives easier?
To unsubscribe from this group and stop receiving emails from it, send an email to mobile-couchbase+unsubscribe@googlegroups.com.
But calling view from Phonegap is very slow!Having this logs all the time.02-14 00:45:05.685: D/dalvikvm(6462): WAIT_FOR_CONCURRENT_GC blocked 14ms02-14 00:45:05.715: V/CBLDatabase(6462): call map for sequence=1402-14 00:45:05.750: D/dalvikvm(6462): GC_CONCURRENT freed 492K, 27% free 13190K/17863K, paused 2ms+2ms, total 23ms
So, moving on native approach.
But it is not working when I call view "amiview" from phonegap.
--
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/bc488580-9fab-4f22-8a51-a0bc697e931f%40googlegroups.com.
var len = view['rows'].length;
var counter=0;var data=[];if(view['rows']!=null && view['rows'].length>0){for(j=0;j<view['rows'].length;j++){data.push(view['rows'][j].value);}}
--To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/CACSSHCHskg2tQ2ce8TckCh0j0PFZ314aidUP6UfztFhn2%3DqwVg%40mail.gmail.com.
You received this message because you are subscribed to a topic in the Google Groups "Couchbase Mobile" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mobile-couchbase/lAt7w3ntbKo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mobile-couchba...@googlegroups.com.
Hi!
I am using kendo UI listview for listing data in my Phonegap application.
For android, I set hardware acceleration="false" in my android manifest file.
< application android:hardwareAccelerated="false" >
It made a huge difference in performance.
How can I do this in iOS?
To unsubscribe from this group and stop receiving emails from it, send an email to mobile-couchbase+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/bc488580-9fab-4f22-8a51-a0bc697e931f%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.