Android中使用隐藏API图文解析

news/2024/7/4 8:20:51
Android SDK的很多API是隐藏的,我无法直接使用。但是我们通过编译Android系统源码可以得到完整的API。
编译Android系统源码后可以在out\target\common\obj\JAVA_LIBRARIES目录可以看到它的所有API。
当然对于一般情况,out\target\common\obj\JAVA_LIBRARIES\framework_intermediates\classes.jar对于我们来说就足够了。
如果你还不知道如何下载Android源码,请参照《如何下载Android源码(window和Linux)
如果你想提取Android所有的API,请参照《如何得到包含隐藏API的Android类库
我们可以通过2种方式把这个classes.jar文件加入到你的Eclipse环境的Android工程中。
方式一
首先classes.jar文件拷贝到Android工程中的lib目录下;接着在Eclipse中把classes.jar文件加入到build path中,如图1-1所示。
图1-1

 
最后在Eclipse中的Project->Properties的"java build path"->"Order and Export"中调整classes.jar的顺序,让它为位于Android SDK之前,如图1-2所示。
图1-2

 
方式二
首先在Eclipse中的Project->Properties的"java build path"->“Libraries”中点击“ add Library...”,弹出如图2-1的对话框。
图2-1

 
接着在对话框中选中“User Library”,点击"next"按钮进入下一步,如图2-2所示。
图2-2

 
 
再接着在图2-2所示的对话框中点击“User Library”,进入如图2-3所示的对话框中。
图2-3

 
 
再接着在如图2-3所示的对话框中点击new,出现如图2-4的对话框。
图2-4

 
紧接着如图2-4的对话框中,输入User Library的名字(这里输入的是Android_debuglibs),并选中"System library(add to the boot class path)",点击“ok”按钮,如图2-5所示。
图2-5

 
如图2-5所示的对话框中,选中刚刚建立的User Library(Android_debuglibs),通过点击“add JARS”,把我们的classes.jar文件添加到刚刚建立User Library(Android_debuglibs)中,如图2-6所示。
图2-6
 
然后在如图2-6所示的对话框中点击"ok",出现如图2-7所示的对话框,
图2-7

 
然后如图2-7所示的对话框中点击"finish",出现如图2-8所示的对话框。
图2-8

 
再然后如图2-8所示的对话框中的"Order and Export"中调整Android_debuglibs的顺序,让它为位于Android SDK之前,如图2-9所示。
图2-9


 
最后点击图2-9所示的对话框中点击"ok"按钮就结束了。

转自:http://blog.csdn.net/hudashi/article/details/8184442


http://www.niftyadmin.cn/n/3649261.html

相关文章

QTP测试框架之_报表

QTP测试框架之_报表 作者:Wally Yu (微博:http://weibo.com/quicktest) 自己在开发QTP测试框架的时候一些对于报表的经验: Excel报表: 下载Report Manager:http://www.advancedqtp.com/knowl ... ut-reportermanager/ 修改…

git克隆github_如何使用Git和Github分叉,克隆和推送更改

git克隆github介绍 (Introduction) Github is an excellent resource for finding useful code. In order to contribute changes back to a project, you’ll need to make a local copy and then upload your changes. In this tutorial, you’ll fork and clone an existing…

LBS模块架构的封装

对地图进行一个封装 public interface ILbsLayer {/*** 获取地图*/View getMapView();/*** 设置位置变化监听*/void setLocationChangeListener(CommonLocationChangeListener locationChangeListener);/*** 设置定位图标*/void setLocationRes(int res);/*** 添加&#xf…

[收藏]张翼轸:在Outlook的名义下

张翼轸:在Outlook的名义下 -------------------------------------------------------------------------------- http://www.sina.com.cn 2005年03月08日 14:48 ChinaByte   文/张翼轸Plaxo、Teleo、Skype这几个不同的SNS(Social Network Software,…

如何构建和安装Go程序

介绍 (Introduction) So far in our How To Code in Go series, you have used the command go run to automatically compile your source code and run the resulting executable. Although this command is useful for testing your code on the command line, distributing…

如何得到包含隐藏API的Android类库

Android SDK的很多API是隐藏的,我无法直接使用。但是我们通过编译Android系统源码可以得到完整的API库。编译Android系统源码后可以在out\target\common\obj\JAVA_LIBRARIES目录中有它所有API库(java)。当然对于一般情况,out\target\common\obj\JAVA_LIB…

ISO9001:2000和能力成熟度模型的集成

ISO9001:2000和能力成熟度模型的集成 ISO9001:2000and the Capability Maturity ModelIntegration 原作者: Angela Tuffley and Terence P.Rout Software Quality Institute, Griffith University; Mark Stone-Tolcher and Ian Gray, Defence Materiel Organisati…

[收藏]用社会网络分析改进知识的创新与共享

用社会网络分析 (Social Network Analysis ; SNA) 改进知识的创新与共享 作者: Rob Cross,Andrew Parker , Steve Borgatti 摘要一个人获得知识的环境,就是人际关系经常影响一个人获取知识的管道。社会网路分析(Social Network An…