[Mobile Development] What Android app developers should know

Source: Internet
Author: User

As a Java-based developer, it is easy to initially learn about Android development. Some of my colleagues are learning java, and I am interested in Android development, I started to learn about it and made a simple and practical small application in less than a month. There may be many people who will ask what are the gaps between Android Developers and those who come in halfway? Here I would like to say that the person who will be an Android app doesn't necessarily mean that he understands Android very well. The reason why the Android system is the mainstream smart phone system in the world is not only open-source, and its own system advantage blog: http://smallwoniu.blog.51cto.com/blog/3911954/1248169) to thoroughly grasp the Android Application Layer Development is not so easy.


Today I have summarized some trivial details in Android development, hoping to help you!


I. ADBAndroid Debug Bridge)

Open the sdk/platform-tools Folder in android, which stores many system tools required during android development.

650) this. length = 650; "src =" http://www.bkjia.com/uploads/allimg/131229/12150C0X-0.jpg "title =" QQ20131105235753.jpg "width =" 398 "height =" 200 "border =" 0 "hspace =" 0 "vspace =" 0 "style =" width: 398px; height: 200px; "alt =" 000004941.jpg"/>

Adb.exe

Introduction: it serves as a bridge for debugging. Through adb, We can debug the Android program through DDMS in Eclipse. To put it bluntly, it is the debug tool. Adb works in a special way. It listens to Socket TCP 5554 and other ports to allow the IDE to communicate with Qemu. By default, adb will use the network port related to daemon, so when we run Eclipse, the adb process will automatically run.

NOTE: With the adb tool, we can manage the status of devices or mobile phone simulators. You can also perform many mobile phone operations, such as installing software, upgrading the system, and running shell commands. In short, adb is a bridge between Android phones and PCs, allowing users to perform comprehensive operations on mobile phones on their computers to obtain mobile phone data)


Common adb commands:

Adb devices lists all connected devices in the left-side window of DDMS)

Reset adb restart debugging Bridge of adb

Adb kill-server kills adb debugging Bridge

Adb start-server start adb debugging Bridge

Adb install helloworld.apk installation command

(After finding the apk, you can drag it directly into the dos window, saving the manual copy path)

Adb uninstall com. zhf. helloworld uninstall command

Adb shell comes to the mobile terminal to execute linux commands

Adb-s emulator-5554 install helloworld.apkInstall on a specified device


Note: The port may be occupied, and netstat-ano and Taobao can be typed in the command line to perform a series of operations on the mobile phone.


II. Differences between Android and Java virtual machines


Differences JVM
Dalvik JVM
Compiled File Format . Java->. class->. jar . Java->. class->. dex->. odex
Compile the program

Javac.exe in JDK

Dex.exe In sdk
Architecture Based on

Stack-based structure

Register-based structure

Note: jar is inefficient, but versatile, and can be played by non-smart phones. APK is an exclusive Installation File for android, which cannot be run on non-android mobile phones and is highly efficient, in general, the apk format is preferred.

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131229/12150BM7-1.jpg "title =" 04.jpg" alt = "003049814.jpg"/>

We can clearly understand the implementation process of the above structure:

. Jar ---> contains many. class files. The javac.exe compilation process internally converts each. java file into a. Class file, including Header, class, Filed, and Method.Attributes and others take a long time to repeat over and over again, and the installation procedure is slow. In Windows, the setup.exe installation process is to decompress the file to the hard drive of the computer.)


. Apk ---> contains only one. dex file. Execute dx. bat internally to upload the Header, class, Filed, MethodAnd Attributes are put together and converted into. dex files, which is highly efficient.


3. Installation Process of android applications

First, let's take a look at the bin folder under the project.

650) this. length = 650; "src =" http://www.bkjia.com/uploads/allimg/131229/12150B201-2.jpg "title =" QQ20131106003926.jpg "width =" 486 "height =" 150 "border =" 0 "hspace =" 0 "vspace =" 0 "style =" width: 486px; height: 150px; "alt =" 004022601.jpg"/>

It contains the last generated apk file, all res resources, and important classes. dex.

650) this. length = 650; "src =" http://www.bkjia.com/uploads/allimg/131229/1215061F6-3.jpg "title =" QQ20131106010032.jpg "width =" 739 "height =" 240 "border =" 0 "hspace =" 0 "vspace =" 0 "style =" width: 739px; height: 240px; "alt =" 010046854.jpg"/>

This figure clearly shows the packaging and installation process of our Android project:

Package: Ghost installation package

Installation: first, sign the application, and then copy the apk to the mobile phone. Second, decompress the apk on the mobile phone.


4. Start the application


We double-click the apk file. If the computer has a pea pod, the app will be automatically associated with the pea pod and hit the mobile phone. Why?

The original cause is that we opened the Notepad program in the Windows double-click. txt file because we registered the file type associated with the application in the registry of the system disk. Then we opened the application on our mobile phone, first, open the Registry file of the Android system:

Open the File e option under DDMS to list all the File information of the mobile phone. The netstats folder under the system directory under the/data directory has two directories.

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131229/12150C2L-4.jpg "title =" QQ20131106005548.jpg "alt =" 005607936.jpg"/>

Packages. xml: the configuration information is written here for every application installed in the registry of the android system.In the future, if you load this program, you will first read the registry and load it To the memory to obtain its data)

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131229/1215061a5-5.jpg "title =" QQ20131106005755.jpg "alt =" 005840516.jpg"/>

Packages. list: the package list of all applications and the directory of corresponding data

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131229/1215063614-6.jpg "title =" QQ20131106005810.jpg "alt =" 005916846.jpg"/>

V. Simulator

After a simulator is started, an application is started. A folder directory is generated under. android/avd in the user directory of drive C.

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131229/1215061552-7.jpg "title =" 09.jpg" alt = "012717598.jpg"/>


All of the above are things you should know as an Android app developer, because I am also learning Android and learning and summarizing it. please correct me for any omissions or errors. Thank you!


This article from the "crazy Snail" blog, please be sure to keep this source http://smallwoniu.blog.51cto.com/3911954/1320635

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.