SlideShare une entreprise Scribd logo
1  sur  30
Télécharger pour lire hors ligne
App Integration:
 Strategies and
     Tactics
     Copyright © 2012CommonsWare, LLC
Objective: Add Value
●   Add Value for Users
    –   More functionality without as much
        development effort
●   Add Value for Third Parties
    –   Their apps are more valuable when you help
        drive their adoption
●   Add Value for You
    –   Reciprocity from third parties
                       Copyright © 2012CommonsWare, LLC
Integration Models
●   Peers
    –   Apps with value independent of yours
    –   Hard or soft dependencies
●   Plugins
    –   Apps with no value independent of yours




                      Copyright © 2012CommonsWare, LLC
Difficulty Level:
 One Red Bull
      Copyright © 2012CommonsWare, LLC
Activities, Implicit Intents
●   Make a Generic Request
    –   ACTION_VIEW, ACTION_SEND, etc.
●   User Dictates Terms
    –   What applications are installed that could handle
        it
    –   What application to use for this particular
        request
    –   What to do with that application
                       Copyright © 2012CommonsWare, LLC
Activities, Implicit Intents
●   Making the Selection
    –   No options? Crash!
    –   One option? Automatic start, no intervention
    –   Multiple options?
         ●   Default chooser
         ● Override chooser (Intent.createChooser())
         ● ShareActionProvider


         ●   Apple patent workarounds
         ●   DIY          Copyright © 2012CommonsWare, LLC
Activities, Implicit Intents
●   DIY
    –   PackageManager
        queryIntentActivities() returns list of
        possibilities, given an Intent
    –   You render resulting List somehow
●   Avoiding the No-Options Crash
    –   Same technique: if list empty,
        startActivity() would fail
                      Copyright © 2012CommonsWare, LLC
Activities, Explicit Intents
●   Hard Dependency, Declared in Code
    –   Craft Intent that will only be handled by peer
        application
    –   Use PackageManager
        queryIntentActivities() to confirm it
        exists (or handle the exception)
    –   Use with startActivity() /
        startActivityForResult()

                      Copyright © 2012CommonsWare, LLC
UI Integration via Web
●   No Activity? How About a Web Site?
    –   Easy: launch browser on URL with ACTION_VIEW
    –   More Interesting: Host a WebView
         ●   Pre-fill in forms using
             loadUrl(“javascript:...”)
         ●   Warning #1: May be tough to control
         ●   Warning #2: Dependencies on non-public “APIs”


                          Copyright © 2012CommonsWare, LLC
Difficulty Level:
 Two Red Bulls
      Copyright © 2012CommonsWare, LLC
UI Integration via Web
●   Reverse Integration: Web to App
    –   Key: BROWSABLE category
    –   Option #1: <data> For Your URL
         ●   Option to launch app if app installed, else URL
             directs to Web page to go download the app
    –   Option #2: Something Specific
         ●   Intent.toUri() to generate a URL
         ●   Custom scheme

                           Copyright © 2012CommonsWare, LLC
Integrating Resources
●   createPackageContext()
    –   Returns a Context that will resolve resources
        from some other package
    –   Example Use: theme packs
         ●   APK (possibly paid app) with res0urces representing
             theme
         ●   Detect existence using PackageManager
         ●   Use createPackageContext() to retrieve
             resources and apply to your UI
                          Copyright © 2012CommonsWare, LLC
Integration by ContentProvider
●   All You Need is a Uri
    –   And some idea of what the schema is, so you
        know what to do with it
         ●   Example: plugins implementing a standard schema
             that you require
    –   Getting the Uri
         ●   Well-known resource name
         ●   Bootstrap API (e.g., broadcast, remote service)

                           Copyright © 2012CommonsWare, LLC
Integration by ContentProvider
●   The Permission Proxy
    –   Problem: Your app needs too many permissions
         ●   Example: Calendar integration
    –   Solution
         ●   Wrap OS/third-party ContentProvider in one of
             yours, with same schema
         ●   Put that ContentProvider in plugin, to isolate
             permission
         ●   Check signature to ensure only used by you
                          Copyright © 2012CommonsWare, LLC
Integration by Service
●   Command Pattern
    –   Third Party Supplies Intent Structure
         ●   Action string
         ●   Available extras
    –   Call startService() as Needed
         ●   Directly
         ●   Via PendingIntent (e.g., AlarmManager)


                             Copyright © 2012CommonsWare, LLC
