0% found this document useful (0 votes)
91 views26 pages

Unlocking Android - Frank Ableson

Frank Ableson presented on unlocking Android. He discussed Android resources like the developer site and his book, showed a sample field service app, and demonstrated controlling Twitter from Android using the scripting environment. He also mentioned writing a mobile column for Linux Magazine about cross-platform mobile development using PhoneGap.

Uploaded by

vosise7216
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
91 views26 pages

Unlocking Android - Frank Ableson

Frank Ableson presented on unlocking Android. He discussed Android resources like the developer site and his book, showed a sample field service app, and demonstrated controlling Twitter from Android using the scripting environment. He also mentioned writing a mobile column for Linux Magazine about cross-platform mobile development using PhoneGap.

Uploaded by

vosise7216
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 26

Unlocking Android

Frank Ableson
MSI Services, Inc. (http://msiservices.com)
Linux Magazine Mobile Editor (http://linux-mag.com/blogs/fableson)
Unlocking Android author (http://manning.com/ableson)

This presentation available on blog @ http://www.msiservices.com/index.php/blog/

Unlocking Android
Who am I & why am I here?
•I am a curious entrepreneur who “codes”.
•I’m here to learn and network – just like you
•If you want deep Android answers, you can ask,
though I will likely point you to the Google
developer mailing list . I presently have about
12,000 unread emails from that list alone!

Unlocking Android
What are we going to review today?

•Review some Android resources


•Look at an example application for Android
•Look at Android Scripting Environment
•Linux Magazine – how you can participate

Unlocking Android
Some Android Resources
•http://developer.android.com
•SDK
•Eclipse Plugin : https://dl-ssl.google.com/android/eclipse/
•Developer Guides
•Class References
•Blog
•Mailing Lists
•Beginners
•Developers
•Discussion
•NDK
•Security
•Market
•Unlocking Android, Published by Manning. http://manning.com/ableson
•http://code.google.com/p/unlocking-android/ source from the book (SVN)
•http://subclipse.tigris.org/update_1.6.x (SVN Plugin)

Unlocking Android
Unlocking Android Contents

Plus installing dev tools & signing applications


Unlocking Android
Any questions before we start?

Unlocking Android
Field Service Application
•Enabling a mobile workforce
•Centrally dispatched
•Workers carrying Android devices (of course)
•“Hands and Feet” – not specialists
•Need to augment their knowledge
•Give them some navigational guidance
•Capture signatures to confirm work was completed
•Fully un-tethered
•Download jobs from server
•Upload signatures
•Confirm signatures

Unlocking Android
Data Model
Home office / dispatcher Mobile worker

List of jobs sent to a


Jobs
specific mobile worker

Each job contains


Job id
Customer name
Address
City, State, Zip
Product needing repair
URL to product information
Comments
Job status (updated by mobile)
Signature (updated by mobile)

Unlocking Android
Application Architecture
WWW Server
(Apache or IIS)
MySQL
with PHP

getjoblist.php

closejob.php

Dispatch functions

Distributed dispatchers

Unlocking Android
Application in action – Data
http://android12.msi-wireless.com

Unlocking Android
Application Flow
Application launch Splash screen #2
#1
(Splash Activity)

Main screen
#3
(FieldService Activity)

#4 #6 #5

Refresh jobs Manage jobs Settings


(RefreshJobs Activity) (ManageJobs Activity) (ShowSettings Activity)

#7

Show job details


(ShowJob Activity)

#8 #9
#10 #11

Map job location


Look up product info No Capture signature
Job closed?
(Launch Google Maps) (Launch browser) (CloseJob Activity)

Yes

#12

Display signature
(Launch browser)

Unlocking Android
Application in action - Splash

Unlocking Android
Application in action – Main Screen

Unlocking Android
Application in action - Settings

Unlocking Android
Application in action – Refresh

Unlocking Android
Application in action – Job List

Unlocking Android
Application in action - Details

Unlocking Android
Application in action – Mapping

Unlocking Android
Application in action – Product Info

Unlocking Android
Application in action - Close

Unlocking Android
Application in action – After Close

Unlocking Android
Source Code Roadmap

Unlocking Android
Twitter with the Android Scripting Environment

Unlocking Android
Twitter Python Code
import android # core Android routines # connect to server
import httplib # for talking to web servers h = httplib.HTTP(twitterhost)
import urllib # to format our status update nicely
import base64 # to encode our username and password for Basic authentication # build url we want to request
fullurl = uri + statusupdate
print 'Cool, we're running!' # sorry, had to do this...
#uncomment the next line to see the url printed
# get an instance of Android #print fullurl
droid = android.Android()
# POST our data. Twitter requires status updates to be POSTed
# where are we posting data to? h.putrequest('POST',uri + statusupdate)
twitterhost = 'twitter.com'
uri = '/statuses/update.xml?' # setup the authentication header
h.putheader('Authorization','Basic ' + base64.encodestring(credentials))
# get our status update from user
statusmsg = droid.getInput('Twitter Update','Whatcha Doin?') # setup the user agent
h.putheader('user-agent','Android-Scripting-Engine-Python')
#extract the "textual" portion of the response
statusdata = "%(result)s" % statusmsg # we're done with the headers....
h.endheaders()
# uncomment the next line to display the message to the terminal screen
#print statusdata # get the response from the request
returncode,returnmsg,headers = h.getreply()
# uncomment the next line to display a notification to the user
#droid.makeToast(statusdata) # should compare the returncode to 200 for a good response, etc.

# clean up the data so it can be sent as the 'querystring' #display whatever the results are....
statusupdate = urllib.urlencode({'status':statusdata}) f = h.getfile()
print f.read()
# setup your username and password here...
username = 'yourusernamehere'
password = 'yourpasswordhere'

credentials = username + ":" + password

# uncomment the next line to see what credentials you are using....
#print credentials

encodedcredentials = base64.encodestring(credentials)

Unlocking Android
Linux Magazine Mobile Column
Author Archive
Open Source Solution for Multiple Mobile Platforms There is a never ending debate about which platform is best: Android, iPhone,
Palm, BlackBerry, Windows Mobile, or Symbian. But what if the correct answer is … JavaScript? Is this a joke? Not according to an
open source project named PhoneGap.
July 20, 2009
Best Practices for Troubleshooting Mobile Software During software projects, you often have to eat some bugs. Just try not to chew
on them.
July 13, 2009
Open Source iPhone Dev: XML to the Rescue? Can a project originating from San Francisco State University bridge the digital divide
and bring true open source development to the iPhone platform? It looks promising, but the climb is steep and the gap is wide.
July 6, 2009
An Open Source Recipe for the iPhone The platform that has defined “cool” for years has not had a reputation for being an open
platform, but that hasn’t discouraged a number of open source projects for iPhone/iPod Touch.
June 30, 2009
Is Palm a Player or Just a Pre-Tender? Once the leader and innovator in all things mobile, in recent years Palm has barely kept up
with the pack, let alone acted as a leader. With the introduction of the Palm Pre it appears that open source technology is helping
bring Palm back from the edge of irrelevancy.
June 23, 2009
Writing an Android Twitter Client with Python Get up and running with the Android Scripting Environment. Whip up a Twitter update
app in a matter of minutes and tell everyone what sandwich you’re eating from within Android!
June 16, 2009
Is Android The Perfect Mobile Software Platform? Is Android an iPhone killer or is it just another failed attempt at taking Linux
mainstream on a mobile phone?
June 8, 2009

Unlocking Android
Contact info
Frank Ableson
[email protected]
http://www.linux-mag.com/blogs/fableson

Unlocking Android

You might also like