How to download and associate Android source code in Eclipse

Source: Internet
Author: User

1. Download the Android source code

Android source code can be downloaded from 4.0 using SDK Manager. Open SDK Manager and you can see that 4.4 has been used as an example:


But it always prompts that the download fails and the connection times out. It is estimated that https is a ghost. <喎?http: www.bkjia.com kf ware vc " target="_blank" class="keylink"> VcD4KPHA + pgltzybzcm9 "http://www.2cto.com/uploadfile/Collfiles/20140304/20140304081201261.jpg" alt = "\">

By viewing the Fetch action at the beginning of the Android SDK Manager Log window, all the files opened manually in the browser:


Open this file and you will find the following content:

 
  
   1.1
  
  
   2
  
  
   1
  
  
   Android SDK Platform 1.1_r1
  
  
   http://developer.android.com/sdk/android-1.1.html
  
  
 

...

 
  
  
   2
  
  
   19
  
  
   
    
     21819439
    
    
     433a1d043ef77561571250e94cb7a0ef24a202e7
    
    
     sources-19_r02.zip
    
   
  
  
 

It can be seen that the SDK Manager parses the file during download and downloads the file based on the user's choice.

Find Android API 19 and you can see one of them:

 
  sources-19_r02.zip
 
It is estimated that this file is used. You can view the log and find that all the files are retrieved in logs.

2. Associate Android source code

Open Eclipse and create an Android project at will. In this project directory, there is an Android 4.4, and the android. jar is displayed after you click expand. Right-click this package ----> Properties. In the pop-up window, select Java Source Attachment ------> External Location ------> External File. Then select the downloaded source-19_r02.zip File to bind the Android Source code to Eclipse.

1. Right-click android. jar


2.select the location of source-19_r02.zip


3. ctl + left mouse button jump to source code

To view the source code, you can jump to the source code by using the ctl + left mouse button. Take Activity as an example:


After the operation, you will jump to the source code section:



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.