Development and realization of battery plug-in for Android Widget

Source: Internet
Author: User

Recent whim, want to make up an Android battery plugin on the desktop, one is this app does have its practical value, the second is to build up the amount of work should not be very large, do not spend too long, three and can learn the development of the widget under the three-way, so, Pause the game development of learning, to make a widget first.


After the search and integration of multiple data finally realized, the effect is as follows:
Long Press the desktop blank, appear menu, click Widgets, at this time the plugin has been loaded:

When the power is connected, the robot will be surrounded by starlight, indicating that it is charging and that the surrounding starlight disappears when the charge is not charged.

The robot displays a percentage of the battery charge.


Click the robot icon to jump out of the battery information and click the screen again to close the details.

The implementation of the code is described below:

The entire project mainly realizes two parts, one is the appwidget part, realizes the desktop widget the display, the update and so on, another part is the display battery detailed information appears after clicking the widget realization.

Related Article

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.