The Aftek's Android AMF client library supports remoting and secured remoting. This will allow all android applications to use the existing backend like .NET, Java, or PHP. The implementation is asynchronous in nature providing success and failure callbacks. This allows application to perform other tasks without blocking the application.
2. Agenda
Android Server Communication
About AMF
About AMF
Performance Matrix
Android AMF Client Library
Overview
Features
Sample
3. Android Server Communication
Using URLConnection over HTTP
Works over HTTP
Need to read and write data byte-by-byte
http://www.anddev.org/getting_data_from_the_web_urlconnection_via_http-t351.html
Remote Procedure Calls
Requires stubs/skeletons using aidl for local & remote processes.
All methods executed synchronously – hence blocking.
http://developer.android.com/guide/topics/fundamentals.html#rpc
Web Services
KSOAP2 & KXML-RPC
No built-in support for handling float
http://www.anddev.org/web_services_-_an_xml-rpc_client_for_android-t646.html
http://code.google.com/p/android-xmlrpc/
4. About AMF
Action Message Format (AMF) - a binary format to serialize
ActionScript objects.
AMF is 10 times faster than other HTTP protocols
Performance of AMF3 protocol
when used with a Flex client –
communicating with a BlazeDS
server component
5. Android AMF Client Library
Adaptation of AMF 3.0 protocol for Android clients
Remoting support based on RPC mechanism.
Framework is asynchronous in nature and hence non-blocking.
Support for Secured AMF channel.
No need for stubs and skeletons, neither on client nor server.
A performance boost for Android applications communicating with
enterprise server applications.
Ease of use with simple interfaces and events
Can connect to any AMF compliant server such as:
• BlazeDS / LCDS
• AMFPHP
• RubyAMF
• WebORB
• OpenAMF
7. As simple as it gets …
Implement to receive asynchronous success / failure events
1) Instantiate desired channel with remote server URL of web application
2) Create Remote Object of required service provider
3) Register listener for success / failure events
4) Invoke remote method with desired parameters
5) All business and communication exceptions are stored in ErrorEvent
6) Result is returned in ResultEvent
7) Success / Error data is enclosed in respective events