Languages

Menu
Sites
Language
Communication between Service app (background without UI) and normal native app (with ui)

How can I communicate between Service app (background without UI) and normal native app (with ui)?

I tried with message port.

I was able send message to service app but the service app didnt recieve the message.

Then I tried to send message to ui app  when starting the service app using a timer 1 sec interval. but after 10-15sec the service app stoped sending messages.

At starting of the service app it able to send msg and recive msg, same for ui app too.

but after 10-15 secs the service app neither recive msg nor send message.

 

Is there any other technique to communicate with service app and ui app?

Or did I missed something, thats why service app stoped responding after sometimes?

Thanks in advance.

Edited by: Md. Mahbubul Huq on 14 Oct, 2015

Responses

8 Replies
Palitsyna

Hello,

just FYI, here is Service Application tutorial. https://developer.tizen.org/development/tutorials/native-application/application-framework/service-application

Probably you can use service_app_control_cb() which is called when another application sends the launch request to the service application. 

Service app API: https://developer.tizen.org/dev-guide/2.3.1/org.tizen.native.mobile.apireference/group__CAPI__SERVICE__APP__MODULE.html#gacb424256be4fbb32648e1ae5feef3d26

Md. Mahbubul Huq

I registerd the message_port_cb while creation of message port. So, it supposed to get called uppon receiving msg.

What I need to with the app_control_cb() ?

And When the service app launched first time, every thing works fine for 10-15 secs. after that service app doest work.

What is the reason?

colin Rao

just f.y.i.

Message Port: 

https://developer.tizen.org/development/tutorials/native-application/application-framework/message-port

Md. Mahbubul Huq

I've read this. I've implemented using this api.

But the problem with the background service app stop responding after 10-15 secs of its first activation. It doesnt recive msg nor send msg.

Alex Dem

Hi,
If you service app stop working try to check , maybe your service has been terminated due some reasons.
also, you could set in your manifest->Advanced ->Auto restart for this case.
Alexey.

Alex Dem

Hi,
Also fyi:
There is Native Sample->Native app ->Hybrid Service where mesaage port is used (as example).
But it should used with Web Sample->Advanced ->HybridWebApp together
Alexey,

Palitsyna

Hello,

you can use auto-restart option, just add the auto-restart="true" parameter in your tizen-manifest.xml file.

Here you can find the example and some information about Service Application: https://developer.tizen.org/dev-guide/2.3.1/org.tizen.guides/html/native/app/service_app_n.htm

 

colin Rao

f.y.i.

similiar topics,

https://developer.tizen.org/forums/native-application-development/mesage-port-receives-no-data

https://developer.tizen.org/forums/native-application-development/message_port_send_message-returning-error-5