Android uses custom framework to develop applications

Source: Internet
Author: User

As a representative of the open-source mobile operating system, Android has been updated to version 4.0.3. Thanks to its open-source features, the operating system has the maximum flexibility, but at the same time, it also leads to the diversity of versions. All the products on the market are mobile phone manufacturers or ROM production fans who have modified the system. But how to develop the android framework layer, we know that android applications can be developed using eclipse + ADT. Use a mobile phone or simulator to debug the corresponding effect.

This is a standard application development process, but when developing a custom APK for a custom Rom, you often face the use of the modified framework, the most common scenario is to develop the @ hide interface in the framework or add a new custom interface. We know that using this interface will directly report errors in eclipse, and compilation is not allowed, let alone code tracking and debugging. In fact, you can use the. Class compiled by the corresponding Java file to put it into the eclips lib reference library and increase the call priority. This barrier can be used for application development. The order is as follows:

In the build path of the project, select the corresponding class folder in addexternal class folder. class folder path. Do not forget to add the called class to the system framework in order. before jar, you can complete related compilation. And can run normally on the mobile phone. However, you need to pay attention to the need for mobile phone system support to use custom framework-related interfaces.
That is, the corresponding ROM can be normally called only when the corresponding mobile phone has a corresponding Rom. The related. Class file is the intermediate code under the corresponding package (Out \ target \ common \ OBJ \) during system source code compilation. You need to search the corresponding directory based on the source code location of the interface. If you don't want to be so troublesome, you can directly replace the entire framework code !, Directory is out \ target \ common \ OBJ \ java_libraries \ framework_intermediates, there is a classes-full-debug.jar in the following, This is the uncompressed jar package, there are some fraemwork source code generated. Class file.

1. In the project you need:

Click build path and add libraries:

Select User library and click Next:

Click User libraries:

Click New:

In the new user library dialog box, enter a name that can be named by yourself. Here, the name is myframework. Select system library and click OK. class file, directly use the method of the new Framework interface.

 

 

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.