Languages

Menu
Sites
Language
How can I launch ui app with service app that has same package id.

Hi,

 

I make two native applications(ui and service app) that has same pakcage id.

ui application is checked 'multi package' service application.

'on-boot' of service app setting is 'true'.

 

If I press 'run as > Tizen native application' in ui application. Two applications are installed. but, service app is not launched.

 

I add part of manifest files.

<manifest xmlns="http://tizen.org/ns/packages" api-version="2.3.2" package="akawiki.egloos.com.a40hours" version="1.0.0">
    <profile name="wearable"/>
    <service-application appid="akawiki.egloos.com.a40hours.service" auto-restart="true" exec="40hours.service" multiple="false" nodisplay="true" on-boot="true" taskmanage="false" type="capp">
<manifest xmlns="http://tizen.org/ns/packages" api-version="2.3.2" package="akawiki.egloos.com.a40hours" version="1.0.0">
    <profile name="wearable"/>
    <ui-application appid="akawiki.egloos.com.a40hours.ui" exec="40hours.ui" multiple="false" nodisplay="false" taskmanage="true" type="capp">

 

How can I launch two applications?

Responses

2 Replies
Armaan-Ul- Islam

I've been through the same situation. The service app packaged with UI app is installed on the device but it is not desinged to be launched by default. If you want to launch the service app, you can launch it from UI app using Application Control API.

 

In app_create() function of UI application create an app_control that would explicitly launch the service application. Use dlog_print function to trace the application launches. I am sharing a example code snippet:

 

UI app:

void 
launchServiceApp(){ 

    app_control_h app_control; 
    
    app_control_create(&app_control); 
    app_control_set_operation(app_control, APP_CONTROL_OPERATION_DEFAULT); 
    
    app_control_set_app_id(app_control, "akawiki.egloos.com.a40hours.service"); 
    
    if (app_control_send_launch_request(app_control, NULL, NULL) == APP_CONTROL_ERROR_NONE) 
        dlog_print(DLOG_DEBUG, LOG_TAG, "Succeeded to launch the service app from UI app."); 
    else 
        dlog_print(DLOG_DEBUG, LOG_TAG, "Failed to launch the service app from UI app."); 
    
    app_control_destroy(app_control); 
} 

static 
bool app_create(void *data){ 
    appdata_s *ad = data;
    dlog_print(DLOG_DEBUG,LOG_TAG,"UI app launched."); 

    launchServiceApp(); 
    create_base_gui(ad); 

    return true; 
}

 

Service app:

 

bool
service_app_create(void *data){

    dlog_print(DLOG_DEBUG,LOG_TAG,"service app launched."); 
    return true; 
}

 

 

# Add 'appmanager.launch' privilege in tizen-manifest.xml file of the UI application.

 

Check this link for further details:

https://developer.tizen.org/development/guides/native-application/application-management/application-controls#explicit

연호 조

It is good idea!

Thank you!