The JAR file D:/..../android.jar has no source attachment

部分转自:http://blog.csdn.net/gogler/article/details/7235833,源码下载部分更新了,特别是老版的google没有提供Sources for Android SDK下载

问题:

问题:

 

 

解决

       1、下载android源码,下载地址:

在最新的SDK中,Android SDK Manager已经可以直接下载Sources for Android SDK,并且源码存放的位置在

$ANDROID_SDK_HOME/sources/android-X/这个路径下面。然后在Eclipse中关联就可以。

另外还有一种就是zip包形式的
在$ANDROID_SDK_HOME/platform/android-X/source.properties这个文件中有一个类似https://dl-ssl.google.com/android/repository/repository-5.xml
这样的路径,打开它,里面搜索’sources’字样,会找到sources-14_r01.zip和sources-15_r01.zip

也就是zip包源码的下载地址
(Android 4.0.1) https://dl-ssl.google.com/android/repository/sources-14_r01.zip
(Android 4.0.3) https://dl-ssl.google.com/android/repository/sources-15_r01.zip

但是Google提供的sources-14源码当中还是有些Mock代码,所以建议还是去下载第三方打包的,比较全一点。

老版的打包好的源码还是可以前往http://rgruet.free.fr/public/下载


       2、将android源码发到如下位置:

 

            3、配置eclipse:

      

           4、查看API内容,比如Service.class的原定义如下:

[html]  view plain copy print ?
  1. /*  
  2.  * Copyright (C) 2006 The Android Open Source Project  
  3.  *  
  4.  * Licensed under the Apache License, Version 2.0 (the "License");  
  5.  * you may not use this file except in compliance with the License.  
  6.  * You may obtain a copy of the License at  
  7.  *  
  8.  *      http://www.apache.org/licenses/LICENSE-2.0  
  9.  *  
  10.  * Unless required by applicable law or agreed to in writing, software  
  11.  * distributed under the License is distributed on an "AS IS" BASIS,  
  12.  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  
  13.  * See the License for the specific language governing permissions and  
  14.  * limitations under the License.  
  15.  */  
  16.   
  17. package android.app;  
  18.   
  19. import android.content.ComponentCallbacks2;  
  20. import android.content.ComponentName;  
  21. import android.content.Intent;  
  22. import android.content.ContextWrapper;  
  23. import android.content.Context;  
  24. import android.content.res.Configuration;  
  25. import android.os.Build;  
  26. import android.os.RemoteException;  
  27. import android.os.IBinder;  

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值