Android learning route (2) create an Android project, route android

Source: Internet
Author: User
Tags android sdk manager

Android learning route (2) create an Android project, route android

An Android project contains all the files including the Android app code. The Android SDK provides default project directories and files to create a project.

This course will show you how to create a new project through Eclipse (including the ADT plug-in) or using the SDK tool on the command line.

Tip:You must install the Android SDK first. If you are using Eclipse, you must also install the ADT plug-in (version 22.6.2 or later ). If you do not have these, you can install them through the Android SDK Installation Wizard and then return to this course.

Create a project through Eclipse
  1. ClickNew.
  2. OpenAndroidFolder, selectAndroid Application ProjectAnd then clickNext.

    Figure 1. The New Android App Project wizard in Eclipse.

  3. Complete the form in the window that appears:
    • Application NameIs the name of the app to be displayed to the user. In this project, use "My First App" as the project name.

    • Project NameIs the directory of your project and the name of the project in Eclipse.
    • Package NameIs the package namespace of your project (following the same package naming rules as java programming ). Your package name must be unique among all the package names in the Android system. Therefore, you 'd better choose to use the Reverse Domain Name of your organization or publisher as the package name. In this project, you can use a package name similar to "com. example. myfirstapp. However, you cannot publish an application with the package name starting with "com. example" on Google Play.
    • Minimum Required SDKIt is the lowest Android version supported by your app and specifies the API level used. To support as many devices as possible, you should set it to the lowest available version that can provide the core features of your application. If some features in your application must use APIs of a higher version and these features are not so important to the core features of the application, you can specify that these features run only on systems that support their Versions (as we discussed in Supporting Different Platform Versions ). This project uses the default version.
    • Target SDKIndicates the maximum version of the Android system that you use to test your application (also using the API level ).

      Once a new version of Android is available, you should test your application on the new version and update the Taget SDK to the new version value so that you can use the features of the new version of the platform.

    • CompileIndicates the version you want to use to compile your application. By default, it is set to the highest Android version in your SDK (it must be Android4.1 or later; if you do not have this version, you must install it through SDK Manager ). You can also support earlier versions of the system, but you need to set target to the latest version to optimize your application so that it can have a great user experience on the latest version of the device.
    • ThemeSpecifies the UI style of your application. You can leave it empty here.

    ClickNext.

  4. Configure the project on this page. All items are default here, and then clickNext.
  5. This interface helps you create application icons.

    You can customize an icon in multiple ways, and this tool can help you generate an icon for devices with all screen resolutions. You can customize an icon in several ways and the tool generates an icon for all screen densities. Before You release an application, make sure that your icon meets the Iconography specifications in the Image Design Guide ).

    ClickNext.

  6. Now you can select an activity template to create your application.

    In this project, selectBlankActivityThen clickNext.

  7. Keep the details of all the activities in the default status, and then clickFinish.

Your project is now a basic "Hello World" application and contains some default files. Run your application. continue to the next lesson.

Create a project using the command line tool

If you do not use Eclipse IDE that contains the ADT plug-in, instead, you can use the SDK tool in the command line to create your project:

  1. In the command line, change your directorytools/.
  2. Run:
    android list targets

    This will list all available Android SDK versions you have downloaded. Find a version you want to compile your application. Remember the target id. We recommend that you use the highest possible version. You can also support earlier versions of the system, but you need to set target to the latest version to optimize your application so that it can have a great user experience on the latest version of the device.

    If you do not list any targets, you need to download them using the Android SDK Manager tool. View Adding Platforms and Packages.

  3. Run:
    android create project --target <target-id> --name MyFirstApp \--path <path-to-workspace>/MyFirstApp --activity MainActivity \--package com.example.myfirstapp

    Set<target-id>Replace it with the id remembered in the previous step.<path-to-workspace>You want to save the location of your Android project.

Your project is now a basic "Hello World" application and contains some default files. Run your application. continue to the next lesson (next lesson ).

TIPS:Setplatform-tools/Andtools/Add directoryPATHEnvironment variable.



Android learning route

If java is done, it will be easier for android to learn.
Android BASICS (debugging in the Android development environment, Android Application structure, interface components and interface programming, and four main components)
Android intermediate (file IO and SQLite, graphics, images and animations, audio and video recording for playback, sensor programming, and GPS applications)
Android advanced (Network Programming and Web Service, OpenGL-ES 3D development, integration of Google services, using NDK development, java and c mutual calls)

How to Learn android programming?

1. "android Development Learning Roadmap" (search in Baidu) to learn about ANDORID programming.
2. Search for the "ppy2790 blog" in Baidu, a large number of Android learning materials, Android projects: videos for snake development, Android development for Sina Weibo, and Android client for jet flights
3. Go to the "IT learning resource station" to learn a large amount of IT learning materials, participate in study discussions, and interact with others.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.