Integration by Service
●   Binding Pattern
    –   Agreed-Upon AIDL
         ●   Peer: first mover
         ●   Plugin: host defines
    –   Third Party Implements AIDL Binder
    –   You Bind and Use



                           Copyright © 2012CommonsWare, LLC
Integration by Broadcast
●   Agreed-Upon Action, Ordered vs. Regular
    –   Peer: first mover
    –   Plugin: host defines
●   One Side Broadcast, Other Side Receives
    –   Manifest-registered receiver
    –   registerReceiver()


                       Copyright © 2012CommonsWare, LLC
Difficulty Level:
Case of Red Bulls
      Copyright © 2012CommonsWare, LLC
UI Integration via RemoteViews
●   Two Apps' UIs Simultaneously
●   RemoteViews Host
    –   Get RemoteViews from third-party
         ●   Broadcast? Remote service?
         ●   Initially, plus changes over time
    –   apply() RemoteViews into your desired
        container

                           Copyright © 2012CommonsWare, LLC
UI Integration via RemoteViews
●   Limitations
    –   Widgets, methods available in RemoteViews
    –   No direct interaction between apps
         ●   Solution: API accessed via PendingIntents




                         Copyright © 2012CommonsWare, LLC
Difficulty Level:
Red Bull Bottling
      Plant
      Copyright © 2012CommonsWare, LLC
UI Integration via Parcelable
●   RemoteViews Got You Down? Roll Your Own!
    –   RemoteViews is a data structure representing
        commands to build a UI
    –   Alternative: DIY RemoteViewsEx
    –   Limitations
         ●   Still loosely coupled for events (PendingIntent,
             Messenger, etc.)
         ●   Effort proportional to the complexity of the UI
             you wish to share
                           Copyright © 2012CommonsWare, LLC
Integrating Code
●   Option #1: createPackageContext()
    –   getClassLoader() will return ClassLoader
        for accessing classes in other APK
         ●   Use CONTEXT_INCLUDE_CODE in
             createPackageContext() call
    –   Use reflection from there (e.g., loadClass())
        to access foreign code


                        Copyright © 2012CommonsWare, LLC
Integrating Code
●   Option #2: DexClassLoader
    –   Given JAR/APK containing dex'd bytecode,
        allows you to load classes just like a regular
        ClassLoader
         ●   Up to you to get the JAR or APK file




                           Copyright © 2012CommonsWare, LLC
Integrating Code
●   WARNING
    –   You might not know where that code came from
         ●   Code injection attacks
    –   Executed code runs with your permissions
         ●   May do things you rather wish they would not
    –   Net: very risky technique



                          Copyright © 2012CommonsWare, LLC
And Now, The
Rest of the Story
      Copyright © 2012CommonsWare, LLC
Discovery Mechanisms
●   Hard-Coded
●   Discovery via Broadcast
    –   Host sends a broadcast periodically (first run,
        package installed, package removed)
    –   Peers/plugins reply with broadcast about
        capabilities
    –   Related: ACTION_PACKAGE_ADDED

                       Copyright © 2012CommonsWare, LLC
Discovery Mechanisms
●   Discovery via Naming Convention
    –   Plugins go in com.myfirm.myapp.plugin.*
    –   Host uses PackageManager to identify
    –   Further Handshaking
         ●   Well-known resource
         ●   Well-known “narrowcast” via setPackage()



                         Copyright © 2012CommonsWare, LLC
More Stuff to Consider
●   Custom Permissions
    –   Users should get a vote on data sharing
●   Integration Library
    –   JAR to ease third-parties working with your host
●   Documentation
    –   Only way anyone will know what to do
         ●   ...and what you would rather they not do

                          Copyright © 2012CommonsWare, LLC
What the Ecosystem Needs
●   Standards
    –   Community-driven implicit Intent actions
●   Scaffolding
    –   Library projects, templates for creating these
        structures
●   End-User Discovery
    –   How do they know what can integrate?

                       Copyright © 2012CommonsWare, LLC

Contenu connexe

Tendances

Magnolia CMS 5.0 - Overview
Magnolia CMS 5.0 - OverviewMagnolia CMS 5.0 - Overview
Magnolia CMS 5.0 - OverviewPhilipp Bärfuss
 
Magnolia CMS 5.0 - Architecture
Magnolia CMS 5.0 - ArchitectureMagnolia CMS 5.0 - Architecture
Magnolia CMS 5.0 - ArchitecturePhilipp Bärfuss
 
soft-shake.ch - Windows Phone 7 „Mango“ – what’s new for Developers?
soft-shake.ch - Windows Phone 7 „Mango“ – what’s new for Developers?soft-shake.ch - Windows Phone 7 „Mango“ – what’s new for Developers?
soft-shake.ch - Windows Phone 7 „Mango“ – what’s new for Developers?soft-shake.ch
 
Nadeus Education Services session on Google Apps and Google App Engine
Nadeus Education Services session on Google Apps and Google App EngineNadeus Education Services session on Google Apps and Google App Engine
Nadeus Education Services session on Google Apps and Google App EngineNadeus Education Services
 
CiklumJavaSat15112011:Andrew Mormysh-GWT features overview
CiklumJavaSat15112011:Andrew Mormysh-GWT features overviewCiklumJavaSat15112011:Andrew Mormysh-GWT features overview
CiklumJavaSat15112011:Andrew Mormysh-GWT features overviewCiklum Ukraine
 
2013 04-02-server-side-backbone
2013 04-02-server-side-backbone2013 04-02-server-side-backbone
2013 04-02-server-side-backboneSC5.io
 
Embedding Web UIs in your Eclipse application
Embedding Web UIs in your Eclipse applicationEmbedding Web UIs in your Eclipse application
Embedding Web UIs in your Eclipse applicationBoris Bokowski
 
Lotusphere 2011 Jmp103 - Jumpstart Your "Jedi Plug-in Development Skills" wi...
Lotusphere 2011  Jmp103 - Jumpstart Your "Jedi Plug-in Development Skills" wi...Lotusphere 2011  Jmp103 - Jumpstart Your "Jedi Plug-in Development Skills" wi...
Lotusphere 2011 Jmp103 - Jumpstart Your "Jedi Plug-in Development Skills" wi...Ryan Baxter
 
Flutter vs ReactNative
Flutter vs ReactNativeFlutter vs ReactNative
Flutter vs ReactNativeSumit Sahoo
 

Tendances (9)

Magnolia CMS 5.0 - Overview
Magnolia CMS 5.0 - OverviewMagnolia CMS 5.0 - Overview
Magnolia CMS 5.0 - Overview
 
Magnolia CMS 5.0 - Architecture
Magnolia CMS 5.0 - ArchitectureMagnolia CMS 5.0 - Architecture
Magnolia CMS 5.0 - Architecture
 
soft-shake.ch - Windows Phone 7 „Mango“ – what’s new for Developers?
soft-shake.ch - Windows Phone 7 „Mango“ – what’s new for Developers?soft-shake.ch - Windows Phone 7 „Mango“ – what’s new for Developers?
soft-shake.ch - Windows Phone 7 „Mango“ – what’s new for Developers?
 
Nadeus Education Services session on Google Apps and Google App Engine
Nadeus Education Services session on Google Apps and Google App EngineNadeus Education Services session on Google Apps and Google App Engine
Nadeus Education Services session on Google Apps and Google App Engine
 
CiklumJavaSat15112011:Andrew Mormysh-GWT features overview
CiklumJavaSat15112011:Andrew Mormysh-GWT features overviewCiklumJavaSat15112011:Andrew Mormysh-GWT features overview
CiklumJavaSat15112011:Andrew Mormysh-GWT features overview
 
2013 04-02-server-side-backbone
2013 04-02-server-side-backbone2013 04-02-server-side-backbone
2013 04-02-server-side-backbone
 
Embedding Web UIs in your Eclipse application
Embedding Web UIs in your Eclipse applicationEmbedding Web UIs in your Eclipse application
Embedding Web UIs in your Eclipse application
 
Lotusphere 2011 Jmp103 - Jumpstart Your "Jedi Plug-in Development Skills" wi...
Lotusphere 2011  Jmp103 - Jumpstart Your "Jedi Plug-in Development Skills" wi...Lotusphere 2011  Jmp103 - Jumpstart Your "Jedi Plug-in Development Skills" wi...
Lotusphere 2011 Jmp103 - Jumpstart Your "Jedi Plug-in Development Skills" wi...
 
Flutter vs ReactNative
Flutter vs ReactNativeFlutter vs ReactNative
Flutter vs ReactNative
 

