Android Chromium: Successfully obtained user-defined system default font settings

Source: Internet
Author: User

The principle of this thing is this: the official Android system does not support the modification of the system default font, all can be modified by the OEM manufacturers to modify the framework layer of code, while integrating a high-privileged pre-installed application services.

How to do it?

It's really simple: Modify the Android.content.res.Configuration class, and the configuration class saves the system level that affects the settings for all Activity view displays. If the configuration class changes, all activity is automatically restarted.

For example, you can add a string Fontpath or typeface typeface property. (The official default is only fontsize)

The added properties are not visible to external applications because external apps can only be compiled based on the official Android SDK. The workaround is to call through Java dynamic reflection.

So how does an external application get the current instance of a configuration object when it is initially started?

Very simple: Activity (Context)--getresources () Get Resources Object--getconfiguration (): OK.


Android Chromium: Successfully obtained user-defined system default font settings

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.