Android Question Activity Recognition Service: Service does not start

grafsoft

Well-Known Member
Licensed User
Longtime User
Hi,
I had a running program based on Erels example (http://www.b4x.com/android/forum/threads/physical-activity-recognition-detection.42481/#content), but now the sergvice does not start.

B4X:
Sub ar_Connected (Success As Boolean)
  Log("Connected: " & Success)
  ToastMessageShow ("Connection to the service: " & Success,True)
  ' This works
End Sub

Sub Service_Start (StartingIntent As Intent)
' it never reaches this line!
 If StartingIntent.Action = "activity_recognition" Then
  ...
  end if
end sub

What should I check?
 

DonManfred

Expert
Licensed User
Longtime User
Check
B4X:
AddApplicationText(<service
  android:name="anywheresoftware.b4a.objects.ActivityRecognition$RecognitionService">
</service>
<meta-data android:name="com.google.android.gms.version"
  android:value="@integer/google_play_services_version" />)

The name of your service must be RecognitionService when using this Manifest-code
 
Upvote 0
Top