-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bind "androidx.health:health-services-client" #825
Comments
Thanks for the feedback.
😄 "production ready" is quite elastic term. Previews are stable enough for bindings. It is not about stability, but resources (where I live day is 24 hrs too)
I get you, but cannot promise anything.
Which app if I may know? I work on such app myself as a side project and when I find some time and that is - rarely. |
Thanks, @moljac Yes, this is a part time project for me too. https://play.google.com/store/apps/details?id=com.limegreenv.geartracker What is your app, is it written in dotnet? is it in the store? Do you have a link? I'm also interested 😉 Thanks |
You are welcome.
Cool I will check it.
Currently it is several appsand yes in .NET (Xamarin.Forms and now rewriting in MAUI). I was simply solving some problems when I was coaching my daughters. I was skiing coach. Lara Cvjetko https://www.ijf.org/judoka/29418 https://www.ijf.org/wrl?category=12 https://www.ijf.org/wrl_olympic?category=12 Nina https://www.ijf.org/judoka/48861 Jana https://www.ijf.org/judoka/64009 One of the apps was similar your app. Basic activity tracker, but I have some morphologic/anthropometric (not only) calculations too (BMI, Ponderal index,... Somatotype). Another app was for Somatotype and even ML.net. I did research paper on that. https://pdfs.semanticscholar.org/c78b/43ee7415b047b1d78bde519a1300819a6b2b.pdf https://www.scitepress.org/PublishedPapers/2019/83680/pdf/index.html Then one is of periodization (planing and programming) app. Actually data (competitions) in CSV + algorithm as console app. I dream to merge those apps into one and publish it.
No. I wish.
It is in private repo on gitlab. Here is smaller part public, but it is mess... https://github.com/HolisticWare-Applications/Ph4ct3x Even readme is centuries old. I think some apps might be there. Not sure anymore. Now I am sad/angry. I must clean that up.
|
Oh nice, you do have a lot going on! I'm sure there's still plenty of spare time for bindings though, just cut back on some sleep 😉 |
This is actually going to become pretty big. Many health and study research programs are out there evaluating these projects right now. This particular package is pure kotlin with many generics which has made it tough to bind. @Redth This was package I've been talking about |
PR in progress |
Hey @moljac - The binding does generate, but the connect client uses a bunch of kotlin generics which only translate to Java.Lang.Object on the .NET side. This was causing all sorts of issues in my binding and seems to be an issue with yours as well. |
True.
What kind of issues? Not sure if I will have resources (time) to do manual interventions. And yes this is the drawback of our tooling. |
I can't get it to cast to equivalent type, so I can work with the actual data. I can get more concrete examples.
You don't need to quote this for my benefit. I've been around the Xamarin community long enough to know the underfunding going on. My point about this is that if the binding doesn't provide the necessary functionality, you'll be dealing with more support issues downstream. |
@moljac Try doing a ReadRecords off a IHealthConnectClient. I can't find an implementation of IContinuation for kotlin in the stdlib. How do you create a read request as the class is marked abstract? I got my binding a little farther along with "new ReadRecordsRequest(IKClass, filter, null, true, 2000, "")" but there doesn't seem to be a way get IKClass. The implementation is large and likely not something we're suppose to implement anyhow. I appreciate that timing isn't on your side, but this binding doesn't appear to actually be in a usable state. |
This is why binding previews is no fun. Google moves types in released artifacts and that causes troubles. This is worse. |
Again I am not SDK API expert.
Doesn't inheriting/extending/subclassing/specializing abstract class, implementing abstract stuff and adding behavior work?
|
We're did this end up? Is there a binding that can be released soon? |
Well there are issues with build. Those packages revealed some new fun stuff.
Nugets are built. Not sure if those are accessible from public/outside. Even when everything is green I am not sure that packages will be published. |
hmmm, what does this mean as far as timing/availability? |
If the bindings are getting this hard, where does this leave cross platform development using dotnet? What's the MS model for making bindings, is it supported internally or is it left to the end users/contributors? Any update on whether this will get over the line anytime soon? Sorry for my ignorance, but when I set out to use dotnet-android on my project I assumed I'd be able to use third party libraries with minimal effort. Thanks again, just looking to see where things stand. |
Not sure. Trying to do my best to juggle all my tasks. These bindings introduced new issues and trying to solve them. |
To answer 1st part: not all bindings are that hard. Some are. Check To answer 2nd part: Well I am certainly not the one to answer that.
We have constant discussion about that. Xamarin.Components repo is maintained only if special request comes in. All dependencies are in AX and GPS-FB-MLKit, all together 600+ packages. PRs and contributions are welcome.
I hope so. In
Rethorical question: size of the set called 3rd party libraries (in mathemartical sense) would be? Where do we draw the line?
You are welcome. Even when this PR is done. It will not be merged, because it is in preview and internal builds do not have nuget feeds where users could test preview packages. So you'll have to at least build it locally. THanks. |
Thanks for the update, it sounds like you have a lot on your hands. Should I build locally now, or wait until these isdues have been resolved? I.e. Will it work? |
Tons. We had issues with nuget filesizes on nuget.org (nuget gallery). It is solved now, so I'll be working on this PR soon.
Will it work? Maybe with probability closer to No. If you can check which packages must be bound maybe you could exclude those extras that cause issues until I implement the fix. |
Thank you, I'll wait patiently 👍 |
Sheat. Now I got guilt feeling and I am not being sarcastic. I'll do my best to fix it ASAP. |
Any news? With the upcommig Wear OS 5 and fitness/health apps being the main reason most ppl buy Wear OS wearables and apps.... and, this lib is optimised for better battery life |
@moljac, any progress? |
A bit. We removed classic support and I am stuck with regular updates and new issues with R8. In this PR #835 I have bound 3 health artifacts from 2
As I am not being SDK expert it seems to me like some might be deprecated, but there is no notice (or I did not find any yet), so when adding nugets to app during test I get tons of ACW errors with duplicate/multiply-defined classes. Seems like https://maven.google.com/web/index.html?q=health#androidx.health:health-connect-client might be deprecated. Error:
|
yup It would be nice to have such comment here: https://maven.google.com/web/index.html?q=androidx.health or at least metadata |
are we close? :-) |
I hope this help somone else because it was a pain to figgure out! First make sure you update all your nugets to latest version and check if the error message goes away. That did not work for me at the current time but might work in the future.
Since You need to explicit set
Then I got the following error:
Since type You need to explicit set
|
This comment has been minimized.
This comment has been minimized.
I have manged to bumped androidx.health.connect to Also tested it and managed to ask for permission and aggregated health data. If anyone is intrested to see how I did it publish it to Github. It is not easy to work with so hopfully this will help you on the way. https://github.com/EagleDelux/androidx.health-connect-demo-.net-maui |
I ended up building this locally and referencing the output nugets as a local nuget source. All seemed to build ok when including: but when referencing: I get these errors on build, any ideas?
|
I tried add this to but my build failed to. I added |
@EagleDelux, thank you. I was trying to get a build working with the version bump to see if it fixed the error, but am getting the above duplicate method signatures generated. I'm feeling my way around. Some pointers on how to configure to remove the duplicates would be good? Looking in: AndroidX.Health.Services.Client.Data.DebouncedDataTypeCondition.cs I can see them: But am unsure how to fix this, should one be qualified by chaning the name, I'm not sure... |
New pull request #920
When these functions are bound to .NET through Java Interop, the generics and type parameters are not directly represented. Instead, the bindings generate methods based on the Java signatures. The Java equivalents for these Kotlin functions are created by the Kotlin compiler, leading to the following: Instance Methods: I removed the instance methods and renamed the static methods to CreateDebouncedDataTypeConditionForAggregateDataType and CreateDebouncedDataTypeConditionForDeltaDataType because dataType is converted to global::Java.Lang.Object dataType due to the lack of support for Kotlin generics in .NET. This results in the functions having the same parameters and return type, necessitating renaming to distinguish between them. Renamed Static Methods: I removed the Instance Methods because they are not needed. |
Great! I'm trying it now... So I'm clear on how you acheived this, and for future reference:
|
yes that's exactly what I did. |
@DevronB It turns out that you change minSdkVersion from project.csproj |
@EagleDelux I already have: The above does not reslove the error for me, but using tools:overrideLibrary in maifest does 🤷 |
@moljac, how close are we getting to this being published and deployed to main->nuget? |
That works fine for me. Your error coms from another library: |
any updates? |
publishing failed. Seems there is package |
Those should be OK. Can you try please and provide feedback? |
I think we need the below added to: source/androidx.health/health-services-client/Transforms/Metadata.xml?
please... otherwise I can't call HealthServices.GetClient(context) |
@jpobst , sorry you are correct. Not sure what I was looking at :-/ moving on.... |
No worries! Glad you're unstuck! |
@jpobst Is there any information about when this binding will be production ready? I'm reluctant to use this package since it hasn't been touched in a while, but I don't see any information about the bindings coming in future versions of MAUI or any progress on the prerelease package. I'm setting up my own bindings now, since we need to get Health Connect out to our users as soon as possible for them to update before the current API is turned off on June 30th, but if there's any official information it would be great to know. |
It depends on your definition of "production ready". Google's library is still an "alpha" (though it is now alpha10), so if you want something that isn't considered "alpha" the answer is "when Google ships a production version". Since we generally do not bind pre-release libraries, our automated tooling does not process pre-release updates either, thus we are a few alphas behind. It's up to @moljac if he has the bandwidth to manually update the library. |
Ok, good to know, thanks. I'll keep watching to see if there are any updates on this end while I continue working on binding just the features that we use. Not to come off as snarky, I really appreciate the time taken in this thread, but Google is directing all users to use the Health Connect API now, it seems production in all but name on their end... so I do wonder if the "generally" in "we generally do not bind pre-release libraries" is worth considering if this could be a case where it might be looking at the potential for releasing a .NET package. Again, thanks! Appreciate all the work you've done and for the reply. |
I too would like to see this bumped to alpha10 please. The docs (i saw it somewhere) say this library is "production ready" too. |
Description
package link: https://maven.google.com/web/index.html?q=health#androidx.health:health-services-client:1.0.0-rc01
Although it's RC, it says 'Production Ready', and it looks like it's in continual development and for some reason never gets to release... so I assume it's stable enough for binding?
The problem we have is that Samsung are cripling foreground services and access to location and health data on Wear OS without consuming via this library. I have a fitness app in the Play Store for Wear OS written in net8-android and with out this it's slowly being crippled, which makes dotnet dev for WearOS unviable.
The text was updated successfully, but these errors were encountered: