Invoking particular class of native app from service app in Tizen

296 Views Asked by At

Is there any API to invoke a particular class of native app from service app in Tizen?

From service app i can able to invoke native app but not the particular class

by using the code

AppId callerAppId = L"someId";
    AppManager* pAppManager = AppManager::GetInstance();
    result res=pAppManager->LaunchApplication(callerAppId, AppManager::LAUNCH_OPTION_DEFAULT);

But i want to invoke particular class just like broad cast receivers in Android

2

There are 2 best solutions below

0
On

On Tizen platform to communicate another application (or application subprocess) you need to use AppControl and related interfaces. Here's documentation for it:

AppControl for native application

AppControl for web application

AppControl usage sample in web application

0
On

I got the answer

Inside service app(Calling App) of on initialising method add the below code

Tizen::App::AppControl* pAc = AppManager::FindAppControlN(L"Nativeapplication id",
                                                          L"");
    if (pAc)
    {
       pAc->Start(null, null, null, null);

       delete pAc;
   }

Above code finds the native application installed on your device

Add the following code inside your Native application form of on initialising method to register setapp control provider AppControlProviderManager::GetInstance()->SetAppControlProviderEventListener(this);

Inside on app control request received just invoke your class or form void NativeapplicationMainForm::OnAppControlRequestReceived ( RequestId reqId, const Tizen::Base::String & operationId, const Tizen::Base::String * pUriData, const Tizen::Base::String * pMimeType, const Tizen::Base::Collection::IMap * pExtraData ) { //invoke your form or class

}



    AppLog("invoked Native app from service app");


}