Search code examples
androidkotlingoogle-fit

How to open Google Fit app programmatically?


So, I have an app that uses google sign-in and Google Fit apis to register some data on the be, I would also like to open the Google Fit app from the app's settings.

I've already tried to open it using an Intent and passing the Google Fit's app package name but with no luck.

How I could open it programmatically on user's click?


Solution

  • So, the problem was that, from android 11, is necessary to declare in the manifest the package names of the apps that our app needs to interact as follows (Google Fit in this case):

    <queries>
        <package android:name="com.google.android.apps.fitness" />
    </queries>
    

    and start another activity as in the response given by @soheil

    more on the official docs page