Ty Smith - @tylersmithnet
Sr. Android Engineer, Evernote
App to App: Design and
Surface Local APIs
Sunday, September 29, 13
#EC2013
The S Note Story
Sunday, September 29, 13
#EC2013
The S Note Story
Sunday, September 29, 13
#EC2013
The S Note Story
Sunday, September 29, 13
#EC2013
The S Note Story
Sunday, September 29, 13
#EC2013
The S Note Story
Sunday, September 29, 13
#EC2013
The S Note Story
Sunday, September 29, 13
#EC2013
Web API vs Local API
Sunday, September 29, 13
#EC2013
Web API vs Local API
Web API
•Powerful
•Flexible
•Comfortable
•Complex
•Inconsistent data
•Service limitations
Loc...
#EC2013
Web API vs Local API
Web API
•Powerful
•Flexible
•Comfortable
•Complex
•Inconsistent data
•Service limitations
Loc...
#EC2013
Web API vs Local API
Web API
•Powerful
•Flexible
•Comfortable
•Complex
•Inconsistent data
•Service limitations
Loc...
#EC2013
Web API vs Local API
Web API
•Powerful
•Flexible
•Comfortable
•Complex
•Inconsistent data
•Service limitations
Loc...
#EC2013
Web API vs Local API
Web API
•Powerful
•Flexible
•Comfortable
•Complex
•Inconsistent data
•Service limitations
Loc...
#EC2013
Web API vs Local API
Web API
•Powerful
•Flexible
•Comfortable
•Complex
•Inconsistent data
•Service limitations
Loc...
#EC2013
What next?
Sunday, September 29, 13
#EC2013
What next?
Sunday, September 29, 13
#EC2013
Android Components
Sunday, September 29, 13
#EC2013
Android Components
1. Intents
Sunday, September 29, 13
#EC2013
Android Components
1. Intents
2. Content Provider
Sunday, September 29, 13
#EC2013
Android Components
1. Intents
2. Content Provider
3. Account Manager
Sunday, September 29, 13
#EC2013
Android Components
1. Intents
2. Content Provider
3. Account Manager
4. Sync Adapter
Sunday, September 29, 13
#EC2013
Android Components
1. Intents
2. Content Provider
3. Account Manager
4. Sync Adapter
5. Bound Service
Sunday, Sept...
#EC2013
Intents
Sunday, September 29, 13
#EC2013
Intents
•Simple message between two components
Sunday, September 29, 13
#EC2013
Intents
•Simple message between two components
•Bundle - key/value data
Sunday, September 29, 13
#EC2013
Intents
•Simple message between two components
•Bundle - key/value data
•Limited payload size (500k)
Sunday, Septe...
#EC2013
Intents
•Simple message between two components
•Bundle - key/value data
•Limited payload size (500k)
•Inefficient fo...
#EC2013
Intents
•Simple message between two components
•Bundle - key/value data
•Limited payload size (500k)
•Inefficient fo...
#EC2013
Intents: Android Standards
Sunday, September 29, 13
#EC2013
Intents: Android Standards
•Intent.ACTION_SEND
Sunday, September 29, 13
#EC2013
Intents: Android Standards
•Intent.ACTION_SEND
•Intent.EXTRA_STREAM
Sunday, September 29, 13
#EC2013
Intents: Android Standards
•Intent.ACTION_SEND
•Intent.EXTRA_STREAM
•Intent.ACTION_VIEW
Sunday, September 29, 13
#EC2013
Intents: Android Standards
•Intent.ACTION_SEND
•Intent.EXTRA_STREAM
•Intent.ACTION_VIEW
•Intent.ACTION_EDIT
Sunday...
#EC2013
Intents: View And EDIT
Sunday, September 29, 13
#EC2013
Intents: View And EDIT
•Set Action
Sunday, September 29, 13
#EC2013
Intents: View And EDIT
•Set Action
•Data URI
Sunday, September 29, 13
#EC2013
Intents: View And EDIT
•Set Action
•Data URI
•MIME Type
Sunday, September 29, 13
#EC2013
Intents: View And EDIT
•Set Action
•Data URI
•MIME Type
•startActivity...
ForResult()
Sunday, September 29, 13
#EC2013
Intents: View And EDIT
•Set Action
•Data URI
•MIME Type
•startActivity...
ForResult()
•onActivityResult()
Sunday, ...
#EC2013
Intents: Evernote CRUD
gist.github.com/TylerSmithNet/6735496
Sunday, September 29, 13
#EC2013
Intents: Evernote CRUD
public static final String NOTE_PICKER = "com.evernote.action.NOTE_PICKER";
 
