2

According to Google Google APIs for Android the ActivityRecognitionApi interface is deprecated and need to use the ActivityRecognitionClient interface. But other sources saying that the ActivityRecognitionClient is depricated and need to use the ActivityRecognitionApi interface insted. I am confused :(

And many other samples on the internet is using the ActivityRecognitionApi interface.

And when we using the ActivityRecognitionClient interface the periodic update is not getting only the initial time we will get the update , But he ActivityRecognitionApi interface update is getting properly.

Which one we need to use ? , If we need to uses ActivityRecognitionClient kindly provide a sample code of working Application/Code .

Rohith Krishnan
  • 648
  • 8
  • 29
  • Official source says A, random other source says B. You're asking which one to trust? – Tim Feb 16 '18 at 12:52
  • @TimCastelijns , I think i should trust Google but i used the new interface and there is no periodic update and i am searching for code using new interface.And when i used the old interface the periodic update id getting properly. – Rohith Krishnan Feb 16 '18 at 12:54
  • that's not relevant - you're asking which of the 2 is actually deprecated – Tim Feb 16 '18 at 12:57
  • 2
    I think it is also relevent :) , Thats why i asked for sample code using ActivityRecognitionClient – Rohith Krishnan Feb 16 '18 at 13:19
  • 1
    Wow i din'nt know that there is no sample code and code solutions are providing from stack overflow . I think you just read my subject line and dont read my full question – Rohith Krishnan Feb 16 '18 at 13:28
  • If the question you put in the title does not reflect what you are actually asking then obviously you didn't provide a good title. That's not my fault – Tim Feb 16 '18 at 13:31
  • 1
    If you not fully read my question and hanging on the subject line , then its not my fault – Rohith Krishnan Feb 16 '18 at 13:38
  • 1
    Two years later. This is the hardest android function I've tried to program so far. I get absolutely no results using 4 different tutorials out there. Did you ever find an answer? – Neo42 Feb 28 '18 at 22:45
  • Yes , ActivityRecognitionClient is working well . Tested in device and emulator . The gps need to enable for getting the periodic updates.Tested the device with in a running car and the status is displayed properly. – Rohith Krishnan Mar 01 '18 at 03:24

1 Answers1

2

In version 11.8.0 of play services ,ActivityRecognitionApi is deprecated. You should use the new interface , So when the next version comes, you don't have the risk to forcefully update it to the new interface.

Rohith Krishnan
  • 648
  • 8
  • 29
Marijan
  • 711
  • 8
  • 16
  • Yes i already mentioned that according to Google Google APIs for Android the ActivityRecognitionApi is depricated , i used the new interface and there is no periodic update and i am searching for code using new interface – Rohith Krishnan Feb 16 '18 at 12:52