Ubuntu10.04 compile Android2.1 source code

Source: Internet
Author: User
Java.net provides networking-related classes, including streaming and data packet sockets, Internet protocols, and common HTTP processing. This package is a multi-function network resource. Experienced Java developers can immediately use this familiar package to create applications. Although java. io does not provide explicit networking functions, it is still very important. The classes in this package are used by sockets and connections provided by other Java packages. They are also used to interact with local files (when interacting with the network

Java.net provides networking-related classes, including streaming and data packet sockets, Internet protocols, and common HTTP processing. This package is a multi-function network resource. Experienced Java developers can immediately use this familiar package to create applications.

Although java. io does not provide explicit networking functions, it is still very important. The classes in this package are used by sockets and connections provided by other Java packages. They are also used for interaction with local files that often occur when interacting with the network.

Java. nio contains a class that represents a buffer of a specific data type. It is suitable for communication between two Java-based endpoints.

Org. apache. * indicates many packages that provide precise control and functionality for HTTP Communication. Apache can be regarded as a popular open-source Web server.

In addition to the core java.net. * class, Android.net contains additional network access sockets. This package includes the URI class, which is frequently used for Android application development, not just traditional networking.

Android.net. http Contains classes for processing SSL certificates.

Android.net. wifi includes classes for managing all aspects of WiFi (802.11 Wireless Ethernet) on the Android platform. Not all devices are equipped with WiFi, especially Android has been successful in the "flip mobile phone" Field of mobile phone manufacturers such as Motorola and LG.

Android. telephony. gsm Contains classes for managing and sending SMS (text) messages. After a while, www.linuxidc.com may introduce additional packages to provide similar functions for non-GSM networks, such as CDMA or android. telephony. cdma.

The following describes how to compile the Android source code in Ubuntu 10.04.

According to the official document, the source code must be compiled using JDK 5, so we use JDK 5 here. After downloading the jdk1.5.0 _ 22. binfile, first change the File Permission to chmod u + x jdk1.5.0 _ 22.bin, and then run [sudo./jdk1.5.0 _ 22.bin. Set environment variables after installation

Run sudo gedit/etc/profile

Set environment variables in this file

# Set java environment

JAVA_HOME =/home/stone/jdk1.5.0 _ 22

Export JRE_HOME =/home/stone/jdk1.5.0 _ 22/jre

Export CLASSPATH = $ JAVA_HOME/lib: $ JRE_HOME/lib: $ CLASSPATH

Export PATH = $ JAVA_HOME/bin: $ JRE_HOME/bin: $ PATH

It is best to set this part of code at the end of the file.

Set and save. Restart the system.

In this case, you can see the effect of the change in java-version.

Then run the make command in the directory of the downloaded source code file. An error occurs. Therefore, before compilation, install the relevant software. The software to be installed includes:

1. sudo apt-get install build-essential

2. sudo apt-get install zlib1g-dev

3. sudo apt-get install flex

4. sudo apt-get install libncurses-dev

5. sudo apt-get install libx11-dev

6. sudo apt-get install gperf.

Execute the installation of these software and then make the compilation.

In this case, wait for the compilation result.

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.