Newsletter
REAL HACKER NEWS
  • Home
  • REVIEWS
  • SECURITY
  • GAMING
  • SMARTPHONES
  • CAMERA
  • COMPUTERS
    • LAPTOP
  • APPLICATIONS
  • AUDIO
No Result
View All Result
  • Home
  • REVIEWS
  • SECURITY
  • GAMING
  • SMARTPHONES
  • CAMERA
  • COMPUTERS
    • LAPTOP
  • APPLICATIONS
  • AUDIO
No Result
View All Result
REAL HACKER NEWS
No Result
View All Result
Home APPLICATIONS

Power your Wear OS fitness app with the latest version of Health Services

Real Hacker Staff by Real Hacker Staff
November 16, 2022
in APPLICATIONS
0
189
SHARES
1.5k
VIEWS
Share on FacebookShare on Twitter



Posted by Breana Tate, Developer Relations EngineerThe Well being Providers API permits builders to make use of on-device sensor information and associated algorithms to supply their apps with high-quality information associated to exercise, train, and well being. What’s extra, you don’t have to decide on between conserving battery life and delivering excessive frequency information–Well being Providers makes it doable to do each. Since saying Well being Providers Alpha at I/O ‘21, we’ve launched numerous enhancements to the platform aimed toward simplifying the event expertise. Learn on to study concerning the thrilling options from Well being Providers Beta in Android Jetpack that your app will be capable to reap the benefits of once you migrate from Alpha.

Seize extra with new metrics

The Well being Providers Jetpack Beta introduces new information and train varieties, together with DataType.GOLF_SHOT_COUNT, ExerciseType.HORSE_RIDING, and ExerciseType.BACKPACKING. You may evaluation the total listing of recent train and information varieties right here. These complement the already massive library of information and train varieties obtainable to builders constructing Put on OS apps with Well being Providers. Moreover, we’ve added the power to pay attention for well being occasions, reminiscent of fall detection, via PassiveMonitoringClient.

Along with new information varieties, we’ve additionally launched a brand new group mannequin for information in Well being Providers. This new mannequin makes the Well being Providers API extra type-safe by including further classification data to information varieties and information factors, decreasing the prospect of errors in code. In Beta, all DataPoint varieties have their very own subclass and are derived from the DataPoint class. You may select from:

  • SampleDataPoints 
  • IntervalDataPoints 
  • StatisticalDataPoints
  • CumulativeDataPoints. 

DataTypes are categorized as AggregateDataTypes or DeltaDataTypes.

Because of this modification, Well being Providers can assure the proper kind at compile time as a substitute of at runtime, decreasing errors and enhancing the developer expertise. For instance, location information factors at the moment are represented as a strongly-typed LocationData object as a substitute of as a DoubleArray. Check out the instance under:

Beforehand:

exerciseUpdate.latestMetrics[DataType.LOCATION]?.forEach {
  val loc = it.worth.asDoubleArray()

  val lat = loc[DataPoints.LOCATION_DATA_POINT_LATITUDE_INDEX]
  val lon = loc[DataPoints.LOCATION_DATA_POINT_LONGITUDE_INDEX]
  val alt = loc[DataPoints.LOCATION_DATA_POINT_ALTITUDE_INDEX]

  println(“($lat,$lon,$alt) @ ${it.startDurationFromBoot}“)
}

Well being Providers Beta:

exerciseUpdate.latestMetrics.getData(DataType.LOCATION).forEach {
  // it.worth is of kind LocationData
  val loc = it.worth
  val time = it.timeDurationFromBoot
  println(“loc = [${loc.latitude}, ${loc.longitude}, ${loc.altitude}] @ $time”)

}

As you may see, as a result of new strategy, Well being Providers is aware of that loc is of kind Record<SampleDataPoint<LocationData>> as a result of DataType.LOCATION is outlined as a DeltaDataType<LocationData, SampleDataPoint<LocationData>>.

Consolidated train finish state

ExerciseState is now included inside ExerciseUpdate’s ExerciseStateInfo property. To provide you extra management over how your app responds to an ending train, we’ve added new ExerciseStates known as ExerciseState.ENDED and ExerciseState.ENDING to interchange what was beforehand a number of variations of ended and ending states. These new states additionally embody an endReason, reminiscent of USER_END, AUTO_END_PREPARE_EXPIRED, and AUTO_END_PERMISSION_LOST.

Related articles

Flutter Desktop Apps: Getting Started

Flutter Desktop Apps: Getting Started

March 28, 2023
Mercari reduces 355K lines of code, a 69% difference, by rebuilding with Jetpack Compose

Mercari reduces 355K lines of code, a 69% difference, by rebuilding with Jetpack Compose

March 27, 2023

The next instance exhibits verify for train termination:

val callback = object : ExerciseUpdateCallback {
    override enjoyable onExerciseUpdateReceived(replace: ExerciseUpdate) {
        if (replace.exerciseStateInfo.state.isEnded) {
            // Exercise has both been ended by the person, or in any other case terminated
            val purpose = replace.exerciseStateInfo.endReason
        }
        …
    }
    …
}

Enhancements to passive monitoring

Well being Providers Beta additionally transitions to a brand new set of passive listener APIs. These modifications largely give attention to making every day metrics higher typed and simpler to combine. For instance, we renamed the PassiveListenerConfig operate setPassiveGoals to setDailyGoals. This transformation reinforces that Well being Providers solely helps every day passive targets.We’ve additionally condensed a number of APIs for registering Passive Listeners right into a single registration name. Shoppers can immediately implement the specified overrides for under the information your app wants.