public static...
#EC2013
Intents: New Note Overview
gist.github.com/TylerSmithNet/6735496
Sunday, September 29, 13
#EC2013
Intents: New Note Overview
gist.github.com/TylerSmithNet/6735496
Sunday, September 29, 13
#EC2013
Intents: New Note Overview
gist.github.com/TylerSmithNet/6735496
Sunday, September 29, 13
#EC2013
Intents: New Note Overview
gist.github.com/TylerSmithNet/6735496
Sunday, September 29, 13
#EC2013
Intents: New Note Overview
gist.github.com/TylerSmithNet/6735496
Sunday, September 29, 13
#EC2013
Intents: New Note Overview
gist.github.com/TylerSmithNet/6735496
Sunday, September 29, 13
#EC2013
Intents: New Note Overview
New Note Intent
gist.github.com/TylerSmithNet/6735496
Sunday, September 29, 13
#EC2013
Intents: New Note Overview
New Note Intent
gist.github.com/TylerSmithNet/6735496
Sunday, September 29, 13
#EC2013
Intents: New Note Overview
New Note Intent
gist.github.com/TylerSmithNet/6735496
Sunday, September 29, 13
#EC2013
Intents: New Note Overview
New Note Intent
onActivityResult()
gist.github.com/TylerSmithNet/6735496
Sunday, Septem...
#EC2013
Intents: Evernote New Note
gist.github.com/TylerSmithNet/6735496
Sunday, September 29, 13
#EC2013
Intents: Evernote New Note
public static final String NEW_NOTE = "com.evernote.action.CREATE_NEW_NOTE";
public voi...
#EC2013
Content Provider
Sunday, September 29, 13
#EC2013
Content Provider
•A well defined database access layer
Sunday, September 29, 13
#EC2013
Content Provider
•A well defined database access layer
•SQLite
Sunday, September 29, 13
#EC2013
Content Provider
•A well defined database access layer
•SQLite
•Interact with large volumes of data
Sunday, Septemb...
#EC2013
Content Provider
•A well defined database access layer
•SQLite
•Interact with large volumes of data
•Authority
Sund...
#EC2013
Content Provider
•A well defined database access layer
•SQLite
•Interact with large volumes of data
•Authority
•Per...
#EC2013
Content Provider: URI
content:// com.example / notes / 1
Sunday, September 29, 13
#EC2013
Content Provider: URI
content:// com.example / notes / 1
Scheme
Sunday, September 29, 13
#EC2013
Content Provider: URI
content:// com.example / notes / 1
Scheme Authority
Sunday, September 29, 13
#EC2013
Content Provider: URI
content:// com.example / notes / 1
Scheme Authority Data Type
Sunday, September 29, 13
#EC2013
Content Provider: URI
content:// com.example / notes / 1
Scheme Authority Data Type Id
Sunday, September 29, 13
#EC2013
Content Provider: Implementing
Sunday, September 29, 13
#EC2013
Content Provider: Implementing
•Override Methods
Sunday, September 29, 13
#EC2013
Content Provider: Implementing
•Override Methods
•URI Matcher
Sunday, September 29, 13
#EC2013
Content Provider: Implementing
•Override Methods
•URI Matcher
•Cursors
Sunday, September 29, 13
#EC2013
Content Provider: Implementing
•Override Methods
•URI Matcher
•Cursors
•File Handlers
Sunday, September 29, 13
#EC2013
Content Provider: Query
Sunday, September 29, 13
#EC2013
Content Provider: Query
Uri authUri = Uri.parse("content://com.evernote.evernoteprovider"); 
Uri notesUri = Uri.wi...
#EC2013
Account Manager
Sunday, September 29, 13
#EC2013
Account Manager
•Accessible Account
Sunday, September 29, 13
#EC2013
Account Manager
•Accessible Account
•Third Party Auth
Sunday, September 29, 13
#EC2013
Account Manager
•Accessible Account
•Third Party Auth
•Consistent Settings
Sunday, September 29, 13
#EC2013
Account Manager: OAuth
Sunday, September 29, 13
#EC2013
Account Manager: OAuth
Sunday, September 29, 13
#EC2013
Account Manager: OAuth
Sunday, September 29, 13
#EC2013
Account Manager: OAuth
Sunday, September 29, 13
#EC2013
Account Manager: OAuth
Sunday, September 29, 13
#EC2013
Account Manager: OAuth
Sunday, September 29, 13
#EC2013
Account Manager: OAuth
getAuthToken(...)
Sunday, September 29, 13
#EC2013
Account Manager: OAuth
getAuthToken(...)
Sunday, September 29, 13
#EC2013
Account Manager: OAuth
getAuthToken(...)
Sunday, September 29, 13
#EC2013
Account Manager: OAuth
getAuthToken(...)
Future<Bundle>
Sunday, September 29, 13
#EC2013
Sync Adapter
Sunday, September 29, 13
#EC2013
Sync Adapter
•Synchronizes App
and Web Service
Sunday, September 29, 13
#EC2013
Sync Adapter
•Synchronizes App
and Web Service
•Network/battery
optimized syncing
Sunday, September 29, 13
#EC2013
Sync Adapter
•Synchronizes App
and Web Service
•Network/battery
optimized syncing
•Provided to third
party apps
Su...
#EC2013
Sync Adapter
•Synchronizes App
and Web Service
•Network/battery
optimized syncing
•Provided to third
party apps
•S...
#EC2013
Sync Adapter: Caveats
Sunday, September 29, 13
#EC2013
Sync Adapter: Caveats
•Requires Content Provider
and Account Manager
Sunday, September 29, 13
#EC2013
Sync Adapter: Caveats
•Sync every hour
ContentResolver.addPeriodicSync(account,
EvernoteContract.AUTHORITY,
new Bu...
#EC2013
Sync Adapter: Caveats
•Sync every hour
ContentResolver.addPeriodicSync(account,
EvernoteContract.AUTHORITY,
new Bu...
#EC2013
Sync Adapter: Caveats
•Sync every hour
ContentResolver.addPeriodicSync(account,
EvernoteContract.AUTHORITY,
new Bu...
#EC2013
Bound Service
Sunday, September 29, 13
#EC2013
Bound Service
•Android Interface Definition Language (AIDL)
Sunday, September 29, 13
#EC2013
Bound Service
•Android Interface Definition Language (AIDL)
•Directly call defined methods
Sunday, September 29, 13
#EC2013
Bound Service
•Android Interface Definition Language (AIDL)
•Directly call defined methods
•Communicate between proc...
#EC2013
Bound Service
•Android Interface Definition Language (AIDL)
•Directly call defined methods
•Communicate between proc...
#EC2013
Bound Service: Evernote and Dashclock
github.com/TylerSmithNet/EvernoteReminderDashclock
Sunday, September 29, 13
#EC2013
Bound Service: Evernote and Dashclock
•Implements
Dashclock jar (AIDL)
github.com/TylerSmithNet/EvernoteReminderDa...
#EC2013
Bound Service: Evernote and Dashclock
•Implements
Dashclock jar (AIDL)
•Queries Evernote
Content Provider
github.c...
#EC2013
Bound Service: Evernote and Dashclock
•Implements
Dashclock jar (AIDL)
•Queries Evernote
Content Provider
•Note li...
#EC2013
Bound Service: Evernote and Dashclock
•Implements
Dashclock jar (AIDL)
•Queries Evernote
Content Provider
•Note li...
#EC2013
Wrap up
Sunday, September 29, 13
#EC2013
Wrap up
•Let the system do the work
Sunday, September 29, 13
#EC2013
Wrap up
•Let the system do the work
•Base API design choice on user stories
Sunday, September 29, 13
#EC2013
Wrap up
•Let the system do the work
•Base API design choice on user stories
•Give the user the best experience
Sun...
Ty Smith
Evernote
@tylersmithnet
Thanks, Questions?
dev.evernote.com
Sunday, September 29, 13
Upcoming SlideShare
Loading in …5
×

App to App: Design and Surface Local APIs

2,616 views

Published on

Published in: Technology, News & Politics
  • Be the first to comment

  • Be the first to like this

App to App: Design and Surface Local APIs

  1. 1. Ty Smith - @tylersmithnet Sr. Android Engineer, Evernote App to App: Design and Surface Local APIs Sunday, September 29, 13
  2. 2. #EC2013 The S Note Story Sunday, September 29, 13
  3. 3. #EC2013 The S Note Story Sunday, September 29, 13
  4. 4. #EC2013 The S Note Story Sunday, September 29, 13
  5. 5. #EC2013 The S Note Story Sunday, September 29, 13
  6. 6. #EC2013 The S Note Story Sunday, September 29, 13
  7. 7. #EC2013 The S Note Story Sunday, September 29, 13
  8. 8. #EC2013 Web API vs Local API Sunday, September 29, 13
  9. 9. #EC2013 Web API vs Local API Web API •Powerful •Flexible •Comfortable •Complex •Inconsistent data •Service limitations Local API •Immediate results •Managed complexity •Consistent data •Not as available •Too Simple Sunday, September 29, 13
  10. 10. #EC2013 Web API vs Local API Web API •Powerful •Flexible •Comfortable •Complex •Inconsistent data •Service limitations Local API •Immediate results •Managed complexity •Consistent data •Not as available •Too Simple Sunday, September 29, 13
  11. 11. #EC2013 Web API vs Local API Web API •Powerful •Flexible •Comfortable •Complex •Inconsistent data •Service limitations Local API •Immediate results •Managed complexity •Consistent data •Not as available •Too Simple Sunday, September 29, 13
  12. 12. #EC2013 Web API vs Local API Web API •Powerful •Flexible •Comfortable •Complex •Inconsistent data •Service limitations Local API •Immediate results •Managed complexity •Consistent data •Not as available •Too Simple Sunday, September 29, 13
  13. 13. #EC2013 Web API vs Local API Web API •Powerful •Flexible •Comfortable •Complex •Inconsistent data •Service limitations Local API •Immediate results •Managed complexity •Consistent data •Not as available •Too Simple Sunday, September 29, 13
  14. 14. #EC2013 Web API vs Local API Web API •Powerful •Flexible •Comfortable •Complex •Inconsistent data •Service limitations Local API •Immediate results •Managed complexity •Consistent data •Not as available •Too Simple Sunday, September 29, 13
  15. 15. #EC2013 What next? Sunday, September 29, 13
  16. 16. #EC2013 What next? Sunday, September 29, 13
  17. 17. #EC2013 Android Components Sunday, September 29, 13
  18. 18. #EC2013 Android Components 1. Intents Sunday, September 29, 13
  19. 19. #EC2013 Android Components 1. Intents 2. Content Provider Sunday, September 29, 13
  20. 20. #EC2013 Android Components 1. Intents 2. Content Provider 3. Account Manager Sunday, September 29, 13
  21. 21. #EC2013 Android Components 1. Intents 2. Content Provider 3. Account Manager 4. Sync Adapter Sunday, September 29, 13
  22. 22. #EC2013 Android Components 1. Intents 2. Content Provider 3. Account Manager 4. Sync Adapter 5. Bound Service Sunday, September 29, 13
  23. 23. #EC2013 Intents Sunday, September 29, 13
  24. 24. #EC2013 Intents •Simple message between two components Sunday, September 29, 13
  25. 25. #EC2013 Intents •Simple message between two components •Bundle - key/value data Sunday, September 29, 13
  26. 26. #EC2013 Intents •Simple message between two components •Bundle - key/value data •Limited payload size (500k) Sunday, September 29, 13
  27. 27. #EC2013 Intents •Simple message between two components •Bundle - key/value data •Limited payload size (500k) •Inefficient for batch operations Sunday, September 29, 13
  28. 28. #EC2013 Intents •Simple message between two components •Bundle - key/value data •Limited payload size (500k) •Inefficient for batch operations •URI Support Sunday, September 29, 13
  29. 29. #EC2013 Intents: Android Standards Sunday, September 29, 13
  30. 30. #EC2013 Intents: Android Standards •Intent.ACTION_SEND Sunday, September 29, 13
  31. 31. #EC2013 Intents: Android Standards •Intent.ACTION_SEND •Intent.EXTRA_STREAM Sunday, September 29, 13
  32. 32. #EC2013 Intents: Android Standards •Intent.ACTION_SEND •Intent.EXTRA_STREAM •Intent.ACTION_VIEW Sunday, September 29, 13
  33. 33. #EC2013 Intents: Android Standards •Intent.ACTION_SEND •Intent.EXTRA_STREAM •Intent.ACTION_VIEW •Intent.ACTION_EDIT Sunday, September 29, 13
  34. 34. #EC2013 Intents: View And EDIT Sunday, September 29, 13
  35. 35. #EC2013 Intents: View And EDIT •Set Action Sunday, September 29, 13
  36. 36. #EC2013 Intents: View And EDIT •Set Action •Data URI Sunday, September 29, 13
  37. 37. #EC2013 Intents: View And EDIT •Set Action •Data URI •MIME Type Sunday, September 29, 13
  38. 38. #EC2013 Intents: View And EDIT •Set Action •Data URI •MIME Type •startActivity... ForResult() Sunday, September 29, 13
  39. 39. #EC2013 Intents: View And EDIT •Set Action •Data URI •MIME Type •startActivity... ForResult() •onActivityResult() Sunday, September 29, 13
  40. 40. #EC2013 Intents: Evernote CRUD gist.github.com/TylerSmithNet/6735496 Sunday, September 29, 13
  41. 41. #EC2013 Intents: Evernote CRUD public static final String NOTE_PICKER = "com.evernote.action.NOTE_PICKER";   public static final String VIEW_NOTE = "com.evernote.action.VIEW_NOTE"; public static final String NEW_NOTE = "com.evernote.action.CREATE_NEW_NOTE";    public static final String EDIT_NOTE = "com.evernote.action.EDIT_NOTE";   public static final String UPDATE_NOTE = "com.evernote.action.UPDATE_NOTE";   public static final String DELETE_NOTE = "com.evernote.action.DELETE_NOTE"; gist.github.com/TylerSmithNet/6735496 Sunday, September 29, 13
  42. 42. #EC2013 Intents: New Note Overview gist.github.com/TylerSmithNet/6735496 Sunday, September 29, 13
  43. 43. #EC2013 Intents: New Note Overview gist.github.com/TylerSmithNet/6735496 Sunday, September 29, 13
  44. 44. #EC2013 Intents: New Note Overview gist.github.com/TylerSmithNet/6735496 Sunday, September 29, 13
  45. 45. #EC2013 Intents: New Note Overview gist.github.com/TylerSmithNet/6735496 Sunday, September 29, 13
  46. 46. #EC2013 Intents: New Note Overview gist.github.com/TylerSmithNet/6735496 Sunday, September 29, 13
  47. 47. #EC2013 Intents: New Note Overview gist.github.com/TylerSmithNet/6735496 Sunday, September 29, 13
  48. 48. #EC2013 Intents: New Note Overview New Note Intent gist.github.com/TylerSmithNet/6735496 Sunday, September 29, 13
  49. 49. #EC2013 Intents: New Note Overview New Note Intent gist.github.com/TylerSmithNet/6735496 Sunday, September 29, 13
  50. 50. #EC2013 Intents: New Note Overview New Note Intent gist.github.com/TylerSmithNet/6735496 Sunday, September 29, 13
  51. 51. #EC2013 Intents: New Note Overview New Note Intent onActivityResult() gist.github.com/TylerSmithNet/6735496 Sunday, September 29, 13
  52. 52. #EC2013 Intents: Evernote New Note gist.github.com/TylerSmithNet/6735496 Sunday, September 29, 13
  53. 53. #EC2013 Intents: Evernote New Note public static final String NEW_NOTE = "com.evernote.action.CREATE_NEW_NOTE"; public void newNoteWithContent(Uri image) {   String title = "Sample Title";   String text = "Sample description.";     Intent intent = new Intent();   intent.setAction(ACTION_NEW_NOTE);    // Set the note's title and plaintext content   intent.putExtra(Intent.EXTRA_TITLE, title);   intent.putExtra(Intent.EXTRA_TEXT, text); // Set the Data URI for the image intent.setData(image);   startActivityForResult(intent); } gist.github.com/TylerSmithNet/6735496 Sunday, September 29, 13
  54. 54. #EC2013 Content Provider Sunday, September 29, 13
  55. 55. #EC2013 Content Provider •A well defined database access layer Sunday, September 29, 13
  56. 56. #EC2013 Content Provider •A well defined database access layer •SQLite Sunday, September 29, 13
  57. 57. #EC2013 Content Provider •A well defined database access layer •SQLite •Interact with large volumes of data Sunday, September 29, 13
  58. 58. #EC2013 Content Provider •A well defined database access layer •SQLite •Interact with large volumes of data •Authority Sunday, September 29, 13
  59. 59. #EC2013 Content Provider •A well defined database access layer •SQLite •Interact with large volumes of data •Authority •Permissions Sunday, September 29, 13
  60. 60. #EC2013 Content Provider: URI content:// com.example / notes / 1 Sunday, September 29, 13
  61. 61. #EC2013 Content Provider: URI content:// com.example / notes / 1 Scheme Sunday, September 29, 13
  62. 62. #EC2013 Content Provider: URI content:// com.example / notes / 1 Scheme Authority Sunday, September 29, 13
  63. 63. #EC2013 Content Provider: URI content:// com.example / notes / 1 Scheme Authority Data Type Sunday, September 29, 13
  64. 64. #EC2013 Content Provider: URI content:// com.example / notes / 1 Scheme Authority Data Type Id Sunday, September 29, 13
  65. 65. #EC2013 Content Provider: Implementing Sunday, September 29, 13
  66. 66. #EC2013 Content Provider: Implementing •Override Methods Sunday, September 29, 13
  67. 67. #EC2013 Content Provider: Implementing •Override Methods •URI Matcher Sunday, September 29, 13
  68. 68. #EC2013 Content Provider: Implementing •Override Methods •URI Matcher •Cursors Sunday, September 29, 13
  69. 69. #EC2013 Content Provider: Implementing •Override Methods •URI Matcher •Cursors •File Handlers Sunday, September 29, 13
  70. 70. #EC2013 Content Provider: Query Sunday, September 29, 13
  71. 71. #EC2013 Content Provider: Query Uri authUri = Uri.parse("content://com.evernote.evernoteprovider");  Uri notesUri = Uri.withAppendedPath(authUri, "notes");   String[] projection = new String[]{"guid", "title"};   Cursor cursor = getContentResolver().query( notesUri, projection, null, null, null); Sunday, September 29, 13
  72. 72. #EC2013 Account Manager Sunday, September 29, 13
  73. 73. #EC2013 Account Manager •Accessible Account Sunday, September 29, 13
  74. 74. #EC2013 Account Manager •Accessible Account •Third Party Auth Sunday, September 29, 13
  75. 75. #EC2013 Account Manager •Accessible Account •Third Party Auth •Consistent Settings Sunday, September 29, 13
  76. 76. #EC2013 Account Manager: OAuth Sunday, September 29, 13
  77. 77. #EC2013 Account Manager: OAuth Sunday, September 29, 13
  78. 78. #EC2013 Account Manager: OAuth Sunday, September 29, 13
  79. 79. #EC2013 Account Manager: OAuth Sunday, September 29, 13
  80. 80. #EC2013 Account Manager: OAuth Sunday, September 29, 13
  81. 81. #EC2013 Account Manager: OAuth Sunday, September 29, 13
  82. 82. #EC2013 Account Manager: OAuth getAuthToken(...) Sunday, September 29, 13
  83. 83. #EC2013 Account Manager: OAuth getAuthToken(...) Sunday, September 29, 13
  84. 84. #EC2013 Account Manager: OAuth getAuthToken(...) Sunday, September 29, 13
  85. 85. #EC2013 Account Manager: OAuth getAuthToken(...) Future<Bundle> Sunday, September 29, 13
  86. 86. #EC2013 Sync Adapter Sunday, September 29, 13
  87. 87. #EC2013 Sync Adapter •Synchronizes App and Web Service Sunday, September 29, 13
  88. 88. #EC2013 Sync Adapter •Synchronizes App and Web Service •Network/battery optimized syncing Sunday, September 29, 13
  89. 89. #EC2013 Sync Adapter •Synchronizes App and Web Service •Network/battery optimized syncing •Provided to third party apps Sunday, September 29, 13
  90. 90. #EC2013 Sync Adapter •Synchronizes App and Web Service •Network/battery optimized syncing •Provided to third party apps •Schedule and GCM Sunday, September 29, 13
  91. 91. #EC2013 Sync Adapter: Caveats Sunday, September 29, 13
  92. 92. #EC2013 Sync Adapter: Caveats •Requires Content Provider and Account Manager Sunday, September 29, 13
  93. 93. #EC2013 Sync Adapter: Caveats •Sync every hour ContentResolver.addPeriodicSync(account, EvernoteContract.AUTHORITY, new Bundle(), 3600); •Requires Content Provider and Account Manager Sunday, September 29, 13
  94. 94. #EC2013 Sync Adapter: Caveats •Sync every hour ContentResolver.addPeriodicSync(account, EvernoteContract.AUTHORITY, new Bundle(), 3600); •Requires Content Provider and Account Manager Sunday, September 29, 13
  95. 95. #EC2013 Sync Adapter: Caveats •Sync every hour ContentResolver.addPeriodicSync(account, EvernoteContract.AUTHORITY, new Bundle(), 3600); •Sync with Jitter int jitter = new Random().nextInt(300); ContentResolver.addPeriodicSync(account, EvernoteContract.AUTHORITY, new Bundle(), 3600+jitter); •Requires Content Provider and Account Manager Sunday, September 29, 13
  96. 96. #EC2013 Bound Service Sunday, September 29, 13
  97. 97. #EC2013 Bound Service •Android Interface Definition Language (AIDL) Sunday, September 29, 13
  98. 98. #EC2013 Bound Service •Android Interface Definition Language (AIDL) •Directly call defined methods Sunday, September 29, 13
  99. 99. #EC2013 Bound Service •Android Interface Definition Language (AIDL) •Directly call defined methods •Communicate between process or app Sunday, September 29, 13
  100. 100. #EC2013 Bound Service •Android Interface Definition Language (AIDL) •Directly call defined methods •Communicate between process or app •Requires consumer to contain interface Sunday, September 29, 13
  101. 101. #EC2013 Bound Service: Evernote and Dashclock github.com/TylerSmithNet/EvernoteReminderDashclock Sunday, September 29, 13
  102. 102. #EC2013 Bound Service: Evernote and Dashclock •Implements Dashclock jar (AIDL) github.com/TylerSmithNet/EvernoteReminderDashclock Sunday, September 29, 13
  103. 103. #EC2013 Bound Service: Evernote and Dashclock •Implements Dashclock jar (AIDL) •Queries Evernote Content Provider github.com/TylerSmithNet/EvernoteReminderDashclock Sunday, September 29, 13
  104. 104. #EC2013 Bound Service: Evernote and Dashclock •Implements Dashclock jar (AIDL) •Queries Evernote Content Provider •Note list intent for clicks github.com/TylerSmithNet/EvernoteReminderDashclock Sunday, September 29, 13
  105. 105. #EC2013 Bound Service: Evernote and Dashclock •Implements Dashclock jar (AIDL) •Queries Evernote Content Provider •Note list intent for clicks •Open Source github.com/TylerSmithNet/EvernoteReminderDashclock Sunday, September 29, 13
  106. 106. #EC2013 Wrap up Sunday, September 29, 13
  107. 107. #EC2013 Wrap up •Let the system do the work Sunday, September 29, 13
  108. 108. #EC2013 Wrap up •Let the system do the work •Base API design choice on user stories Sunday, September 29, 13
  109. 109. #EC2013 Wrap up •Let the system do the work •Base API design choice on user stories •Give the user the best experience Sunday, September 29, 13
  110. 110. Ty Smith Evernote @tylersmithnet Thanks, Questions? dev.evernote.com Sunday, September 29, 13

×