0

I am not entirely sure if this is a more generic question than just related to the Sphero API.

I have an old blackberry with a sideloaded APK that connects with a Sphero 2.0. But the same applies to a newer Android phone (that I use for development)

This smartphone is always in the area of the Sphero but also connected to the internet.

The smartphone receives signals from the internet which it translates to the Sphero API.

In this case the Smartphone is not held by a person but in a Sphero Chariot for example.

After a few minutes (max 5 or 10) the smartphone goes to sleep AND looses it's bluetooth connection.

I am looking for a way to keep this connection, battery life is less of a concern.

Thanks

mpjjonker
  • 917
  • 1
  • 6
  • 28
  • Something similar to: There's an option in Developer options to "Stay awake, Screen will never sleep while charging." – mpjjonker Jun 09 '15 at 14:55

1 Answers1

0

I had the same problem. I changed the setting to 10 mins as you mentioned.

What happens if you delete "RobotProvider.getDefaultProvider().disconnectControlledRobots();" from "protected void onPause()" as this is done in the samples?

Niklas Heidloff
  • 952
  • 6
  • 13
  • Thanks @Niklas-Heidloff, I think the onPause() in general is causing the problem, not only will the robot be disconnected, but I think the listening to mqtt messages and/or stream data from the robot will also stop. Please note that my Android skills are as new as my Bluemix IoT skills :-) I will try your tip and report back. – mpjjonker Jun 10 '15 at 18:02