. NET code agronomy Android---system architecture and basic concepts

Source: Internet
Author: User

Original:. NET code agronomy Android---system architecture and basic concepts

At this point, you should have completed the following preparatory tasks:

1. After installing the JDK

2. Install the SDK (and update the relevant version in the manager)

3. Associated IDE (e.g. Eclipse)

4. After installing ADT

5. Install the AVD (you can not install it if you are a real-computer simulation)

Pre-construction of the environment to complete the basic, and follow the online tutorial can run out of the HelloWorld, to ensure that the process can go through.

The so-called when the Ling, at a glance the mountains small. I always learn new things from a systematic or global perspective on it, so as to grasp it from a higher point of view, and you will have a systematic understanding of the next study will make later learning more organized and targeted.

A. The next step is to introduce the basic system architecture of Android.

At the very least, the application layer, which is responsible for direct and user interaction, is the most commonly seen, downloadable app, browser, game, music player, and so on.

This is followed by the application's framework layer, which is often called when we develop the application, such as Activitymanager,viewsystem and so on, and the meeting will be introduced.

Then this is the JVM layer of the operating mechanism, and you can see that it contains not only a runtime, but also some related class libraries.

The lowest tier is a Linux-based kernel that contains some hardware drivers that are primarily responsible for interacting with the hardware, such as the ability to call a camera in your app, a WiFi interface, and so on.

two. Engineering organization and structure

Next we right-click New a androidapplication project, if not found in the new option in the bottom others in the following:

All the way next, built as follows:

three. Let's see what the folders are all about, you know?

SRC: Storing your source code, such as a. java file, can be understood as a class library. cs file in vs.

Gen: System-generated things, do not change, expand as follows:, here the R files are often used, which are stored in some similar to the registration of the global ID(described later).

Googleapis: That's the Google interface to some of the SDKs.

Androidprivatelibarares: Some class libraries for Android.

Androiddependencies: Some of Android's dependent libraries.

Assets: Store your project "big" resource files, compared to film, video, media, etc., so-called "big" only because there is a resource folder in the Android project Res mainly store some fonts, text, colors, etc. "small" resources.

Bin: That's needless to say.

Libs: DLL references similar to vs.

Res: The main storage of some fonts, text, color, etc. "small" resources. Expand as follows:

The main use of layout and values, (others may also be used in large numbers, but they are still groping)

Layout: Used to store layouts files

Values: Used to store text, color, etc, KV value (here is a point to note, in Android development, in order to maintain the flexibility of the project and avoid hard coding , it will recommend you to use the KV value into a file, where used to direct reference, That's why you have the values folder .

Androidmanifest.xml: This file is very important and is a list of related configurations that are used to store the entire program, such as project name, version number, activation activity, permission description, and so on.

three. After understanding the engineering structure, we will understand several basic concepts.

Because I used to learn Java in school (although it has been forgotten almost), so I still have some foundation, some basic grammar and use of some understanding, if you know nothing about Java, I suggest you spend one or two hours to see the basic syntax, such as how to inherit, how to implement the interface, Believe me, as a C # programmer, you may need only 10 minutes to get it done, because you'll find out how strikingly similar it is to C #!

Okay, here we go!

As a beginner to the mystery of mobile app development, I just want to know how I should get started, how it was implemented and displayed on the phone.

We open the Layout folder in the Activity_main.xml, see it, is not familiar (Control + layout + code)

This is the start page of the program, similar to the main method, is the portal, of course, you can also set the other entry page yourself.

Several concepts:

1.Activity: This is the most commonly used concept, you can understand it as the current activity of the screen, is to render a page on the phone, Lenovo Web page.

This is the life cycle of activity.

Activity's visual life cycle starts at OnStart () until the end of OnStop () (may not be visible, but resources are retained)

The activity's foreground life cycle starts at OnStart () until OnStop () ends (at the front and the user interacts)

2. Package Name: "Package name" in Java is similar to the namespace in our C #, a "package" is a DLL reference file. But I think one of the things in eclipse is that you don't need to import a method or class without the top imports. It seems to help you do it automatically, and the VS seems to knock.

In Java to ensure that the package name is unique , it is generally used to name the company domain name, such as Com.letchoice.HelloWorld.

Three. Several shortcut keys and related settings

1. Format code: CTRL+SHIFT+F (with the code of cleanliness students preferred)

2. There may be some problems when you format an XML document, as set out below

3. For you accustomed to VS, you may have adapted to the smart hint function of VS, which may be done without vs good in eclipse, you can only enter "." After that, you can window->preference open the settings panel if you want to prompt and complete the code as you would in VS

Will identify the place where the "." Change to "abcdefghijklmnopqrstuvwxyz." Save is OK.

The 4.XML code hints and completion features are set as follows:

The image will be changed to "<=:[email protected]".

Their own Android development and the use of Java are still in the groping, inevitably there are omissions and errors, but also hope that we have a lot of criticism, and you mutual encouragement!

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.