Similaire à App Integration (Revised and Updated)

Integrate Android Apps and Web Apps
Integrate Android Apps and Web AppsIntegrate Android Apps and Web Apps
Integrate Android Apps and Web AppsCommonsWare
 
Backwards Compatibility: Strategies and Tactics
Backwards Compatibility: Strategies and TacticsBackwards Compatibility: Strategies and Tactics
Backwards Compatibility: Strategies and TacticsCommonsWare
 
From Android to the Mobile Web
From Android to the Mobile WebFrom Android to the Mobile Web
From Android to the Mobile WebCommonsWare
 
Securing User Data with SQLCipher
Securing User Data with SQLCipherSecuring User Data with SQLCipher
Securing User Data with SQLCipherCommonsWare
 
What's New in Jelly Bean
What's New in Jelly BeanWhat's New in Jelly Bean
What's New in Jelly BeanCommonsWare
 
Android Development: The 20,000-Foot View
Android Development: The 20,000-Foot ViewAndroid Development: The 20,000-Foot View
Android Development: The 20,000-Foot ViewCommonsWare
 
Open source Cloud Automation Platform
Open source Cloud Automation PlatformOpen source Cloud Automation Platform
Open source Cloud Automation PlatformKishore Neelamegam
 
Using OSGi as a Cloud Platform - Jan Rellermeyer
Using OSGi as a Cloud Platform - Jan RellermeyerUsing OSGi as a Cloud Platform - Jan Rellermeyer
Using OSGi as a Cloud Platform - Jan Rellermeyermfrancis
 
IBM Datapower Gateways - Devops with UrbanCode Deploy
IBM Datapower Gateways - Devops with UrbanCode DeployIBM Datapower Gateways - Devops with UrbanCode Deploy
IBM Datapower Gateways - Devops with UrbanCode DeployJared Putman
 
BP207 - Meet the Java Application Server You Already Own – IBM Domino
BP207 - Meet the Java Application Server You Already Own – IBM DominoBP207 - Meet the Java Application Server You Already Own – IBM Domino
BP207 - Meet the Java Application Server You Already Own – IBM DominoSerdar Basegmez
 
Second-Screen Support in Android 4.2
Second-Screen Support in Android 4.2Second-Screen Support in Android 4.2
Second-Screen Support in Android 4.2CommonsWare
 
"Micro-frontends, web development", Oleksandr Khivrych
"Micro-frontends, web development", Oleksandr Khivrych"Micro-frontends, web development", Oleksandr Khivrych
"Micro-frontends, web development", Oleksandr KhivrychFwdays
 
Introduction to android - SpringPeople
Introduction to android - SpringPeopleIntroduction to android - SpringPeople
Introduction to android - SpringPeopleSpringPeople
 
Android workshop material
Android workshop materialAndroid workshop material
Android workshop materialReza Yogaswara
 
Delegating user tasks in applications
Delegating user tasks in applicationsDelegating user tasks in applications
Delegating user tasks in applicationsFriedger Müffke
 
JNUC 2017: Open Distribution Server
JNUC 2017: Open Distribution ServerJNUC 2017: Open Distribution Server
JNUC 2017: Open Distribution ServerBryson Tyrrell
 
JS Fest 2019/Autumn. Влад Федосов. Technology agnostic microservices at SPA f...
JS Fest 2019/Autumn. Влад Федосов. Technology agnostic microservices at SPA f...JS Fest 2019/Autumn. Влад Федосов. Technology agnostic microservices at SPA f...
JS Fest 2019/Autumn. Влад Федосов. Technology agnostic microservices at SPA f...JSFestUA
 

Similaire à App Integration (Revised and Updated) (20)

Integrate Android Apps and Web Apps
Integrate Android Apps and Web AppsIntegrate Android Apps and Web Apps
Integrate Android Apps and Web Apps
 
Backwards Compatibility: Strategies and Tactics
Backwards Compatibility: Strategies and TacticsBackwards Compatibility: Strategies and Tactics
Backwards Compatibility: Strategies and Tactics
 
From Android to the Mobile Web
From Android to the Mobile WebFrom Android to the Mobile Web
From Android to the Mobile Web
 
Securing User Data with SQLCipher
Securing User Data with SQLCipherSecuring User Data with SQLCipher
Securing User Data with SQLCipher
 
