android 賬戶管理和同步機制,android賬戶管理

來源:互聯網
上載者:User

android 賬戶管理和同步機制,android賬戶管理

在用的時候,發現建立了自己的獨立賬戶管理,同時在連絡人中,可以直接點擊發送資訊,查看朋友圈等功能,感覺挺方便了

然後就做了相關方面的調研,主要從兩個方面,進行了研究

1、帳號管理的是實現機制和同步實現方式

這個看:http://blog.csdn.net/swust_chenpeng/article/details/39401497

或者直接:http://blog.csdn.net/w2865673691/article/details/37403147

http://blog.csdn.net/u010002056/article/details/9210157

2、關於同步syncAdapter

這個主要參考sdk sample中的SampleSyncAdapter

匯入可能提示的錯誤:

Permission is only granted to system apps android.permission.WRITE_SECURE_SETTINGS

Window -> Preferences -> Android -> Lint Error Checking.

In the list find an entry with ID = ProtectedPermission. Set the Severity to something lower than Error. This way you can still compile the project using Eclipse.

http://stackoverflow.com/questions/13801984/permission-is-only-granted-to-system-app


http://blog.csdn.net/xjanker2/article/details/6146289

這裡最後提到上傳到gae時,可能提示moudle找不到:“其中遇到的一個model moudle找不到的問題需要你在model中建立一個__init__.py的空檔案,來說明是一個python模組,如果你也遇到此問題,希望對你有協助。”

但是這個工程必須的配合server端使用,而server端需要搭建在Google App Engine,所以就得先在gae上建立一個app,然後記住appId即可。這是由於samplesyncadapter_server端的代碼是基於python實現,所有我們去https://developers.google.com/appengine/downloads#Google_App_Engine_SDK_for_Python下載Google App Engine SDK for Python下載下來進行解壓,關於它的使用,我們可以參考下:

http://blog.sina.com.cn/s/blog_bd0b53180101e9rw.html

http://lampeter123.iteye.com/blog/390536

http://www.qrong.com/archives/495

http://ego008.iteye.com/blog/554757

http://bbs.chinaunix.net/thread-1505938-1-1.html

感覺都差不多吧,隨便看個就行了,然後我們利用google_appengine目錄下(sdk的安裝目錄)的appcfg.py命令上傳服務端代碼到gae,命令:appcfg.py update \workspace\AuthenticatorActivity\samplesyncadapter_server\但是我這邊上傳的時候老提示出錯:appcfg.py:2416 An error occurred processing file '': HTTP Error 401: Unauthorized. Aborting.,不知道什麼原因,後來在appcfg.py後面加了個參數 --oauth2 ,具體原因不知道,可以看下:https://developers.google.com/appengine/docs/python/tools/uploadinganapp,上傳成功之後,我們再輸入:yourAppId/appspot..com我們sample syncadapter的頁面就出來了



然後在配合用戶端就可以用了

最後想要在連絡人中,點擊某個item,也能跳轉到指定的intent,我們可以再manifest.xml中進行配置:

 <activity            android:name=".authenticator.AuthenticatorActivity"            android:label="@string/ui_activity_title"            android:theme="@android:style/Theme.Dialog"            android:excludeFromRecents="true"            android:configChanges="orientation">            <intent-filter>                 <action                    android:name="android.intent.action.VIEW" />            <data                    android:mimeType="vnd.android.cursor.item/vnd.samplesyncadapter.profile"/>                <category android:name="android.intent.category.DEFAULT" />            </intent-filter>        </activity>


一定要加<category/>標籤不然,連絡人裡面無法調用該intent,這時候點擊對應的mineType類型,就可以跳轉到對應的Activity

從age上同步下來的連絡人時唯讀 了,不知道怎麼回事???


圖中彈出的對話方塊是點擊View Profile彈出來的Activity(theme是dialog樣式的)




怎解除安卓智可以機中“帳戶與同步”中的管理帳戶

你說應該是Google帳號,退出或者登出賬戶就可以了
 
安卓手機關掉帳戶與同步裡的背景資料會怎?

沒什麼影響,一切功能正常使用
時間設定跟背景同步沒關係,只要把時間設定為了“自動擷取網路的值”就行。
如果你QQ已處於離線狀態,那就不會有訊息發來的,就相當於把QQ斷開了。隱藏行了,幹嘛離線呀。。

不過,據我所知,有些大型遊戲是需要開背景資料才能玩的,不過一般手機也帶不起來。放心好了
 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.