APK share: Android App replacement skin function implementation Ideas Tutorial.

Source: Internet
Author: User

The development of Android is really fast, there are many new things every year, it is unlikely to want to cover all the new things, I am here to talk about major Android major new technology development, actually understand the development trend of Android, may be more helpful to developers.

Development Tools

    1. Android Studio: Google officially abandons Eclipse and Android studio popularity. As although not new, but the Android Studio this software update speed is amazing, there are a lot of new features released. For example, support many annotation code hint annotations, live code template, support auto-generated parcelable implementation and so on, as a developer, continue to follow this update list recent changes, will make your code of life better.
    2. Android Ijiami: Developers face at present very much to the app is stolen source code, implanted malicious virus, add ads through two times packaging become pirated products into the channel, not only directly lead to the work of the developer's fruits stolen, creative plagiarism, the interests of serious damage, Results in a drop in app user experience or a direct economic loss. http://www.ijiami.cn/

the realization of the replacement skin function of Android application

We can make a skin pack into an apk file and read the data from the skin pack in the app apk.

apply apk to read Skin pack apk data Condition

1. With the same signature

2. Configuring Android:shareduserid in Androidmanifest.xml has the same attribute value

To meet the above criteria, two apk will be able to access the data with each other.

steps to implement a skin-changing feature for Android apps

1, application and skin programs in the Androidmanifest.xml configuration

xml/html Code
    1. android:shareduserid="Com.yee"

2, apply apk and skin apk in the same function of the skin file name to match

Example: App apk image path: \res\drawable-hdpi\xx.png

The image file path in the skin apk should also be: \res\drawable-hdpi\xx.png

3. Get Skin Resources

Java code
    1. Context context = Createpackagecontext ("Com.yee.skin", context.context_ignore_security);

Get to the skin pack com.yee.skin corresponding to the context, by returning the context object you can access to the skin APK package Com.yee.skin any resources.

In the app apk you want to get the Buttonbackground.png code in the skin apk as follows

Java code

drawable drawable = Context.getresources (). getdrawable (R.drawable.buttonbackground);

APK share: Android App replacement skin function implementation Ideas Tutorial.

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.