0

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!

Gilad Eshkoli
  • 1,253
  • 11
  • 27

1 Answers1

0

As far as my Tizen development experience goes, The scenario is your process/app is being terminated by the system. After the recent OS update Tizen has got very aggressive about power resource management.

I 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 using Tizen appControl when you need it. Checking your requirement, Alarm API would be a smart way for you. For ex: Use alarm_schedule_after_delay() function to launch app after required period. You may call the function in app_terminate_cb(), In such way every time the app (service/UI) gets killed it would set a schedule to revive itself.

In addition, you may check out this question. In the question OP have shared some good ways to keeping Tizen app alive/functioning, Some may work out for your case.

Md. Armaan-Ul-Islam
  • 2,154
  • 2
  • 16
  • 20
  • Hi @Armaan-Ul-Islam, what I actually need is to know how the SAP actually works. Currently I'm able to make transmission only when the Android host app is opened AND afterwards opening the Gear app. Which by code seems legit and I understand it, but how can I communicate with the Gear app even if it is closed? It there no way of doing it? I mean, simple BLE should and work on all other devices like that, I simply register to the adapter and it read the data. No way of "registering" my app for SAP requests? – Gilad Eshkoli Apr 29 '18 at 15:23