Loading presentation...

Present Remotely

Send the link below via email or IM

Copy

Present to your audience

Start remote presentation

  • Invited audience members will follow you as you navigate and present
  • People invited to a presentation do not need a Prezi account
  • This link expires 10 minutes after you close the presentation
  • A maximum of 30 users can follow your presentation
  • Learn more about this feature in our knowledge base article

Do you really want to delete this prezi?

Neither you, nor the coeditors you shared it with will be able to recover it again.

DeleteCancel

Make your likes visible on Facebook?

Connect your Facebook account to Prezi and let your likes appear on your timeline.
You can change this under Settings & Account at any time.

No, thanks

Integration with Android

This Prezi shows how one should go about when building integration applications with android.
by

Stephen Fenech

on 26 May 2011

Comments (0)

Please log in to add your comment.

Report abuse

Transcript of Integration with Android

Integration with Android Applications Android Primer Internal Integration External Integration Who am I? Studies Model Checking Formal Methods Formal Language Work Mainly Java Enterprise Integration Stephen Fenech Mule Development Support Training Consulting "The world's #1 open source ESB" Many DBs Many App Servers Messaging Content Repos BPMS OpenIAM Salesforce Sugar Liferay GWT Spring MVC Android Motivation Case Study Information is Scattered Personal Enterprise Shipment Timesheets Project Management CRM Billing Salesforce Offer Everything in 1 package
CRM
Business Specific Apps
Collaboration Suite Need to be Mobile Need to be Everywhere Android Users expect access from Handheld Can make or break a mobile device! Blackberry
iPhone
Android Users expect to leverage device Hardware Browser based applications are limited Camera Microphone Accelerometer GPS Telephony Being mobile still poses difficulties Diminishing as we speak... Screen Size Battery Life Network Speed Network Costs Tablets more screen real estate
more battery life
more power
more opportunities Apps need to work together We are distracted easily We are impatient Typically do multiple things We expect mobile to perform Everything
Easily Apps no longer confined to
Desktop
Laptop
Mobile TVs
YouTube
MyYahoo Widgets Soon... Microwave
Twittering
Updating Facebook Status Good Network Communication Support

Brilliant Application Integration

Not just aimed at Mobile Devices

Open Email Facebook LinkedIn YouTube Jango Twitter Facebook Sales person travel between clients
Need info about Clients
Need to keep records up to date
Moved to Salesforce for more visibility On the move => Handheld Android offered best Platform ? Originally Soap
Easy Answer => NO
There is now REST API
Not as Easy => NO What if API is changed? What if we would like to limit/control certain information What if we want certain information over https What if we want to compress? What if we want full flexibility? Integration Framework
for Flexibility Rest Soap Exposed Rest
Consumed Soap
Reduced Size of Payloads
Full Control Soap Rest Minimal Changes on Handheld
Seamless Integration
Faster (Especially when quering both) More than just OS What makes up an
Android App? Main Building Blocks Empowering UI
with Intents Simple App Runtime Environment Development Tools Linux Kernel Code Libraries Managers Basic Apps "Android is a software stack for mobile devices that includes an operating system, middleware and key applications. The Android SDK provides the tools and APIs necessary to begin developing applications on the Android platform using the Java programming language." Resources
Telephony
Location Base Services
... Home
Phone
Web Browser
Email
... Java Code Activity Service Broadcast Receiver Content Provider "I want to do something" Accessing the Network Displaying the Data The Mule Application Content Providers Current Work Android is Very Open Might be too open in certain sectors Enterprise needs Control Management of Devices Managing Applications Controlling Use Configuration Eclipse IDE Debugging AVD Manager Dalvik Debug Monitor Server Emulator Emulator Filesystem Management Your Custom Classes Library Jars Single focused screen App typically has multiple activities Android manages Activity Lifecycle Typically fills entire screen Call Write Email Browse Users interact with Activities 1 activity is the "main" activity
intents used to move between activities
all activities must be defined in manifest Activity States
Active/Running
Paused
Stopped Android decides which apps to close Activity Priority
1) Foreground
2) Visible
3) Service
4) Background
5) Empty Process Performs long running operations No user interface IPC used for communication Receive Global events
ringing of phone
email received No UI component Used to expose App data to external apps (can also be used from within App) Data Layer providing abstraction
Discouraged to share data directly URIs used to retrieve data Android Runtimes WebKit Browser
SQLite
OpenGL ES
Audio & Media Support
SSL
... Core Java Packages
Dalvik Decoupling of Apps Apps do not need to know "who" is handling
the Intent Easy to Replace Applications More Uniform interface Simple Message Objects Similar approach taken in Enterprise Apps Message Oriented Encourages Reuse Can Reuse already implemented Apps! Make Call Send Email Send SMS Maps Play Music My
Activity Phone
Activity "I intend to make a call" 99% using Http ConnectivityManager used to check Network Status Http with HttpClient Threading Can use java.net but better HttpClient Parsing Json Do not Block UI Thread Only UI Thread can do UI changes AsyncTask
onPreExecute()
doInBackground()
onProgressUpdate()
onPostExecute() Ways to Access UI Thread
Activity.runOnUiThread(Runnable)
View.post(Runnable)
View.postDelayed(Runnable,long)
Handler
(Tend to complicate code) Simple text views not always enough AdapterViews use Adapters to display data Gallery ListView Spinner GridView Adapters act as bridge to underlying data AdapterViews Responsible to
Fill layout with Data
Handle user Selection What is Mule? Lightweight Java based ESB & Integration Platform Allows Developers Connect applications together
Quickly
Easily JMS JDBC Soap Rest FTP File Email Salesforce Twitter Building Blocks Transformers Filters Routers Flows "Translate" messages between applications No standard message format
Anything can be a message Many transformers OOTB
Typical to create custom Simple but powerful framework Controls "Movement" of messages Allows services be decoupled Can build custom routers Many routing patterns OOTB Filtering Idempotency Splitting Aggregation Accept/Reject Messages Many OOTB Filters Can create custom filters Combine elements together What will Mule be doing? Providing transparent RESTful interface
Routing client requests to CRMs
Aggregation of results from CRMs Logging In Requesting Data Salesforce
Requires username + password
Returns session key
Sugar CRM
Requires username +MD5 hashed password
Returns session key

Abstract away detail
Require Username + password (Hashing by Mule)
Return single session key http://.../crm/login?
sfusername=...&
sfpassword=...&
scusername=...&
scpassword=.... Client uses Session ID with requests

Mule needs to know where requests should go
Both CRMs (eg list all contacts)
Specific CRM (eg get a specific Contact)

Mule needs to append correct session IDs

Need to provide Unique Ids
Prepend SF:/SC: to IDs Moving with Intents Aim to create Seamless Applications
Android model designed explicitly for this
Applications are federation of loosely-coupled components
Applications should co-operate with the System and other Apps Primary attributes of Intent
action (verb - VIEW, EDIT...)
data (noun - URI...) Secondary attributes
category (where & how it can be used)
type (explicit MIME type)
component (explicit class to use)
extras Implicit Intents Intent Filters Used to store & retrieve data across Applications Data Access Layer Content URIs identify data set Provide basic CRUD operations Already Successful for "private" use What about the Enterprise? Google Consolidate All Needs
Messaging
Social Networking
Games Email
Chat
Document
Navigation Portal/Wigits
Email
Games
News My Yahoo Manifest File Resources Contains Description of the Application What Components does this App Have? What Permissions does it need? What screen sizes was this app written for? What Android Version? What data does it expose? Non-Code items should be Externalised Many Resource types
Drawables
String
Layout
Menu
Array
... Default & Alternative Resources Localisation Screen Orientation Screen Size Screen aspect Screen pixel density Dock mode Night mode Touchscreen type Keyboard availability If it is docked in the car, it is night, high pixel density...
Use darker images not to ruin night vision Activities are placed in Activity Stack When we leave activity, it is placed in stack Can move back similar to browser (Similar to cards in a deck) Multicasting Components Contain Business Logic Can be POJOs or Spring Beans Managed by Mule
Exposed as services
Threading
Event Handling
... Open Source when possible... BPM Android decides which Component to activate
Loose Coupling / Run-time Binding
Typically used to activate components in other Apps
No Component Name defined Explicit Intents Intent explicitly designated a target class
used internally by the application With Implicit intents, Android chooses component depending on the contents of the Intent Intent Filters advertises capabilities
Delimits intents it can handle Typically configured in Manifest Intent Filter has fields equivalent to
Action
Data
Category
these need to match Discovering information about components on Device eg. Application Launcher is populated by Android system with all Activities with intent filters that specify the action "android.intent.action.MAIN" and category "android.intent.category.Launcher" Questions? stephen.fenech@ricston.com Processor
Full transcript