1. Android Application Development Getting Started Ahsanul Karim [email_address] Sentinel Solutions Ltd. http://www.sentinelbd.com
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14. Let’s say “Hello” to the Android World! (Contd.) 1. Start Eclipse and Go to File > New > Android Project 2. We keep project name “Hello World” (Since 1970 Ritchie’s book on C programming, programmers always say Hello World first) 3. Build Target “Android1.6” 4. Application name: “Hello World” 5. Package name: com.sentinelbd.hallo 6. Initial Activity Name: HalloActivity 7. Min SDK Version: 4 8. Click Finish Congratulations! You’ve just created your first Android application We’ll explain each input shortly
15. Let’s Go Deep… Created Project has the following structure Project Structure -Source ( src ) -Generated Class ( gen ) -Android 1.6 library -Assets ( assets ) -Resource( res ) - drawable-hdpi - drawable-ldpi - drawable-mdpi - layout - values - AndroidMenifest.xml - default.properties
16.
17. Let’s Go Deep… (Contd.) 1. Create AVD (Android Virtual Device) Use Android SDK & AVD Manager to create AVD
18.
19. Let’s Go Deep… (Contd.) 3. Select AVD & Run Click Run to start AVD/emulator
20. Let’s Go Deep… (Contd.) Result in Emulator Now its time to analyze how it works
21. Project Structure… Created Project has the following structure Project Structure -Source ( src ) -Generated Class ( gen ) -Android 1.6 library -Assets ( assets ) -Resource( res ) - drawable-hdpi - drawable-ldpi - drawable-mdpi - layout - values - AndroidMenifest.xml - default.properties
22. Project Structure (Contd.) -Source ( src ) We have used only one class here which is an Activity named HalloActivity. We’ll describe about Activity in detail with lifecycle shortly. For now we can consider Activity as Android analogue for the window or dialog in a desktop application. It can load view from xml layout (here main.xml under res/layout folder) In the HelloActivity class the view of the Activity is set from main.xml given below
23.
24.
25. Project Structure (Contd.) -AndroidMenifest.xml XML file describing the application being built and what components – activities, services, etc. – are being supplied by that application