What's New in Jelly Bean
What's New in Jelly BeanWhat's New in Jelly Bean
What's New in Jelly Bean
 
X Means Y
X Means YX Means Y
X Means Y
 
Android Development: The 20,000-Foot View
Android Development: The 20,000-Foot ViewAndroid Development: The 20,000-Foot View
Android Development: The 20,000-Foot View
 
Open source Cloud Automation Platform
Open source Cloud Automation PlatformOpen source Cloud Automation Platform
Open source Cloud Automation Platform
 
Using OSGi as a Cloud Platform - Jan Rellermeyer
Using OSGi as a Cloud Platform - Jan RellermeyerUsing OSGi as a Cloud Platform - Jan Rellermeyer
Using OSGi as a Cloud Platform - Jan Rellermeyer
 
Appium solution artizone
Appium solution   artizoneAppium solution   artizone
Appium solution artizone
 
IBM Datapower Gateways - Devops with UrbanCode Deploy
IBM Datapower Gateways - Devops with UrbanCode DeployIBM Datapower Gateways - Devops with UrbanCode Deploy
IBM Datapower Gateways - Devops with UrbanCode Deploy
 
BP207 - Meet the Java Application Server You Already Own – IBM Domino
BP207 - Meet the Java Application Server You Already Own – IBM DominoBP207 - Meet the Java Application Server You Already Own – IBM Domino
BP207 - Meet the Java Application Server You Already Own – IBM Domino
 
Second-Screen Support in Android 4.2
Second-Screen Support in Android 4.2Second-Screen Support in Android 4.2
Second-Screen Support in Android 4.2
 
"Micro-frontends, web development", Oleksandr Khivrych
"Micro-frontends, web development", Oleksandr Khivrych"Micro-frontends, web development", Oleksandr Khivrych
"Micro-frontends, web development", Oleksandr Khivrych
 
Introduction to android - SpringPeople
Introduction to android - SpringPeopleIntroduction to android - SpringPeople
Introduction to android - SpringPeople
 
Appium
AppiumAppium
Appium
 
Android workshop material
Android workshop materialAndroid workshop material
Android workshop material
 
Delegating user tasks in applications
Delegating user tasks in applicationsDelegating user tasks in applications
Delegating user tasks in applications
 
JNUC 2017: Open Distribution Server
JNUC 2017: Open Distribution ServerJNUC 2017: Open Distribution Server
JNUC 2017: Open Distribution Server
 
JS Fest 2019/Autumn. Влад Федосов. Technology agnostic microservices at SPA f...
JS Fest 2019/Autumn. Влад Федосов. Technology agnostic microservices at SPA f...JS Fest 2019/Autumn. Влад Федосов. Technology agnostic microservices at SPA f...
JS Fest 2019/Autumn. Влад Федосов. Technology agnostic microservices at SPA f...
 

Plus de CommonsWare

Getting Android Developers for Your Wearables
Getting Android Developers for Your WearablesGetting Android Developers for Your Wearables
Getting Android Developers for Your WearablesCommonsWare
 
When Microwatts Are Precious: Battery Tips for Wearable Apps
When Microwatts Are Precious: Battery Tips for Wearable AppsWhen Microwatts Are Precious: Battery Tips for Wearable Apps
When Microwatts Are Precious: Battery Tips for Wearable AppsCommonsWare
 
The Action Bar: Front to Back
The Action Bar: Front to BackThe Action Bar: Front to Back
The Action Bar: Front to BackCommonsWare
 
Secondary Screen Support Using DisplayManager
Secondary Screen Support Using DisplayManagerSecondary Screen Support Using DisplayManager
Secondary Screen Support Using DisplayManagerCommonsWare
 
Mastering the Master Detail Pattern
Mastering the Master Detail PatternMastering the Master Detail Pattern
Mastering the Master Detail PatternCommonsWare
 
Not Quite As Painful Threading
Not Quite As Painful ThreadingNot Quite As Painful Threading
Not Quite As Painful ThreadingCommonsWare
 
Maps V2... And You!
Maps V2... And You!Maps V2... And You!
Maps V2... And You!CommonsWare
 
A Deep Dive Into ViewPager
A Deep Dive Into ViewPagerA Deep Dive Into ViewPager
A Deep Dive Into ViewPagerCommonsWare
 
