120 likes | 283 Views
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
E N D
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
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
App Construction • 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 • 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 • 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…
Interaction with other Apps • 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.
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