android & couchbase app -- ok, now can share little

1. activity_main.xml => tools:context=".MainActivity" => MainActivity.java …….I try first… is more better then post. ========= ========= ===== suggestion newbie ===== https://github.com/couchbaselabs/CouchbaseLite-DevDay-StarterKit https://github.com/couchbaselabs/GrocerySync-Android https://github.com/couchbaselabs/ToDoLite-Android (Hard Understand) SO see this first: http://sueboy.blogspot.com/2015/06/couchbase-todolist-get-database-sync.html ========= MainActivity.java BuildConfig – 來自 build.gradle ( Module.app ) 目錄app – build.gradle extends ActionBarActivity – http://blog.tonycube.com/2014/02/android-actionbarcompat-1.html Intent – http://www.imyukin.com/?p=183 – http://kezeodsnx.pixnet.net/blog/post/27072894-android-----%E6%87%89%E7%94%A8%E7%A8%8B%E5%BC%8F%E8%87%AA%E6%88%91%E4%BB%8B%E7%B4%B9%E4%B9%8Bintent-resolution startService – http://blog.maxkit.com.tw/2014/01/android-serviceintentservice.html – http://blog.kenyang.net/2012/11/android-startservice-vs-bindservice.html – http://blog.csdn.net/biezhihua/article/details/44439897 context.bindService() <==> context.startService() context.startService() ==> Service <==> IntentService AsyncTask – http://a-can.logdown.com/blog/201623/android-asynctask-asynchronous-functions-are-carefully Observer – http://www.apkbus.com/android-112815-1-1.html runOnUiThread – http://lak4cyut.blogspot.com/2011/03/android-tip-activityrunonuithread.html – http://blog.csdn.net/zhang_yanye/article/details/40794629 getApplication Application.java – http://www.cnblogs.com/duanxz/p/4379800.html Replication 同步local到remote – http://developer.couchbase.com/mobile/develop/references/couchbase-lite/couchbase-lite/replication/index.html ...

2015-06-16 · 2 min · 292 words · Me

couchbase basic auth basicAuth startReplicationSyncWithBasicAuth --- How To Do

突然想到,他的basic auth,其實不是用來給系統用的,是給app用的 也就是app每一支都是用同樣的basicAuth id/pwd登入,區分 管理者和一般使用者 而一般使用者註冊後,帳密是另外開一個doucment,之後所有的文件管理是自己要控制的 跟mysql的一樣,不會給每個人有basic auth,權限管理,也是在sql下的時候,抓出資料做判斷 所以才會在 add user時,用restful curd,使用者代表不同的專案 ========== This is my think: couchbase basic auth is not for every body login. It is app connect to sync_gateway for auth. Example is have normal user and Admin user. Maybe login sync_gateway, that get different document、channel、sync. Normal user registered. The register data put in document, Maybe document name is “members” then system programmer need to control document show or not by permit. Like sql not everybody register, then get login mysql account. Only one account connect. After login, everythings is by program control. ...

2015-06-16 · 2 min · 331 words · Me

graphical http client restful

https://code.google.com/p/im-only-resting/ http://www.swensensoftware.com/im-only-resting https://github.com/wiztools/rest-client

2015-06-15 · 1 min · 3 words · Me

RecyclerView onclick

RecyclerView step 3 step1 public class xxxxxxxx extends RecyclerView.Adapter<MyAdapter.ViewHolder> implements View.OnClickListener { step2 public void onBindViewHolder(RecyclerView.ViewHolder viewHolder, int position viewHolder.textView.setOnClickListener(this); textView is findViewById(R.id.xxxxxxxxx) step3 @Override public void onClick(View view) { int viewId = view.getId(); if (viewId == R.id.xxxxxxxxx) { //which item click if (onItemClickListener != null) { onItemClickListener.onItemClick(view, (Integer) view.getTag()); } } } view.getTag() maybe null

2015-06-14 · 1 min · 56 words · Me

about RecyclerView error: android.widget.LinearLayout cannot be cast to android.widget.TextView

https://developer.android.com/training/material/lists-cards.html I think many people, try to do this demo. But this demo is not good, because some things no show. like: RecyclerView .xml to a layout:…….only little, but ok, this not import. MyAdapter .xml no layout: this is bad. Get error in here. so, follow this do is better http://stackoverflow.com/questions/28407768/android-widget-linearlayout-cannot-be-cast-to-android-widget-textview-in-recycle Gorcyn is good guy~~ ^ ^ But what different with android demo (fxxxxxxxxxxxxxx) android: public ViewHolder(TextView v) { mTextView = v; good guy: ...

2015-06-14 · 1 min · 148 words · Me