The Wonderful World of Wearables
The Wonderful World of WearablesThe Wonderful World of Wearables
The Wonderful World of WearablesCommonsWare
 
Beaming Data to Devices with NFC
Beaming Data to Devices with NFCBeaming Data to Devices with NFC
Beaming Data to Devices with NFCCommonsWare
 
Making Money at Mobile: 60 Business Models
Making Money at Mobile: 60 Business ModelsMaking Money at Mobile: 60 Business Models
Making Money at Mobile: 60 Business ModelsCommonsWare
 
AppsWorld Keynote
AppsWorld KeynoteAppsWorld Keynote
AppsWorld KeynoteCommonsWare
 
Android Hardware That's A Little Bit... Odd
Android Hardware That's A Little Bit... OddAndroid Hardware That's A Little Bit... Odd
Android Hardware That's A Little Bit... OddCommonsWare
 
Google TV For Fun
Google TV For FunGoogle TV For Fun
Google TV For FunCommonsWare
 
If I Were Starting Now
If I Were Starting NowIf I Were Starting Now
If I Were Starting NowCommonsWare
 
Tuning Android Applications (Part Deux)
Tuning Android Applications (Part Deux)Tuning Android Applications (Part Deux)
Tuning Android Applications (Part Deux)CommonsWare
 
Tuning Android Applications (Part One)
Tuning Android Applications (Part One)Tuning Android Applications (Part One)
Tuning Android Applications (Part One)CommonsWare
 
Android Library Projects
Android Library ProjectsAndroid Library Projects
Android Library ProjectsCommonsWare
 

Plus de CommonsWare (18)

Getting Android Developers for Your Wearables
Getting Android Developers for Your WearablesGetting Android Developers for Your Wearables
Getting Android Developers for Your Wearables
 
When Microwatts Are Precious: Battery Tips for Wearable Apps
When Microwatts Are Precious: Battery Tips for Wearable AppsWhen Microwatts Are Precious: Battery Tips for Wearable Apps
When Microwatts Are Precious: Battery Tips for Wearable Apps
 
The Action Bar: Front to Back
The Action Bar: Front to BackThe Action Bar: Front to Back
The Action Bar: Front to Back
 
Secondary Screen Support Using DisplayManager
Secondary Screen Support Using DisplayManagerSecondary Screen Support Using DisplayManager
Secondary Screen Support Using DisplayManager
 
Mastering the Master Detail Pattern
Mastering the Master Detail PatternMastering the Master Detail Pattern
Mastering the Master Detail Pattern
 
Not Quite As Painful Threading
Not Quite As Painful ThreadingNot Quite As Painful Threading
Not Quite As Painful Threading
 
Maps V2... And You!
Maps V2... And You!Maps V2... And You!
Maps V2... And You!
 
A Deep Dive Into ViewPager
A Deep Dive Into ViewPagerA Deep Dive Into ViewPager
A Deep Dive Into ViewPager
 
The Wonderful World of Wearables
The Wonderful World of WearablesThe Wonderful World of Wearables
The Wonderful World of Wearables
 
Beaming Data to Devices with NFC
Beaming Data to Devices with NFCBeaming Data to Devices with NFC
Beaming Data to Devices with NFC
 
Making Money at Mobile: 60 Business Models
Making Money at Mobile: 60 Business ModelsMaking Money at Mobile: 60 Business Models
Making Money at Mobile: 60 Business Models
 
AppsWorld Keynote
AppsWorld KeynoteAppsWorld Keynote
AppsWorld Keynote
 
Android Hardware That's A Little Bit... Odd
Android Hardware That's A Little Bit... OddAndroid Hardware That's A Little Bit... Odd
Android Hardware That's A Little Bit... Odd
 
Google TV For Fun
Google TV For FunGoogle TV For Fun
Google TV For Fun
 
If I Were Starting Now
If I Were Starting NowIf I Were Starting Now
If I Were Starting Now
 
Tuning Android Applications (Part Deux)
Tuning Android Applications (Part Deux)Tuning Android Applications (Part Deux)
Tuning Android Applications (Part Deux)
 
Tuning Android Applications (Part One)
Tuning Android Applications (Part One)Tuning Android Applications (Part One)
Tuning Android Applications (Part One)
 
Android Library Projects
Android Library ProjectsAndroid Library Projects
Android Library Projects
 

Dernier

UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6DianaGray10
 
Empowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintEmpowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintMahmoud Rabie
 
Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1DianaGray10
 
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationUsing IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationIES VE
 
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfJamie (Taka) Wang
 
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online CollaborationCOMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online Collaborationbruanjhuli
 
OpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureOpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureEric D. Schabell
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1DianaGray10
 
Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.YounusS2
 
Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )Brian Pichman
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfDianaGray10
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UbiTrack UK
 
UiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPathCommunity
 
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAAnypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAshyamraj55
 
NIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 WorkshopNIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 WorkshopBachir Benyammi
 
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesAI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesMd Hossain Ali
 
Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024SkyPlanner
 
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDEADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDELiveplex
 
Introduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxIntroduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxMatsuo Lab
 

Dernier (20)

UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6
 
Empowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintEmpowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership Blueprint
 
Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1
 
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationUsing IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
 
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
 
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online CollaborationCOMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
 
OpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureOpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability Adventure
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
 
Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.
 
Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
 
UiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation Developers
 
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAAnypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
 
20230104 - machine vision
20230104 - machine vision20230104 - machine vision
20230104 - machine vision
 
NIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 WorkshopNIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 Workshop
 
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesAI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
 
Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024
 
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDEADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
 
Introduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxIntroduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptx
 