Moreover, the Passive Listener BroadcastReceiver was changed by the PassiveListenerService, which gives stronger typing, together with higher reliability and efficiency. Shoppers can now register each a service and a callback concurrently with totally different requests, making it simpler to register a callback for UI updates whereas reserving the background request for database updates.

Construct for much more units on Put on OS 3

Well being Providers is simply obtainable for Put on OS 3. The Put on OS 3 ecosystem now consists of much more units, which suggests your apps can attain much more customers. Montblanc, Samsung, and Fossil are only a few of the OEMs which have just lately launched new units operating Put on OS 3 (with extra coming later this yr!). The newly launched Pixel Watch additionally options Fitbit well being monitoring powered by Well being Providers.

In case you haven’t used Well being Providers earlier than, now could be the time to attempt it out! And in case your app remains to be utilizing Well being Providers Alpha, right here is why it’s best to think about migrating:

  • Ongoing Well being Providers Growth: Since Well being Providers Beta is the most recent model, bug fixes and have enhancements are more likely to be prioritized over older variations.
  • Prepares your app infrastructure for when Well being Providers goes to steady launch
  • Enhancements to kind security – much less likelihood of error in code!
  • Provides further performance to make it simpler to work with Well being Providers information

You may view the total listing of modifications and up to date documentation at developer.android.com.



Source link

Tags: AppFitnessHealthlatestPowerServicesversionWear
Share76Tweet47

Related Posts

Flutter Desktop Apps: Getting Started

Flutter Desktop Apps: Getting Started

by Real Hacker Staff
March 28, 2023
0

Requires a pro subscription Pro Version history Flutter 3.7, Dart 2.19, Android Studio 2021.3.1 or higher, Visual Studo Code 1.7.4...

Mercari reduces 355K lines of code, a 69% difference, by rebuilding with Jetpack Compose

Mercari reduces 355K lines of code, a 69% difference, by rebuilding with Jetpack Compose

by Real Hacker Staff
March 27, 2023
0

Posted by the Android team In 2020, the Mercari team took on a big initiative to update its app’s technical...

Apple Releases iOS/iPadOS 16.4 With New Emoji, Web Push Notifications and More

by Real Hacker Staff
March 27, 2023
0

Apple Watch users can now also download watchOS 9.4 The watchOS 9.4 update can be downloaded now through the companion...

There’s only one thing Apple should launch at WWDC 2023, and it isn’t a VR headset

There’s only one thing Apple should launch at WWDC 2023, and it isn’t a VR headset

by Real Hacker Staff
March 27, 2023
0

Artificial Intelligence. A.I. What exactly is it and why is Apple so bad at it right now?In fact, I have...

iPhone camera blinking? Here’s how to fix it!

iPhone camera blinking? Here’s how to fix it!

by Real Hacker Staff
March 27, 2023
0

Is your iPhone camera blinking or flickering when you try to take a photo? There could be many reasons why...

Load More
  • Trending
  • Comments
  • Latest

eSIMs Will Transform the Way You Think About Mobile Data and Security

March 7, 2023

XMOS Launches XVF3800 High-Performance Voice Processor for Enterprise and Consumer Voice Conferencing Platforms

March 7, 2023

Chinese Hackers Using Russo-Ukrainian War Decoys to Target APAC and European Entities

December 7, 2022

Sennheiser Starts Shipping EW-DX Digital Wireless Microphone Series

November 22, 2022

Hello world!

0
US Commodities Regulator Beefs Up Bitcoin Futures Review

US Commodities Regulator Beefs Up Bitcoin Futures Review

0
Bitcoin Hits 2018 Low as Concerns Mount on Regulation, Viability

Bitcoin Hits 2018 Low as Concerns Mount on Regulation, Viability

0
India: Bitcoin Prices Drop As Media Misinterprets Gov’s Regulation Speech

India: Bitcoin Prices Drop As Media Misinterprets Gov’s Regulation Speech

0
Elon Musk says Twitter will only show verified accounts on its algorithmic timeline

Elon Musk says Twitter will only show verified accounts on its algorithmic timeline

March 28, 2023
China Premier Li tells Apple’s Tim Cook country to open further | Business and Economy

China Premier Li tells Apple’s Tim Cook country to open further | Business and Economy

March 28, 2023
Two 3DS HOME Themes Are Now Free To Download (North America)

Two 3DS HOME Themes Are Now Free To Download (North America)

March 28, 2023
Russia-Ukraine war: List of key events, day 398 | Russia-Ukraine war News

Russia-Ukraine war: List of key events, day 398 | Russia-Ukraine war News

March 28, 2023

Recent News

Elon Musk says Twitter will only show verified accounts on its algorithmic timeline

Elon Musk says Twitter will only show verified accounts on its algorithmic timeline

March 28, 2023
China Premier Li tells Apple’s Tim Cook country to open further | Business and Economy

China Premier Li tells Apple’s Tim Cook country to open further | Business and Economy

March 28, 2023

Categories

  • APPLICATIONS
  • AUDIO
  • CAMERA
  • COMPUTERS
  • GAMING
  • LAPTOP
  • REVIEWS
  • SECURITY
  • SMARTPHONES
  • Uncategorized
REAL HACKER NEWS

We bring you the best news on Internet new gadgets hacking and technology from around the world

  • Contact
  • Cookie Privacy Policy
  • Terms and Conditions
  • Privacy Policy
  • Disclaimer
  • DMCA

© 2003 Real Hacker News

No Result
View All Result
  • Home
  • REVIEWS
  • SECURITY
  • GAMING
  • SMARTPHONES
  • CAMERA
  • COMPUTERS
    • LAPTOP
  • APPLICATIONS
  • AUDIO

© 2003 Real Hacker News

Go to mobile version