跳到主要內容

發表文章

目前顯示的是 十月, 2016的文章

trouble with Integrating Google Sign-In into Your Android App

整合Google sign-in 到app所遇到的問題 :

問題真多:
都不能sign-in,花了3小時多... 照這篇作根本不能成功: https://developers.google.com/identity/sign-in/android/start?configured=true
你全部都設對也沒用..google-services.json怎麼改,就是不能登入.. 出現 Google Sign-In Status = {statusCode=DEVELOPER_ERROR, resolution=null} , 什麼是 DEVELOPER_ERROR ??? 最後,才發現... 這sample project預設沒設定debug keystore 用誰..
那這樣的話,android studio到底是用哪個key去build出apk的?不是預設都是用嗎? 所以你如果沒發現這,怎麼build都不會run成功的.. 一般人也不會知道...這根本就是陷阱嘛...
終於在自己增加這keystore setting 後..

重新build一次. 終於成功sign-in了....

Support V4,v7

從以前到現在就一直對v4,v7不了解,都直接用... 為何要import這些library? android v22後又加了appcompact library...更煩..
requires that all activities extend from AppCompatActivity, 還要用toolbar.... 只是為了向下相容.. 但我都已經設定min api=15... 幹嘛要向下相容api 4 or api 7...這些? 不import,但使用到的library 還是會import... 總之就是很累綴,整個app size就一直變大.. When should I use the Android Support Library? You should use one of the support libraries when you need specific framework features that are newer than the minSdkVersion of your app or that are not available in the standard framework.

comment:簡單講就是如果我不想向下相容,就不需要...現在api 15以上,都>90%...

Support V4 : Backward Compatibility- It includes many features and, as its name suggests, supports back to API 4.
v7-appcompat library : provides support implementations for ActionBar (introduced in API 11) and Toolbar (introduced in API 21) for releases back to API 7.

ps: import appcompat-v7之後就不需要import Support  v4了,因為v7 default import v4. (這也是我說的就算我不import...還是會被library給自動import..) 如果不想import 整個v7:還有較小的 (其實我都不想import啊...) v7-recyclerv…