Android first Night first app

Source: Internet
Author: User
Tags naming convention

Vamei Source: Http://www.cnblogs.com/vamei Welcome reprint, Please also keep this statement. Thank you!

To undertake the "Java Quick Tutorial", I will start writing Android related articles.

The Java language is used primarily for Android development. The Java Language Foundation is the first threshold for Android development. Furthermore, a good Android app often works with a remote server. In both respects, you can refer to the Java language and the play framework in the Java Quick Tutorial. Android Development also requires collaboration with other technologies, including operating systems, the Internet, graphical interfaces, databases, and more. It can be said that mobile development is a reality of the battlefield, the usual practice of the various skills will come in handy.

In essence, mobile platforms and traditional PC platforms are not fundamentally different. Both build an operating system on the hardware platform and then run the application on the operating system. Many of the concepts of mobile platforms also originate from PC platforms, such as the kernel (kernel), process, and event response. But the mobile platform has its own characteristics, one is the performance is weaker than the PC, the second is the limited power. Mobile platforms have to be optimized in both areas. We will see later that many of the new designs and concepts of the Android system are addressing both of these issues. However, even the proprietary new concepts of these mobile platforms can be used to find their shadow in traditional technologies.

Mobile development is quite interesting. I feel a great sense of accomplishment when I see my code running on a small device. An open system like Android also takes over a fun hardware platform like Google Glass. Of course, the mobile development time is relatively short, so the relevant technology is often updated, so we must study hard to keep up with the trend. However, given the great success of the mobile side and the huge untapped potential of the mobile side, the skills of mobile developers are worth "getting Started". The history of Android, which shows the history and lace of Android.

The best information for Android development is Google's documentation. I will move forward in this series of articles in a more gradual manner and continue to introduce the basic knowledge needed for development. Most of these basics come from my previous articles.

Development Environment

Before we start development, try using the command at the command line:

Javac

If the terminal prompts you not to find the command, you need to install the JDK(Java development Kit). The JDK compiles Java code, so it is necessary for Android to develop it. If the JDK is missing, you can download and install it on Oracle's website. Under the Linux system, you can also install OPENJDK in the store.

The next step is to install ADT, which includes the Eclipse editor and the Android SDK. Eclipse can support Java development very well. We'll write code, compile, run, and debug under Eclipse. Download Android Developer Tools(ADT), and install. ADT has versions of Mac, Linux, and Windows.

    • Under Linux, unzip, under the Eclipse folder, run the executable eclipse, and it will start. You can put the Eclipse folder in the path search route for later use.
    • Under Mac, use the Finder to find eclipse in the Eclipse folder and click to run. You can drag the eclipse into the application for later use.
    • Under Windows, download the. exe Setup program and install it.

If you already have eclipse and are familiar with the configuration of the Eclipse plugin, you can download only the Android SDK and import it in Eclipse.

Build your first app

Start ADT, set the work space path, which is the working path of Eclipse.

After entering eclipse, click New Android application to create a new app. You can also follow:

File--New--Android application Project

To create a new app.

Fill in the app name, i.e. HelloWorld. Change the package name to Me.vamei.helloworld (vamei.me is my domain name, but not always) according to the Java Packages naming convention. And then all the way next, until finish.

After we created the new app, we went to eclipse's main interface:

All files under the HelloWorld app can be browsed in the package explorer on the left. Once clicked, the contents of the file will be opened in the editor's main screen on the right.

run the first app

We can control the installation and operation of the application in ADT.

Run as--Android application

Since we have not yet registered other Android devices, Android will automatically run the simulator (emulator). The simulator divides compute and storage resources from your computer and generates a virtual Android device. The HelloWorld app will be installed in the emulator. You can monitor the entire process in the lower-right corner of the Console .

Friendly reminder: Android comes with the virtual device is indeed very convenient, but really is too slow. Time is enough to grind a cup of coffee now.

Other equipment

Because Android comes with a virtual machine that is too slow, you can connect your Android device with USB. Most Android devices can be automatically identified. When you click Run , a window to select a device pops up.

I recently heard a friend say that the genymotion virtual device is very fast. It is based on the VirtualBox. Install VirtualBox and genymotion, and then add the devices in Genymotion. The virtual machine will also appear in the window of the selected device. It's much faster than the virtual device that comes with Android.

I personally tried it, the speed is really good.

Summary

Create a new app

Run the App

Please continue reading " Java Quick Tutorials series Articles

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.