1 / 27

Android: Hello World

Android: Hello World. Frank Xu Gannon University. Steps. Configuration Android SDK Android Development Tools (ADT) Eclipse plug-in Android SDK and AVD Manager Adding Android Platforms Create Android Virtual Device (AVD). Create new android project Generate file structures

chin
Download Presentation

Android: Hello World

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Android: Hello World Frank Xu Gannon University

  2. Steps • Configuration • Android SDK • Android Development Tools (ADT) • Eclipse plug-in • Android SDK and AVD Manager • Adding Android Platforms • Create Android Virtual Device (AVD). • Create new android project • Generate file structures • Construct the UI • Run the Application

  3. Part1: Configuration

  4. Download Android SDK • http://developer.android.com/sdk/index.html

  5. Unzip SDK

  6. Sets the PATH environment variable

  7. Installing the ADT Plugin for Eclipse • Android Development Tools (ADT) • a custom plugin for the Eclipse IDE, • quickly set up new Android projects, • create an application UI, • add components based on the Android Framework API, • debug your applications using the Android SDK tools, and • even export signed (or unsigned) APKs in order to distribute your application.

  8. Configuring the ADT Plugin • Select Window > Preferences... to open the Preferences panel • Select Android from the left panel. • For the SDK Location in the main panel, click Browse... and locate your downloaded SDK directory. • Click Apply, then OK.

  9. Adding Android Platforms and Other Components • Android SDK and AVD Manager • to download essential components into your development environment. • To install a platform in Eclipse: • In the Android SDK and AVD Manager, choose Available Packages in the left panel. • Click the repository site checkbox to display the components available for installation. • Select at least one platform to install, and click Install Selected. If you aren't sure which platform to install, use the latest version.

  10. Create an AVD • You will run your application in the Android Emulator. • Before you can launch the emulator, you must create an Android Virtual Device (AVD). • An AVD defines the system image and device settings used by the emulator. • Configurations of emulator options that let you better model an actual device • http://developer.android.com/guide/developing/tools/avd.html

  11. Steps to AVD • In Eclipse, choose Window > Android SDK and AVD Manager. • Select Virtual Devices in the left panel. • Click New. • The Create New AVD dialog appears. • Type the name of the AVD, such as "my_avd". • Choose a target. The target is the platform (that is, the version of the Android SDK, such as 2.1) you want to run on the emulator. • You can ignore the rest of the fields for now. • Click Create AVD.

  12. Part2- Create new android project

  13. File Structure From Eclipse, select File > New > Project.

  14. Project Name • This is the Eclipse Project name — the name of the directory that will contain the project files. • Application Name • This is the human-readable title for your application — the name that will appear on the Android device. • Package Name • This is the package namespace (following the same rules as for packages in the Java programming language) that you want all your source code to reside under. This also sets the package name under which the stub Activity will be generated. • Create Activity • This is the name for the class stub that will be generated by the plugin. This will be a subclass of Android's Activity class. An Activity is simply a class that can run and do work. It can create a UI if it chooses, but it doesn't need to. As the checkbox suggests, this is optional, but an Activity is almost always used as the basis for an application. • Min SDK Version • This value specifies the minimum API Level required by your application. For more information, see Android API Levels.

  15. HelloAndroid.java • An Activity is a single application entity that is used to perform actions. • An application may have many separate activities, but the user interacts with them one at a time. The onCreate() method will be called by the Android system when your Activity starts • it is where you should perform all initialization and UI setup. An activity is not required to have a user interface, but usually will.

  16. Construct the UI

  17. Run the Application

  18. Hello World! 

  19. Can’t see your app?

More Related