语言

Menu
Sites
Language
How do I keep SAP connection alive always between Android app (Consumer) and Gear app (Provider)?

Hi, all!

We have an Android app that detects sleep tracking (can be running up to 12 and more hours) from various sensors and we would like to add the Tizen Gear Series to it.

We use many ways to interact with each (BLE, Server-to-Server, etc.)

What I've done so far -

I have a simple Tizen UI app (Provider) with only a timer running for user to see how long the measurment is recording, which interacts with Android app (Consumer) using SAP. My base code is from the HelloAccessory sample which looks fine.

I have also a Service app which locks the CPU and start HRM and ACC Sensor tracking. The Service app works wonderful even for multiple hours and will not seem to consume any noticable battery usage since I request it periodically and not always.

The thing is, that after a few hours and maybe even after few minutes the connection seem to be lost (I get 513 - connection closed) and I'm unable to restore it whatsoever. Also it seems that I have to open the Gear app before opening the Android app in order for the connection to be alive.

Now, I don't need to keep the connection for the entire time but only for starting and stopping the Service app and get the recorded data and maybe for one or two more events.

What I want is to interact with the Gear app ONLY from the Android app, meaning even if the Gear app is closed I would still want to launch it and start the Service app as well but it seems that the connection is dead for the Tizen UI application. Is this even possible? Is it possible to maybe use BLE/GATT for this type of connection? I want to be able to connect with the Gear app on-demand ALWAYS.

Any help will be appericated. If code is needed, please let me know.

Thanks!

响应

1 回复
Armaan-Ul- Islam

Haven't seen any API function yet in Accessory SDK to launch tizen app using Android phone, It's just a communication path. I would suggest you to launch your tizen app from tizen end itself. I've shared my suggestion in this thread of StackOverflow, Please check.