语言

Menu
Sites
Language
Samsung Gear S2 Standalone background notification service

Hello,

i'm trying to create a a service/program that can run on my Samsung Gear S2 as a standalone in the background, that can send a request to a webserver (http json) every 5 minutes.
Based on the response it should give an notification pop-up or do nothing.

I can't find any post that gives me a good base to start from.

Thanks in advance.

Dieter

响应

4 回复
Shaswati Saha

Hello,
You can try CURL API for sending request and getting response from the webserver. Please go through the link below. It'll show you the way of managing HTTP requests.
https://developer.tizen.org/development/api-tutorials/native-application/network/curl#init

After doing that, for showing notification, I would refer the "NotificationManager" online sample app.

Thanks.  

Shaswati Saha

Please also refer to the link below:

https://curl.haxx.se/libcurl/c/getinmemory.html

Dieter Vennekens

Thank you Shaswati Saha for your response.

I think I figured out the HTTP part now.

But how do I get this to run in the background?

 

Shaswati Saha

You can do the background work in a service app. I would like to suggest you to use timer for requesting the webserver after a certain time period.
For more details about the implementation of timer please go through the link below:  
https://developer.tizen.org/development/api-references/native-application?redirect=/dev-guide/2.3.1/org.tizen.native.mobile.apireference/group__Ecore__Timer__Group.html