Separate the system app from the Android source code to develop as a common app

Source: Internet
Author: User

Personal Suggestions first follow the ide/eclipse of the Android source code in the format of XML and import into your compiled eclipse, if you compiled Android source code is more than 2.3 version, it is recommended to use more than JDK6, remind you that new Androidproject is not Java project.
at this time you import want to deskclock, camera, etc. did not call to hide label items, these items will not be error, you can directly make corresponding changes or research, hehe, if the corresponding directly in the eclipse or mobile phone running, May prompt you the digital signature is not correct, this you change the entire project name to rewrite a digital signature, and the more ruthless is whether the phone or the simulator you directly hit the root authority, the original app deleted, and then run your compiled source code. If it involves the hide tag, such as setting,Launcher2 and other items, see How to do this:

Below take Launcher2 as an example, explain in detail:


1. Import the Launcher2 project into eclipse.

At this time Launcher2 project has been imported into eclipse, but there will be 158 errors (hehe, compiled 2.3.3 is so much, anyway, other versions should be more than 100, not much).


2. Add the package file used by the Launcher2.

Because in the Android source code, many methods, members, classes, packages are labeled @hide, these members are not exposed in the SDK, so that when compiling launcher source code, the most commonly encountered class Android.view.View members mscrollx inaccessible. So the first thing to do is to download the Android code and compile it, because you need to use some compiled Class.jar files.

Here we use: (The path of the generated package is out/target/common/obj/java_libraries)
1) Framework_intermediates/classes.jar: This is primarily the Android framework class
2) Android-common_intermediates/classes.jar: This class contains the Com.android.common.Search
3) Core_intermediates/classes.jar: This package contains dalvik.system.VMRuntime this class

These are the packages that need to be imported into the project, which can be added by configuring the project's build path .
Right-click the project name and choose Build path->configure build Path...->libraries->add library->user Library->user Libraries...->new ...
then the above 3 dependent packages are added to each other, named Android_framework,android_common,android_core.
after adding 3 packages, you will need toput them in front of the android2.3.3 package., you can select order and Export in the build path configuration
This time you will find the Launcher2 project and no errors, can also be compiled.



3. Modify the Launcher2 package name to run the changed Launcher2 on the emulator.

To get rid of the original package name, remember to use Eclipse's renaming mechanism (F2 can be modified on the package name), not only the class reference, but also many internal references to the XML file (such as import COM.ANDROID.LAUNCHER3.R;), as long as the renaming is good, These can all be done at once.

New name fill in your own package name, the following four items are all checked. Click "Preview"

Special Note: Your project is best not to put in the Chinese path, or rename will be wrong, I started to put in the Chinese path error took a long time to find the error!



4.androidmanifest.xml file inside, find this sentence removed. (android:shareduserid= "android.uid.shared")

So that's it, I did the experiment with 2.3 launcher, and it worked.




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.