You are on page 1of 18

SYNAPSEINDIA

REVIEWS ON APPS
DEVELOPMENT

Mobile Apps

INTRODUCTION TO APPS
DEVELOPMENT FOR THE
IPHONE AND THE ANDROID
OS

ANDROID
Need Java 5.0+
Easiest to use Eclipse 3.3.1+
Download SDK starter pack from
developer.android.com and invoke SDK
setup program
Install Eclipse plugin
Help, Install New Software
Android Development Tools
Tell Eclipse where Android is located

Windows, Preferences, Android

HELLO ANDROID
Eclipse File, New, Project,
Android, Android Project
Create Android Virtual Device (AVD)
Window, Android SDK, AVD Manager
Run (on emulator)
To run on phone enable USB debugging
Settings, Applications, USB Debugging
Install USB driver (Windows only)

ANDROID APP FRAMEWORK


Created by default
src -- Hello.java -- main Activity
res, drawable -- icon.png apps icon
res, values -- strings.xml constants
res, layout main.xml -- screen layout
AndroidManifest.xml table of contents
gen R.java references, never touch it

ROCK PAPER SCISSORS

Two activities Rsp and Res


Layout TextView over nested layout
Hook up buttons
Use an Intent to go from one to the other
Result activity text, text, button
Result text enhanced
Can configure layouts by dragging widgets and entering
properties

BALL GAME
Touch ball to score, after 10 ball shrinks and goes faster
Easy, medium, hard choices
Uses a Java view not XML
Uses the onTouchEvent handler
Use the onDraw method to draw on a canvas

OPENGL (FROM HELLO ANDROID)


Rotating cube
Uses OpenGL ES (embedded systems)
Draws cube from vertices
Uses GLRenderer
onSurfaceCreated -- set properties
onSurfaceChanged update view
onDrawFrame draw the scene

BROWSER VIEW (FROM HELLO


ANDROID)
An EditText and Button above WebView
WebView uses loadUrl method to display web page
Documentation developer.android.com

IPHONE
Needs Intel Mac, OS X 10.5.4+
Download SDK and register (free)
developer.apple.com/iphone
$99 to deploy to iPhone or iPod
Uses Objective-C
Launch XCode
Examples from iPhone SDK Development

HELLO IPHONE
File, New Project in XCode
Choose View-based Application
HelloViewController class and HelloViewController.xib (nib),
freeze-dried GUI
HelloAppDelegate manages application
Use Interface Builder to add Label and configure color and
size in Attributes inspector

HELLO USER
Allow user to enter a name
IBOutlet reference from code to nib object, e.g. label, text
field
IBAction method nibs objects can call, e.g. button press
handler
In Interface Builder, connect outlets to code, connect action
Touch Up Inside event to handler method, sayHello
Implement the sayHello handler method

MOVIE - MVC
Create Movie class (the model)
Labels with movie info, Edit button
MovieEditorViewController for edit view with Done button to
return to main screen
Send message in Edit button to start movie controller
Send message in Done button to return to
MovieViewController

MOVIE TABLE
UITableView, UITableViewDataSource
protocol provides number of rows, add,
delete, etc., UITableViewDelegate to
handle tapping to select a row
Uses Navigation-based Application
UINavigationController
UINavigationBar (with Edit and Add
buttons)
RootViewContoller (with UITableView)
UINavigationItem

MOVIE TABLE -2
UINavigationController maintains navigation state as a
stack of view controllers.
Uses an array to hold table data. Initial array hard-coded.
Changes are not saved.

CONFERENCE -- CORE DATA


Built on SQLite
Managed Object Context row data turned into objects
Managed Object Model like schema
Persistence Store Coordinator connects to the database
Double-click on Conference.xcdatamodel to get screen to
configure tables

CORE DATA - 2
Create Managed Object Class to represent the model
Conference has tracks with trackAbstract, name, sessions
Edit and Add buttons configured in code in viewDidLoad
method rather than in Interface Builder
NSFetchedResultsController adaptor between CoreData
and table view

REFERENCES
Hello Android, Third Edition, Ed Burnette,
Pragmatic Programmers, 2010.
Introduction to Android development Using
Eclipse and Android widgets

ibm.com/developerWorks
iPhone SDK Development, Bill Dudney and
Chris Adamson, Pragmatic Programmers,
2009.
Beginning iPhone Games Development, PJ
Cabrera, et al, Apress, 2010.
Developing Apps for iOS (video and pdf)
from Stanford University

You might also like