SlideShare uma empresa Scribd logo
1 de 39
Baixar para ler offline
R.A.P.
Rely on Android Platform
DISCLAIMER
@ibai_iturricha
● NFC
● Android
● Django
CTO en Aditium
Why should I
RAP?
My app …
manages user accounts
loads/pulls data from/to server
works without connection
and ...
I want to be a winner!
Decouple authentication from business logic
Isolate synchronization strategy
Offline first
Modular UI Components
http://rapgenius.com/discussions/12681-New-version-of-the-last-supper
Time to RAP homies!
Android Platform crew
Account Manager manages user credentials
Sync Manager keeps data up to date
Content Provider stores structured data
Loaders make data available
Account Manager
“Account Manager provides access to a
centralized registry of the user's online
accounts”
Android developers
Android Platform
Account
Manager
Your App
Service
AbstractAccountAuthenticator
AccountAuthenticatorActivity
Android Platform
Account
Manager
Your App
Service
AbstractAccountAuthenticator
AccountAuthenticatorActivity
Your app
Add account Get auhtToken
Delete account
AbstractAccountAuthenticator
Sync
Manager/Adapter
“The ability of the system to
help you synchronize
remote and local content”
Virgil Dobjanschi (Google IO 201)
App 1 App 2 App 3 App 4
Perform a sync → Network request, parceling, DB operations, etc...
Sepherd wanted!
Sync Manager Framework
App 1 App 2 App 3 App 4
App 1 App 3 App 4 App 2
Android Platform
Sync
Manager
Your App
Service
AbstractThreadedSyncAdapter
Synchronization Strategy Selection
● On demand
○ E.g. User press button ‘refresh’
● Regular interval
○ E.g. Each hour
● When network connection available
○ E.g. Sync automatically when connected
● When device data changes
○ E.g. Every time my database changes
● When server data changes
○ E.g. Every push message received
Android Platform
Sync
Manager
Your App
Service
AbstractThreadedSyncAdapter
Your app
PerformSync
On demand example
Android Platform
Sync
Manager
Your App
Service
AbstractThreadedSyncAdapter
Your app
PerformSync
Server push sync
Your server
AbstractThreadedSyncAdapter
Content provider
“Content providers manage access
to a structured set of data”
Android developers
Android Platform
Content
Resolver
Your App
ContentProvider
SQLiteOpenHelper
SQLite
Android Platform
Content
Resolver
Your App
ContentProvider
SQLiteOpenHelper
SQLite
Your app
Query Insert
Delete
Update
Bulk
ContentProvider
SQLiteOpenHelper
Loaders
“Loaders make it easy to asynchronously
load data in an activity or fragment”
Android developers
Android Platform
Loader
Manager
Your App
ContentProvider
SQLiteOpenHelper
SQLite
Fragment | Activity
implements LoaderCallbacks<Cursor>
Query
UI thread Background thread
1. getLoaderManager().initLoader(...)
2. onCreateLoader(...)
query specific code
4. onLoadFinished(...)
swap adapter
3. Execute query on DB
LoaderManager.LoaderCallbacks<Cursor>
Conclusion
Your app
Account Provider Sync Model
Android Platform
Activities & Fragments & Loaders
Demo time
Server side
PLAIN API
POST api/v1/account/new/ Creates new account and returns auth_token
POST api/v1/account/login/ Validates username & password tuple and returns auth_token
AUTHORIZED API
GET api/v1/spots/ Returns spots on the database
→ auth_token
→ position
→ limit

Mais conteúdo relacionado

Mais procurados

SharePoint 2013 “App Model” Developing and Deploying Provider Hosted Apps
SharePoint 2013 “App Model” Developing and Deploying Provider Hosted AppsSharePoint 2013 “App Model” Developing and Deploying Provider Hosted Apps
SharePoint 2013 “App Model” Developing and Deploying Provider Hosted Apps
Sanjay Patel
 

Mais procurados (20)

Introduction à Application Insights
Introduction à Application InsightsIntroduction à Application Insights
Introduction à Application Insights
 
Eventbus Library and How Does it Work?
Eventbus Library and How Does it Work?Eventbus Library and How Does it Work?
Eventbus Library and How Does it Work?
 
Android sync adapter
Android sync adapterAndroid sync adapter
Android sync adapter
 
First Look at Azure Logic Apps (BAUG)
First Look at Azure Logic Apps (BAUG)First Look at Azure Logic Apps (BAUG)
First Look at Azure Logic Apps (BAUG)
 
Logic apps and PowerApps - Integrate across your APIs
Logic apps and PowerApps - Integrate across your APIsLogic apps and PowerApps - Integrate across your APIs
Logic apps and PowerApps - Integrate across your APIs
 
How to: Create a custom connector for Microsoft Flow
How to: Create a custom connector for Microsoft FlowHow to: Create a custom connector for Microsoft Flow
How to: Create a custom connector for Microsoft Flow
 
Google apps engine
Google apps engineGoogle apps engine
Google apps engine
 
Tools Of The Geospatial Web
Tools Of The Geospatial WebTools Of The Geospatial Web
Tools Of The Geospatial Web
 
Inside Logic Apps
Inside Logic AppsInside Logic Apps
Inside Logic Apps
 
Google App Engine tutorial
Google App Engine tutorialGoogle App Engine tutorial
Google App Engine tutorial
 
Building Micro Services with Spring Cloud and Docker
Building Micro Services with Spring Cloud and DockerBuilding Micro Services with Spring Cloud and Docker
Building Micro Services with Spring Cloud and Docker
 
SharePoint 2013 “App Model” Developing and Deploying Provider Hosted Apps
SharePoint 2013 “App Model” Developing and Deploying Provider Hosted AppsSharePoint 2013 “App Model” Developing and Deploying Provider Hosted Apps
SharePoint 2013 “App Model” Developing and Deploying Provider Hosted Apps
 
