-1

I need to get list of all activities listed in google fit just like google fit app .so that user can select a particular activity to insert them into the health kit . Is there any intent builder for achieving this . I read the FitnessActivites class Descripition and Fitness Doc too but did't get the solution .. Can anyone help me out .. i'm stuck here

ADM
  • 20,406
  • 11
  • 52
  • 83

1 Answers1

-1

You can actually get it form AndroidManifest file. Even if its compiled. Therer is list copied from it (used Notepad++):

com.google.android.apps.fitness.FitnessActivity 
com.google.android.apps.fitness.preferences.settings.SettingsActivity
com.google.android.apps.fitness.preferences.DebugSettingsActivity 
com.google.android.apps.fitness.location.MapActivity 
android.support.PARENT_ACTIVITY 
com.google.android.apps.fitness.preferences.settings.SettingsEditor 
com.google.android.apps.fitness.preferences.settings.activityeditor.ActivityEdior
com.google.android.apps.fitness.preferences.settings.BleDevicesActivity 
com.google.android.apps.fitness.preferences.settings.BlePairingActivity
antoninkriz
  • 966
  • 4
  • 18
  • 36
  • I didn't get your your answer sorry . How to use these classes to get list of activities like google fit app .. Can you please post the code you used for it . – ADM Oct 15 '15 at 05:41
  • If you need list of activites (like Main Activity, Settigs or whatever else) you can use AndroidManifest.xml file located inside apk file of that app. The code should look like: `String s = "com.google.android.apps.fitness.FitnessActivity"; //here you need to load AndtroidManifest.xml from apk of that app Pattern p = Pattern.compile("com.google.android.apps.fitness.(.*?)Activity") Matcher m = p.matcher(s); if (m.find()) { System.out.println(m.group(1)); // => "Fitness" }` – antoninkriz Oct 15 '15 at 11:53
  • 2
    From activity i did't mean .java class i mean activities like tennis, Running Walking , Biking etc .. Which we insert in fitness app. If you still did't get my point then checkout the google fit app's add activity function – ADM Oct 15 '15 at 12:18
  • Then this https://developers.google.com/fit/rest/v1/reference/activity-types or http://stackoverflow.com/questions/27163326/getting-list-of-activitiesmovements-from-google-fit-api – antoninkriz Oct 15 '15 at 20:28