lec34x

eyelashesnectarineΛογισμικό & κατασκευή λογ/κού

3 Νοε 2013 (πριν από 3 χρόνια και 10 μήνες)

88 εμφανίσεις

INTRO TO MOBILE APP
DEVELOPMENT



CMSC 150: Lecture 34

What is Android?


Open source OS for mobile devices


Google supported


Open Handset Alliance project


Based on Linux kernel


Apps programmed in Java (we already know Java)


Why aren’t we doing
iOS
?


Apps programmed in Objective C


One of the professors doesn’t have an
iPhone


2

What is Android?


Android libraries provide access to mobile device
features from your Java program


Like
java.util
, Squint


Mobile
-
adapted GUI components


Not Swing, but similar stuff


Best development platform is Eclipse


http://www.eclipse.org/


http://
developer.android.com/sdk/index.html

3

App Construction

4


Visual aspects specified as “resources”


Strings displayed in app


easier localization


GUI layouts in XML


can be changed without
recompilation


Images used by app


Eclipse has a nice visual GUI editor


Drag
-
and
-
drop user interface construction


Eclipse also has a software emulator


So you don’t have to have an Android phone to have
Android app development fun

GUI components

5


Android has layouts to organize GUI components


LinearLayout



components stacked vertically or
horizontally


TableLayout



like a grid, but more flexible


etc…


GUI components are called “Views”


TextView

==
JLabel


EditText

==
JTextField


Button ==
JButton

App structure

6


Apps composed of multiple Activities


One Activity == one screen


Activity class is a lot like
WindowManager


Provides basic functionality for user interaction


e.g.
onClicked
() method kind of like
buttonClicked
()


Also manages App “life cycle”


provides methods
called automatically when:


App starts


App suspends


App resumes


etc…

7

Interaction with other Apps

8


View some data, dial a number, play a song, see a
picture, send an email or text message


Apps can use Intents to launch other apps


Intent class encapsulates the requested action and
the data on which to perform it


Android matches the intent with the best App to
provide the service, e.g. web browser, image
gallery, phone dialer, etc.

Time for “Hello Android”

9

10


Sources


Android Presentation by Manish K
Chauhan

(http://www.slideshare.net/AnshSingh1/android
-
ppt
-
8454226)


Hello, Android, 3e by Ed
Burnette


Android, How to Program,
Deitel
,
Deitel

and
Deitel


http://
developer.android.com

11