Session 2 prepare android development environment
-
Upload
adham-enaya -
Category
Technology
-
view
1.209 -
download
2
Transcript of Session 2 prepare android development environment
![Page 2: Session 2 prepare android development environment](https://reader036.fdocuments.us/reader036/viewer/2022082420/556444b0d8b42a9f128b4ab5/html5/thumbnails/2.jpg)
Session 2: Prepare Android Development Environment
Sunday, March 27, 2012
![Page 3: Session 2 prepare android development environment](https://reader036.fdocuments.us/reader036/viewer/2022082420/556444b0d8b42a9f128b4ab5/html5/thumbnails/3.jpg)
April 12, 2023 Open source Training (Android Course) Adham Enaya
Downloading development environment
• Eclipse IDE(Google-supported)– Download: http://www.eclipse.org/downloads
• Android SDK– SDK Manager– Android Platform– SDK samples …etc.– Emulator and debugger – Download: http://developer.android.com/sdk/index.html
• Android Development Tools(ADT)– Install plug-in: http://dl-ssl.google.com/android/eclipse
![Page 4: Session 2 prepare android development environment](https://reader036.fdocuments.us/reader036/viewer/2022082420/556444b0d8b42a9f128b4ab5/html5/thumbnails/4.jpg)
April 12, 2023 Open source Training (Android Course) Adham Enaya
Configuring the development environment
1. Installing the ADT plug-in:– Go to Help menu in eclipse -> Choose Install new
software -> Add -> Set the name and location of the plug-in .
2. Go to Window -> Preferences.3. Select Android -> Set the location of android
SDK folder.
![Page 5: Session 2 prepare android development environment](https://reader036.fdocuments.us/reader036/viewer/2022082420/556444b0d8b42a9f128b4ab5/html5/thumbnails/5.jpg)
April 12, 2023 Open source Training (Android Course) Adham Enaya
Android SDK & AVD Manager
• Helps to:– Browse the installed packages.– The available packages to install.– To create Android virtual devices – It is connected directly with Google servers to
install packages from them.– You can download :
• Android platforms, documentation, samples tools..• Third party Add-ons, i.e. Google APIs to use Google Maps
in the application.
![Page 6: Session 2 prepare android development environment](https://reader036.fdocuments.us/reader036/viewer/2022082420/556444b0d8b42a9f128b4ab5/html5/thumbnails/6.jpg)
April 12, 2023 Open source Training (Android Course) Adham Enaya
Creating Android Virtual Device (AVD)
• AVD: is and emulator instance modeling the actual device.
1. Go to window -> Android SDK and AVD Manger.
2. Select Virtual Devices-> enter the AVD properties:
1. Device name.2. Target platform ( i.e. Android 2.3- level 9).3. You can choose a specific hardware(i.e.
![Page 7: Session 2 prepare android development environment](https://reader036.fdocuments.us/reader036/viewer/2022082420/556444b0d8b42a9f128b4ab5/html5/thumbnails/7.jpg)
Create Hello World Application (1)
• In Eclipse -> New -> Project -> Android Project.
• Enter Project Name.– Choose Create New Project in workspace.
• Choose the build target ( The android platform you app runs on !)
• Click Next.
![Page 8: Session 2 prepare android development environment](https://reader036.fdocuments.us/reader036/viewer/2022082420/556444b0d8b42a9f128b4ab5/html5/thumbnails/8.jpg)
Create Hello World Application (2)
• Enter Application info:– Application Name ( User-friendly name).– Package Name (At least 2 identifiers i.e
adham.android).– Check create Activity to create a UI for the
application.– Set the Minimum SDK that you app will run on.– Finish !
![Page 9: Session 2 prepare android development environment](https://reader036.fdocuments.us/reader036/viewer/2022082420/556444b0d8b42a9f128b4ab5/html5/thumbnails/9.jpg)
Project Anatomy (1)
• src : a folder contains on the java source code for the project.
• R.java in gen folder: – R.java is eclipse generated java file.– We will not modify it anytime!– Contains memory references for all project
resources i.e. :• GUI objects, layout, strings values.
– Helps in accessing the res objects easily.
![Page 10: Session 2 prepare android development environment](https://reader036.fdocuments.us/reader036/viewer/2022082420/556444b0d8b42a9f128b4ab5/html5/thumbnails/10.jpg)
Project Anatomy (2)
• Android 2.3: jar files contains the core android libraries.
• assets: contains the resources for the application i.e. database or external file.
• bin: contains any external libraries.
![Page 11: Session 2 prepare android development environment](https://reader036.fdocuments.us/reader036/viewer/2022082420/556444b0d8b42a9f128b4ab5/html5/thumbnails/11.jpg)
Project Anatomy (3)
• res: – drawable : contains the images for the application
i.e. application icon.– drawable-hdpi : contains images for high
definition screens.– drawable-ldpi : contains images for low definition
screens.– drawable-mdpi : contains images for medium
definition screens.
![Page 12: Session 2 prepare android development environment](https://reader036.fdocuments.us/reader036/viewer/2022082420/556444b0d8b42a9f128b4ab5/html5/thumbnails/12.jpg)
Project Anatomy (4)
• layout: contains the xml- definition for the GUI layout and it’s components.
• values : contains the xml files the represents the constants values for the application i.e. strings.xml to store all constant strings.
![Page 13: Session 2 prepare android development environment](https://reader036.fdocuments.us/reader036/viewer/2022082420/556444b0d8b42a9f128b4ab5/html5/thumbnails/13.jpg)
Project Anatomy (4)
• AndroidManifest.xml: contains all information about the application.– The package name of the application.– Application version (<major>.<minor>.<point> )– Application icon.– Application name from strimgs.xml.– android:minSdkVersion: specifies the minimum
version of the OS on which the application will run.
![Page 14: Session 2 prepare android development environment](https://reader036.fdocuments.us/reader036/viewer/2022082420/556444b0d8b42a9f128b4ab5/html5/thumbnails/14.jpg)
Project Anatomy (5)
– Definition of all activities in the application.• The action for the intent filter is named
android.intent.action.MAIN to indicate that this activity serves as the entry point for the application. • The category for the intent-filter is named
android.intent.category.LAUNCHER to indicate that the application can be launched from the device’s Launcher icon.
![Page 15: Session 2 prepare android development environment](https://reader036.fdocuments.us/reader036/viewer/2022082420/556444b0d8b42a9f128b4ab5/html5/thumbnails/15.jpg)
April 12, 2023 Open source Training (Android Course) Adham Enaya
Any Question ?
Best,