I am making a new watch face using the official API and I'm trying to figure out how to display battery percentage. (sorry i'm a complete noob)
How to display battery percentage on Watch Face
2.4k Views Asked by Alex Cronin At
1
There are 1 best solutions below
Related Questions in ANDROID-STUDIO
- how do i submit a pastebin or pastee from an android app and get the url back
- Getresource id Error
- Call special fragment in Navigation Drawer Activity from separate Activity
- Debug native code in Android Studio
- How to introduce in this AlertDialog a onBackButtonPressed method?
- Android Studio : All of a sudden cannot resolve symbol 'ActionBarActivity'
- Error connecting to Google Play Games
- Android Studio - Illegal character 8204 error
- Android Studio unable to run the project
- How do I know what is available in minSdkVersion in Android Studio?
- Android Studio update (version 1.2.1.1) - Cannot resolve symbol 'TintCheckBox'
- How to accept cookies when using a webservice - Android?
- How can I always show Android Studios Preview?
- Android Studio cannot recognize "setAdapter()" method
- Error inflating class Android support design
Related Questions in WEAR-OS
- Android wear action remotely activates a service in handheld
- Android Wear Device as iBeacon
- Crosswalk Chomium API : Blank View on Wear
- Offline Speech Recognition on Android Wear
- Delay in Android Wear putDataItem() and invoking of onDataChanged()
- Android Wear Data Transmission: Messages, WearableListener or Channel?
- Does Wearable.DataApi.getDataItems users UriMatcher
- WearableListenerService doesn't receive data
- Android Wear App rejected, need to implement Round screen compatibility? how?
- Cannot access Workout Exercises on Google Fitness API
- Can I use android wear voice reply without using notificationcompat.builder?
- Will wearable service ever be killed?
- HTTPS connection on wi-fi enabled Android Wear without phone tethering
- MeteorJS On Watch OS
- Android Wear ChannelApi examples?
Related Questions in MOTO-360
- How to transfer sensor data and audio data saved in internal memory of Moto 360 to an Android phone?
- Data Transfer from Andread Wear Watch to phone via bluetooth
- Android Wear BoxInsetLayout doesn't work on Moto 360
- Can I save sensor data of android wearable(MOTO 360)?
- Android Wear: How to implement voice action "Stop running"
- Has anyone been able to get sensor data from Moto 360 via. Google Fit API?
- Get data from Smartwatch Android Wear to Smartphone
- My Wear app gets rotated and translated up on Moto 360
- Moto 360 accelerometer giving really weird values
- Get the number of "tap" on a locked smartwatch screen
- Detect if Android Wear screen has chin (aka flat tire)
- How to detect height of black bar on Moto 360?
- How to display battery percentage on Watch Face
- Android Wear Accelerometer data gaps
- Android Wear App Crash in Moto 360 in other watches app is working fine
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Register a
Intent.ACTION_BATTERY_CHANGEDBroadcastReceiverinside yourWatchFaceService.Engine.onCreateoverride and deregister it inWatchFaceService.Engine.onDestroy. When your receive a broadcast, get the battery level from the broadcast, assign it to some field in your watch face and redraw the watch face using the new value.If this is confusing and you need more detailed description, best build understanding of two areas: watch faces in general and battery monitoring.
To understand watch faces, please follow https://developer.android.com/training/wearables/watch-faces/index.html It will walk you through the whole process of creating the watch face, including the lifecycle. This will make
onCreateandonDestroyclear.After you understand watch faces, please read about battery level monitoring on Android: https://developer.android.com/training/monitoring-device-state/battery-monitoring.html
After you finish these two pieces, you should actually not need to come back to this question, because things should just come together on their own.