Building PHP Powered Android Applications John Coggeshall
Introductions Welcome! About me CTO of Automotive Computer Services (ACS) Core PHP 5 Dev Author, Speaker John Coggeshall Presentation Title
Agenda Crash Course in Android Development Building PHP-powered backend services for the application Bringing it all together Warning: Nothing Magical here! Heavy Java/Android ahead!
Server Backend Zend Framework Backend of web services supporting our primary Flex-powered front-end Supports both XML-based and Action Message Format (AMF) encodings How Auth Service ultimately works: Post to http://server/service/v1?command=auth.find the necessary parameters Receive back a success, and a session ID
Server-Side Service Code
Basic Android Concepts Activity – A “Screen” of your application where you do things Intent – An inter-process / inter-activity notification system Layout – An XML definition of widgets for an activity
The Goal Create an Android application that can authenticate against our pre-existing web services Create the Android App itself Create a Proxy that can communicate over HTTP to the backend server Process the XML response Save the authenticated session for future use
The Android Application
Considerations Android itself doesn’t provide too many tools for web service calls (other than a HTTP client) The most challenging piece of the connectivity is in the details Error handling Parsing of responses Connecting all of it with an effective UI
Another option As Android is entirely Java-based, there are numerous Java toolkits that can help you along the way Be careful, many are too bloated for Android For XML-RPC, you can use the android-xmlrpc package
If you’re going to try.. If you’re interested in trying the Android platform, here’s a few words to the wise: Find good sources of documentation Too many out-of-date / wrong articles http://www.anddev.org/ http://www.helloandroid.com/
Development Tips Use the Android Debugger! The Log class is great for printf() sort of things (Shows up in the Android LogCat tab) Log.e(“MyErrorTag”, “My Error Message”); Server side: You *must* have good logging facilities Log exceptions, errors (real and logical) to a file you can tail –f on when making service calls
Development Tips The AndroidManifest.xml file is very important Need to define everything in there to some degree Activity classes Intent Filters Permissions requested (i.e. Network access) Works a lot better if you use the GUI interface instead of modifying the XML directly
We’re Hiring! Thank you! Interested in working on a project like this? We’re hiring! See our full-page ad in the conference program and visit us at the Job Fair!

Building PHP Powered Android Applications

  • 1.
    Building PHP PoweredAndroid Applications John Coggeshall
  • 2.
    Introductions Welcome! Aboutme CTO of Automotive Computer Services (ACS) Core PHP 5 Dev Author, Speaker John Coggeshall Presentation Title
  • 3.
    Agenda Crash Coursein Android Development Building PHP-powered backend services for the application Bringing it all together Warning: Nothing Magical here! Heavy Java/Android ahead!
  • 4.
    Server Backend ZendFramework Backend of web services supporting our primary Flex-powered front-end Supports both XML-based and Action Message Format (AMF) encodings How Auth Service ultimately works: Post to http://server/service/v1?command=auth.find the necessary parameters Receive back a success, and a session ID
  • 5.
  • 6.
    Basic Android ConceptsActivity – A “Screen” of your application where you do things Intent – An inter-process / inter-activity notification system Layout – An XML definition of widgets for an activity
  • 7.
    The Goal Createan Android application that can authenticate against our pre-existing web services Create the Android App itself Create a Proxy that can communicate over HTTP to the backend server Process the XML response Save the authenticated session for future use
  • 8.
  • 9.
    Considerations Android itselfdoesn’t provide too many tools for web service calls (other than a HTTP client) The most challenging piece of the connectivity is in the details Error handling Parsing of responses Connecting all of it with an effective UI
  • 10.
    Another option AsAndroid is entirely Java-based, there are numerous Java toolkits that can help you along the way Be careful, many are too bloated for Android For XML-RPC, you can use the android-xmlrpc package
  • 11.
    If you’re goingto try.. If you’re interested in trying the Android platform, here’s a few words to the wise: Find good sources of documentation Too many out-of-date / wrong articles http://www.anddev.org/ http://www.helloandroid.com/
  • 12.
    Development Tips Usethe Android Debugger! The Log class is great for printf() sort of things (Shows up in the Android LogCat tab) Log.e(“MyErrorTag”, “My Error Message”); Server side: You *must* have good logging facilities Log exceptions, errors (real and logical) to a file you can tail –f on when making service calls
  • 13.
    Development Tips TheAndroidManifest.xml file is very important Need to define everything in there to some degree Activity classes Intent Filters Permissions requested (i.e. Network access) Works a lot better if you use the GUI interface instead of modifying the XML directly
  • 14.
    We’re Hiring! Thankyou! Interested in working on a project like this? We’re hiring! See our full-page ad in the conference program and visit us at the Job Fair!