App Integration (Revised and Updated)

  • 1. App Integration: Strategies and Tactics Copyright © 2012CommonsWare, LLC
  • 2. Objective: Add Value ● Add Value for Users – More functionality without as much development effort ● Add Value for Third Parties – Their apps are more valuable when you help drive their adoption ● Add Value for You – Reciprocity from third parties Copyright © 2012CommonsWare, LLC
  • 3. Integration Models ● Peers – Apps with value independent of yours – Hard or soft dependencies ● Plugins – Apps with no value independent of yours Copyright © 2012CommonsWare, LLC
  • 4. Difficulty Level: One Red Bull Copyright © 2012CommonsWare, LLC
  • 5. Activities, Implicit Intents ● Make a Generic Request – ACTION_VIEW, ACTION_SEND, etc. ● User Dictates Terms – What applications are installed that could handle it – What application to use for this particular request – What to do with that application Copyright © 2012CommonsWare, LLC
  • 6. Activities, Implicit Intents ● Making the Selection – No options? Crash! – One option? Automatic start, no intervention – Multiple options? ● Default chooser ● Override chooser (Intent.createChooser()) ● ShareActionProvider ● Apple patent workarounds ● DIY Copyright © 2012CommonsWare, LLC
  • 7. Activities, Implicit Intents ● DIY – PackageManager queryIntentActivities() returns list of possibilities, given an Intent – You render resulting List somehow ● Avoiding the No-Options Crash – Same technique: if list empty, startActivity() would fail Copyright © 2012CommonsWare, LLC
  • 8. Activities, Explicit Intents ● Hard Dependency, Declared in Code – Craft Intent that will only be handled by peer application – Use PackageManager queryIntentActivities() to confirm it exists (or handle the exception) – Use with startActivity() / startActivityForResult() Copyright © 2012CommonsWare, LLC
  • 9. UI Integration via Web ● No Activity? How About a Web Site? – Easy: launch browser on URL with ACTION_VIEW – More Interesting: Host a WebView ● Pre-fill in forms using loadUrl(“javascript:...”) ● Warning #1: May be tough to control ● Warning #2: Dependencies on non-public “APIs” Copyright © 2012CommonsWare, LLC
  • 10. Difficulty Level: Two Red Bulls Copyright © 2012CommonsWare, LLC
  • 11. UI Integration via Web ● Reverse Integration: Web to App – Key: BROWSABLE category – Option #1: <data> For Your URL ● Option to launch app if app installed, else URL directs to Web page to go download the app – Option #2: Something Specific ● Intent.toUri() to generate a URL ● Custom scheme Copyright © 2012CommonsWare, LLC
  • 12. Integrating Resources ● createPackageContext() – Returns a Context that will resolve resources from some other package – Example Use: theme packs ● APK (possibly paid app) with res0urces representing theme ● Detect existence using PackageManager ● Use createPackageContext() to retrieve resources and apply to your UI Copyright © 2012CommonsWare, LLC
  • 13. Integration by ContentProvider ● All You Need is a Uri – And some idea of what the schema is, so you know what to do with it ● Example: plugins implementing a standard schema that you require – Getting the Uri ● Well-known resource name ● Bootstrap API (e.g., broadcast, remote service) Copyright © 2012CommonsWare, LLC
  • 14. Integration by ContentProvider ● The Permission Proxy – Problem: Your app needs too many permissions ● Example: Calendar integration – Solution ● Wrap OS/third-party ContentProvider in one of yours, with same schema ● Put that ContentProvider in plugin, to isolate permission ● Check signature to ensure only used by you Copyright © 2012CommonsWare, LLC
  • 15. Integration by Service ● Command Pattern – Third Party Supplies Intent Structure ● Action string ● Available extras – Call startService() as Needed ● Directly ● Via PendingIntent (e.g., AlarmManager) Copyright © 2012CommonsWare, LLC
  • 16. Integration by Service ● Binding Pattern – Agreed-Upon AIDL ● Peer: first mover ● Plugin: host defines – Third Party Implements AIDL Binder – You Bind and Use Copyright © 2012CommonsWare, LLC
  • 17. Integration by Broadcast ● Agreed-Upon Action, Ordered vs. Regular – Peer: first mover – Plugin: host defines ● One Side Broadcast, Other Side Receives – Manifest-registered receiver – registerReceiver() Copyright © 2012CommonsWare, LLC
  • 18. Difficulty Level: Case of Red Bulls Copyright © 2012CommonsWare, LLC
  • 19. UI Integration via RemoteViews ● Two Apps' UIs Simultaneously ● RemoteViews Host – Get RemoteViews from third-party ● Broadcast? Remote service? ● Initially, plus changes over time – apply() RemoteViews into your desired container Copyright © 2012CommonsWare, LLC
  • 20. UI Integration via RemoteViews ● Limitations – Widgets, methods available in RemoteViews – No direct interaction between apps ● Solution: API accessed via PendingIntents Copyright © 2012CommonsWare, LLC
  • 21. Difficulty Level: Red Bull Bottling Plant Copyright © 2012CommonsWare, LLC
  • 22. UI Integration via Parcelable ● RemoteViews Got You Down? Roll Your Own! – RemoteViews is a data structure representing commands to build a UI – Alternative: DIY RemoteViewsEx – Limitations ● Still loosely coupled for events (PendingIntent, Messenger, etc.) ● Effort proportional to the complexity of the UI you wish to share Copyright © 2012CommonsWare, LLC
  • 23. Integrating Code ● Option #1: createPackageContext() – getClassLoader() will return ClassLoader for accessing classes in other APK ● Use CONTEXT_INCLUDE_CODE in createPackageContext() call – Use reflection from there (e.g., loadClass()) to access foreign code Copyright © 2012CommonsWare, LLC
  • 24. Integrating Code ● Option #2: DexClassLoader – Given JAR/APK containing dex'd bytecode, allows you to load classes just like a regular ClassLoader ● Up to you to get the JAR or APK file Copyright © 2012CommonsWare, LLC
  • 25. Integrating Code ● WARNING – You might not know where that code came from ● Code injection attacks – Executed code runs with your permissions ● May do things you rather wish they would not – Net: very risky technique Copyright © 2012CommonsWare, LLC
  • 26. And Now, The Rest of the Story Copyright © 2012CommonsWare, LLC
  • 27. Discovery Mechanisms ● Hard-Coded ● Discovery via Broadcast – Host sends a broadcast periodically (first run, package installed, package removed) – Peers/plugins reply with broadcast about capabilities – Related: ACTION_PACKAGE_ADDED Copyright © 2012CommonsWare, LLC
  • 28. Discovery Mechanisms ● Discovery via Naming Convention – Plugins go in com.myfirm.myapp.plugin.* – Host uses PackageManager to identify – Further Handshaking ● Well-known resource ● Well-known “narrowcast” via setPackage() Copyright © 2012CommonsWare, LLC
  • 29. More Stuff to Consider ● Custom Permissions – Users should get a vote on data sharing ● Integration Library – JAR to ease third-parties working with your host ● Documentation – Only way anyone will know what to do ● ...and what you would rather they not do Copyright © 2012CommonsWare, LLC
  • 30. What the Ecosystem Needs ● Standards – Community-driven implicit Intent actions ● Scaffolding – Library projects, templates for creating these structures ● End-User Discovery – How do they know what can integrate? Copyright © 2012CommonsWare, LLC