How to create custom connector for Microsoft Flow - SPSNL18
How to create custom connector for Microsoft Flow - SPSNL18How to create custom connector for Microsoft Flow - SPSNL18
How to create custom connector for Microsoft Flow - SPSNL18
 
Unleash the power of Serverless Computing
Unleash the power of Serverless ComputingUnleash the power of Serverless Computing
Unleash the power of Serverless Computing
 
A quick guide on Mobile App Backend development
A quick guide on Mobile App Backend developmentA quick guide on Mobile App Backend development
A quick guide on Mobile App Backend development
 
How to create custom Connector for Microsoft Flow
How to create custom Connector for Microsoft FlowHow to create custom Connector for Microsoft Flow
How to create custom Connector for Microsoft Flow
 
Power Apps community call-June 2020
Power Apps community call-June 2020Power Apps community call-June 2020
Power Apps community call-June 2020
 
Developing Java Web Applications In Google App Engine
Developing Java Web Applications In Google App EngineDeveloping Java Web Applications In Google App Engine
Developing Java Web Applications In Google App Engine
 
How to create custom connector for Microsoft Flow
How to create custom connector for Microsoft FlowHow to create custom connector for Microsoft Flow
How to create custom connector for Microsoft Flow
 
Event Source On Labs
Event Source On LabsEvent Source On Labs
Event Source On Labs
 

Semelhante a R.A.P. (Rely on Android Platform)

AnDevCon - A Primer to Sync Adapters
AnDevCon - A Primer to Sync AdaptersAnDevCon - A Primer to Sync Adapters
AnDevCon - A Primer to Sync Adapters
Kiana Tennyson
 

Semelhante a R.A.P. (Rely on Android Platform) (20)

Android Development : (Android Studio, PHP, XML, MySQL)
Android Development : (Android Studio, PHP, XML, MySQL)Android Development : (Android Studio, PHP, XML, MySQL)
Android Development : (Android Studio, PHP, XML, MySQL)
 
MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...
MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...
MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...
 
AnDevCon - A Primer to Sync Adapters
AnDevCon - A Primer to Sync AdaptersAnDevCon - A Primer to Sync Adapters
AnDevCon - A Primer to Sync Adapters
 
Android application development for TresmaxAsia
Android application development for TresmaxAsiaAndroid application development for TresmaxAsia
Android application development for TresmaxAsia
 
PWA basics for developers
PWA basics for developersPWA basics for developers
PWA basics for developers
 
Kochi mulesoft meetup 02
Kochi mulesoft meetup 02Kochi mulesoft meetup 02
Kochi mulesoft meetup 02
 
What's new in SharePoint Server 2013 (End user - Admin – Developer)
What's new in SharePoint Server 2013 (End user - Admin – Developer)What's new in SharePoint Server 2013 (End user - Admin – Developer)
What's new in SharePoint Server 2013 (End user - Admin – Developer)
 
Azure Monitoring Overview
Azure Monitoring OverviewAzure Monitoring Overview
Azure Monitoring Overview
 
Pascua Yaqui Tribe App in a day and dashboard in day
Pascua Yaqui Tribe App in a day and dashboard in dayPascua Yaqui Tribe App in a day and dashboard in day
Pascua Yaqui Tribe App in a day and dashboard in day
 
Progressive Web Apps
Progressive Web AppsProgressive Web Apps
Progressive Web Apps
 
aOS Moscow - E4 - PowerApps for enterprise developers - Fabio Franzini
aOS Moscow - E4 - PowerApps for enterprise developers - Fabio FranziniaOS Moscow - E4 - PowerApps for enterprise developers - Fabio Franzini
aOS Moscow - E4 - PowerApps for enterprise developers - Fabio Franzini
 
API & Backend Integration
API & Backend IntegrationAPI & Backend Integration
API & Backend Integration
 
JUDCon 2014: Gearing up for mobile development with AeroGear
JUDCon 2014: Gearing up for mobile development with AeroGearJUDCon 2014: Gearing up for mobile development with AeroGear
JUDCon 2014: Gearing up for mobile development with AeroGear
 
CCI 2019 - PowerApps for Enterprise Developers
CCI 2019 - PowerApps for Enterprise DevelopersCCI 2019 - PowerApps for Enterprise Developers
CCI 2019 - PowerApps for Enterprise Developers
 
Part 2 android application development 101
Part 2 android application development 101Part 2 android application development 101
Part 2 android application development 101
 
Applications Manager Technical Overview
Applications Manager Technical OverviewApplications Manager Technical Overview
Applications Manager Technical Overview
 
Enter the World of PowerApps - Canvas vs. Model-Driven Apps
Enter the World of PowerApps - Canvas vs. Model-Driven AppsEnter the World of PowerApps - Canvas vs. Model-Driven Apps
Enter the World of PowerApps - Canvas vs. Model-Driven Apps
 
Paul Lammertsma: Account manager & sync
Paul Lammertsma: Account manager & syncPaul Lammertsma: Account manager & sync
Paul Lammertsma: Account manager & sync
 
Build Your Mobile App Faster with AWS Mobile Services (Part 1 - AWS)
Build Your Mobile App Faster with AWS Mobile Services (Part 1 - AWS)Build Your Mobile App Faster with AWS Mobile Services (Part 1 - AWS)
Build Your Mobile App Faster with AWS Mobile Services (Part 1 - AWS)
 
The future of web development write once, run everywhere with angular js an...
The future of web development   write once, run everywhere with angular js an...The future of web development   write once, run everywhere with angular js an...
The future of web development write once, run everywhere with angular js an...
 

Último

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 

R.A.P. (Rely on Android Platform)