언어 설정

Menu
Sites
Language
service app 을 이용해서 일정한시간이되면 notify 해주는 어플

네이티브 어플리케이션을 개발중입니다.

앱이 화면에 보이지 않을때에도 background에서 돌아가면서

일정시간이 되면 notify해주는 어플리케이션을 만들고 싶은데

service에 관한 예제소스와 설명이 부족해서 어떤식으로 코드를 짜야하는지 좀 어렵습니다.

static void app_pause 이부분에 notify코드를 삽입하는게 맞는건지 아니면 서비스를 따로 만들어야되는지 잘 모르겠습니다.

도움주시면 감사하겠습니다.

 

Responses

2 댓글
Nafisul Islam Kiron

Hello, as far as I understand you want to make an app that will trigger an event at a set time, just like a tasker. And, this app will run in background. Is this correct?

Please check this link:

https://developer.tizen.org/dev-guide/native/2.3.0/org.tizen.mobile.native.appprogramming/html/guide/app/service_applications.htm

https://developer.tizen.org/ko/development/api-tutorials/web-application/tizen-features/service-application?langredirect=1

https://developer.tizen.org/dev-guide/native/2.3.0/org.tizen.mobile.native.appprogramming/html/tutorials/app_tutorial/service_app_tutorial.htm

 

Also please check this sample app in Tizen IDE called "Notification Service"

File > New > Tizen Native Project > Online Sample > AppFW > Notification Service

Seongwon Cho

This is a code snippet to use Ecore Timer in Service app.

Ecore_Timer *timer;

static Eina_Bool
_my_timer_cb(void *data)
{
    static int cnt = 0;

    if (cnt == 10)
    {
        timer = NULL;
        return ECORE_CALLBACK_CANCEL;
    }

    dlog_print(DLOG_INFO, LOG_TAG, "cnt : %d", ++cnt);

    return ECORE_CALLBACK_RENEW;
}

bool service_app_create(void *data)
{
    // Todo: add your code here.
    timer = ecore_timer_add(1.0, _my_timer_cb, NULL);
    return true;
}