1 / 43

Android的 账户同步备份 框架

Android的 账户同步备份 框架. 乐众Rom架构师 盛大创新院 郭振. 北漂,攻城狮. 霍华德图片. http://p.yoho.cn/11670215.jpg. 为什么呢??. 服务. Google Service Framework. 账户:Gmail,Google play,G+,Google Now 同步: Google Sync 备份:Google Data Backup. 设计一个同步备份的软件. 功能需求. 设计盛大服务统一入口:盛大账户,共享登陆成果. 将通讯录和日历信息同步到服务器上.

Télécharger la présentation

Android的 账户同步备份 框架

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Android的账户同步备份框架 乐众Rom架构师 盛大创新院 郭振

  2. 北漂,攻城狮 霍华德图片 http://p.yoho.cn/11670215.jpg

  3. 为什么呢??

  4. 服务

  5. Google Service Framework • 账户:Gmail,Google play,G+,Google Now • 同步: Google Sync • 备份:Google Data Backup

  6. 设计一个同步备份的软件

  7. 功能需求 设计盛大服务统一入口:盛大账户,共享登陆成果 将通讯录和日历信息同步到服务器上 将通话记录,短信,系统设置等信息备份到存储卡

  8. 交互界面

  9. 交互界面

  10. 交互界面

  11. 盛大账户的设计

  12. 一般的账户模块设计

  13. 账户管理是什么 提供了集中的账户访问接口 AccoutManager public Account[] getAccountsByType(String type) public getAuthToken() 管理多账户和存储账户信息

  14. 结构

  15. AccountAuthenticatorActivity AbstractAccountAuthenticator SndaAuthenticator 1:getAuthToken(Account) 2:addAccount(AccountType) 。。。。 SndaAccountActivity 用户输入用户名和密码 连接到账户server进行验证 把获得的证书存储到设备上 AuthenticaltorService mAccountManager.addAccountExplicitly (account, mPassword, null); <action android:name= "android.accounts. AccountAuthenticator" />

  16. 注意 1:账户Server支持,Web服务接入 2:注意账户信息的安全

  17. 如何调用 1:GET_ACCOUNTS权限 2:请求流程: AccountType:com.snda

  18. Account & Sync的设置

  19. 功能需求 使用盛大账户登录,且登录之后,其他应用无需再登录 将通讯录和日历信息同步到服务器上

  20. PIM同步设计

  21. 同步管理框架 处理基于账户的信息同步 只负责调度控制各同步流程,具体协议,服务,操作各App自行开发 gmail的通讯录,calendar同步,FaceBook自动更新

  22. 架构图

  23. 通讯录同步 AbstractThreadSyncAdapter ContactSyncrAdapter OnPerformSync() ContactManager SyncContacts() SyncService <action android:name= " android:name="android.content.SyncAdapter" />" />

  24. 功能需求 使用盛大账户登录,且登录之后,其他应用无需再登录 将通讯录和日历信息同步到服务器上 将通话记录,短信,系统设置备份到存储卡

  25. Google如何设计的数据备份的?

  26. App BackupAgent dataChanged BackupManagerService ServiceKey 云端存储 GoogleTransaportor LocalTransport Cache

  27. BackupAgent CalllogBackupAgent onBackup()和onRestore() 在manifest文件内用android:backupAgent 属性声明备份代理和backup key

  28. 我们怎么做?

  29. 1:抛弃框架,直接读写数据库 2:获得Root权限,通过shell命令将应用的data数据强制拷贝到sd卡下 3:扩展备份系统

  30. 扩展备份系统 • 扩展Transport,负责与存储信息 • IBackupTransport.Stub • performBackup • preformRestore • 版本管理 • 界面开发

  31. 功能需求 使用盛大账户登录,且登录之后,其他应用无需再登录 将通讯录和日历信息同步到服务器上 将通话记录,短信,系统设置,应用程序备份到存储卡

  32. 回顾 • 账户管理 • 同步管理 • 备份管理

  33. 乐众ROM:娱乐+大众

  34. 娱乐:依托盛大集团资源打造手机娱乐平台

  35. 大众:高、中、低端 16款机型全面覆盖

  36. Q&A Email: guozhen@sdna.com weibo: weibo.com/guozhen01

More Related