C # programmers learn how to build a development environment for the Android development series,

Source: Internet
Author: User
Tags android sdk manager

C # programmers learn how to build a development environment for the Android development series,

I have been in touch with Android for a long time. I remember that when I first came to the Chinese mainland in, I learned that google has an Android operating system, which is a smart machine operating system. Later, after Android 1.5 was released, I first downloaded the eclipse development tools, adt, and android sdk to experience android development. I remember it was quite troublesome to build a development environment. Because android development is based on Java, in addition to the above tools, jdk needs to be installed first. Remember that jdk 1.6 was popular at that time (later 1.7, now 1.8, and later ), after installation, you must set environment variables.

After four years, I learned about Android again. I hope that this time I will be able to systematically master Android development. Let's start with setting up the development environment.

My laptop system environment:

1. win8.1 64-bit Enterprise Operating System

2. 6 GB memory

1. Install JDK (corresponding to. NET Framework)

I believe you are familiar with environment variable configuration. Here we will briefly introduce it. First, open the environment variable settings page: Right-click my computer-properties-advanced system settings-advanced (Tab) -Environment Variable-New (system variable ).

As I have already edited it, here are some illustrations.


Then add % Java_Home % (separated by;) to the variable values under Path, and % Android_Home % is the same.


Verify whether the setting is successful. Enter the shortcut key (windows + r), open the running window, Enter cmd, and press Enter.

Run the java-version command to check the jdk version installed on the local machine. (pay attention to the 32-bit and 64-bit versions. If your system is 64-bit, install the 64-bit jdk ).


Ii. Download and install Android development tools

I remember that it was quite troublesome to install Android in 10 years, because eclipse, adt, and android sdks were downloaded and installed separately, and then configured in eclipse to associate the adt and android sdks. I don't know when to start (I haven't paid attention to it for years, but I 've been paying attention to it for years.. NET). google integrates these tools. You only need to download the Integrated Installation Package on the official website. After downloading the tool, decompress the package directly (pure green version, no installation required ), eclipse and adt are both ready-made and ready for use. This greatly facilitates Android Developers.

Http://developer.android.com official website often cannot open (may be gun), readers can flip the wall or directly search for the corresponding development kit.

3. Install the sdk

Go to eclipse and click the Android SDK manager button to open the installer interface. Select the version of the sdk to be installed and other content.

Note that the hosts file cannot be updated by default. You need to modify the hosts file (in the C: \ Windows \ System32 \ drivers \ etc directory, copy it out, add content at the end of the text and overwrite the original file ).

74.125.113.121 developer.android.com 203.208.46.146 dl.google.com 203.208.46.146 dl-ssl.google.com

In this way, restart eclipse, open android sdk manager, and select the corresponding content to update it online.

Open Tools-Options-Others Force https: //... sources to be fetched using http: //...



Do not forget to install the System Image (Android simulator). We recommend that you check and install all its sub-items when installing an sdk of a certain version.


After the above steps, you can test whether you can run Android.

We directly create an Android Application Project, set the name, parameters, and so on, and create an avd (android virtual device) for testing.


Then we run the test project (by default, no code is written ). After some waiting (slow startup), the simulator was finally started and the test project was successfully run.


Because the dpi I set for avd is relatively high, you can see a large blank screen, "hello world" seems relatively small.

Note: In addition to eclipse, the development tool also has a relatively new android studio. You can also choose an appropriate ide.



C language ^ how to use

A1 = 0x01; // 0000 0001
A2 = 0x00; // 0000 0000
A3 = 0x03; // 0000 0011
A4 = 0x02; // 0000 0010

B1 = a1 ^ a2; // 0000 0001
B2 = a1 ^ a3; // 0000 0010
B3 = a1 ^ a4; // 0000 0011

^ XOR operator. The bitwise value is 0 and the difference is 1. See the example above.

//
Examples of simple and practical problems:
====================================
======= A ======= B =========
There are two circuits on the top. The two switches are a and B respectively. The opening status is \ [1], and the closing status is/[0].
If both circuits are enabled or disabled.
If a turns on [1], B turns off [0], and circuit 1 Powers on
=====================
If a disables [0], B enables [1], and circuit 2 powers on.
====================================
In summary, the circuit fails in the and B states simultaneously [0]. When a and B are different, the power is charged [1].

C language ^ how to use

A1 = 0x01; // 0000 0001
A2 = 0x00; // 0000 0000
A3 = 0x03; // 0000 0011
A4 = 0x02; // 0000 0010

B1 = a1 ^ a2; // 0000 0001
B2 = a1 ^ a3; // 0000 0010
B3 = a1 ^ a4; // 0000 0011

^ XOR operator. The bitwise value is 0 and the difference is 1. See the example above.

//
Examples of simple and practical problems:
====================================
======= A ======= B =========
There are two circuits on the top. The two switches are a and B respectively. The opening status is \ [1], and the closing status is/[0].
If both circuits are enabled or disabled.
If a turns on [1], B turns off [0], and circuit 1 Powers on
=====================
If a disables [0], B enables [1], and circuit 2 powers on.
====================================
In summary, the circuit fails in the and B states simultaneously [0]. When a and B are different, the power is charged [1].

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.