I want to download source code for android core apps like Settings.I have following doubts
1开发者_如何学编程)How can i download entire project of core apps for Android 2.2
2)Android.jar in sdk does not have API for core applications.So how to set up Eclipse to do this
3)How to test it in emmulator
In my experimentation with the source change, I had to build up (make) the whole downloaded source code to get a new emulator image to see the changes I had made.
You can download the source from The Android Open Source Project with git. In /packages/apps/ there are all the core apps, including Settings, Calendar, Browser, etc. Instructions on downloading the source are all on that site.
If you lift the source for one of those apps, you might be able to replace the old version on a running emulator. If there is some protection against that (I know they are treated differently, don't show up with the rest of the apps, etc.) you can build the OS from source (also described on that website).
1) For example, use following commands to download Calculator application for FROYO , I am assuming you have set up your environment including repo and git tool.
repo init -u git://android.git.kernel.org/platform/manifest.git -b froyo
git clone git://android.git.kernel.org/platform/packages/apps/Calculator.git -b froyo
Note:: (can be any other app too , just you need to change the Calculator.git to *.git)
2) I am not sure which Android.jar you are talking about, but I can suggest , update your sdk manger then download 2.2 Froyo API 8 using sdk manager. If you have not installed ADT plugin in eclipse yet , then follow steps described below ..
a. download ADT12 from http://developer.android.com/sdk/tools-notes.html
b. Install that plugin from Help -- > Install new Softwares in Eclipse
c. Restart eclipse , you will see an extra option Android under Window --> Preference
Select the Android option and mention the sdk folder location where you are keeping
sdk. Now you are ready to create an Android App Project from context menu or File
new menu option.
3) You can create emulator from "Window" --> " Android sdk and AVD Manager " option in Eclipse, then run it. Now you can run your newly created Android app , say TestApp, on this emulator. Even eclipse will automatically run the emulator for you.
精彩评论