Android Development Environment Building (for driver developers)

Source: Internet
Author: User
Tags gtk

Introduction, Android-driven development process

1: Write Linux Drive

2: Write Linux application test program

3: Write JNI interface, used to wrap the second-step write application

(to be compiled with the NDK)

Generates a. So file, equivalent to the DLL under CE

4: Write a Java program, specifically write a class containing. So file, and then call the. So function in Java.

example, you can see the NDK inside the sample folder, there are some examples

Second, the need to install the environment

Compiling Android's Linux cross-compilation tool

Compiling a Linux-driven cross-compilation tool (4.3.1)

Compiling JNI Toolkit: NDK (under Linux)

Compiling Java programs: ESCLIPS+ADT+SDK

Third, NDK installation

1. Download the NDK package:

Http://dl.google.com/android/ndk/android-ndk-r4b-linux-x86.zip

2. Extract to/home/workspace/directory

3. Edit Environment variables

sudo gedit/etc/profile

Join in the last line

#set NDK Env

ndkroot=/home/workspace/android-ndk-r4b

Export path= $NDKROOT: $PATH

Update modifications

Source/etc/profile

At this point, the system is able to identify the Ndk-build command.

4. Compiling examples

Enter the Sampleshello-jni directory, compile

CD Samples/hello-jni

[Email protected]:/home/workspace/android-ndk-r4b/samples/hello-jni$ ndk-build

will be able to see the compilation information, if the compilation is successful, the directory will generate more than 2 subdirectories libs,obj directory

Iv. Installation of JDK

To the Sun official website download JDK6, select JDK 6 Update 20

Download page address: http://www.oracle.com/technetwork/java/javase/downloads/index.html

IncludePicture "Http://www.buddyinfo.com.cn/images/Android/android2.jpg"/* mergeformatinet INCLUDEPICTURE "/http/ Www.buddyinfo.com.cn/images/Android/android2.jpg "/* mergeformatinet includepicture" http://www.buddyinfo.com.cn/ Images/android/android2.jpg "/* mergeformatinet includepicture" Http://www.buddyinfo.com.cn/images/Android/ Android2.jpg "/* mergeformatinet includepicture" http://www.buddyinfo.com.cn/images/Android/android2.jpg "/* Mergeformatinet

When you're done downloading, double-click to install

Install successfully, enter java–version under CMD, there will be Java version information.

C:/users/aulyp>java-version

Java Version "1.6.0_21"

Java (TM) SE Runtime Environment (build 1.6.0_21-b07)

Java HotSpot (TM) Client VMs (build 17.0-b17, mixed mode, sharing)

Five, esclips installation

Linux:

Official Download: http://www.eclipse.org/downloads/

Download the latest version of Ecplise for Java EE to the Eclipse official website

I chose to download the Eclipse-java-helios-sr1-linux-gtk.tar

Extract to specified directory:/opt

[Email protected]:/opt$ sudo tar zxvf eclipse-java-helios-sr1-linux-gtk.tar.gz

Get the Eclipse folder

Create a startup icon on the desktop;

On the desktop (right-click Desktop, create Launcher), and then select

Name: Eclipse

Command: Eclipse (click Browse to go to select)

Icon:/opt/eclipse/icon.xpm (Ubuntu 10.04 has an icon, click, select Path)

Get an icon on the desktop so you can double-click the icon to open eclipse.

Windows

After the download, the direct decompression, you can run.

Vi. Installing and Configuring ADT

Installing and configuring ADT

Adt=android Develop Tools.

(1) Start the Ecplise.exe in the Ecplise directory after the installation (decompression), start the Eclips

(2) Click on the Menu "Help", "Install New Software"

(3) Select the following address: http://dl-ssl.google.com/android/eclipse/then click "OK"

(4) Select Developer Tools for the installation of ADT (Android development tools).

(5) Ecplise This will automatically download from the added address and install ADT, wait a while, after installation, prompted to restart the ecplise, click "OK" restart Ecplise

If there is an error, please change HTTPS to HTTP, that is, to change the protocol address to install.

In the next dialog box, select all the options under all name. Then follow the instructions to complete the installation process.

The final step, associating the Android SDK with Eclipse

Open the menu windows,referces,android. Click "Browse" to select the installation path for the Android SDK. Click OK.

Detect if the installation is correct:

Menu File,new,project, the Androidproject option appears. Indicates that the installation configuration was successful.

Vii. installation of the SDK

Download Android SDK 2.1

Official: http://developer.android.com/sdk/index.html

However, if you do not use the agent, is not on the official website, you can directly download the following address

R07:http://dl.google.com/android/android-sdk_r07-windows.zip

R04:http://dl.google.com/android/android-sdk_r04-windows.zip

Unzip in a certain directory.

After restarting the ecplise, click the menu "window", "Preference", open the Configuration window, select Android on the left, enter the path of the Android SDK on the right, click "OK", the environment configuration is complete.

When you create a new project, you will be able to find the SDK for Android, such as

To learn the embedded, or recommend a development Board (as the experimental field), so that learning will be faster!

Recommended use of the famous Open source project: Raspberry Pi 3 Card computer, Introduction to see here

Http://www.superpi.org/chanpin/superpi3/superpi3.htm

Reprinted from:http://blog.csdn.net/ok138ok/article/details/6321171

Android Development Environment Building (for driver developers)

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.