Languages

Menu
Sites
Language
Start one application from another application

Hi,

Sorry for my English.

I have 2 my applications, I install them both to the one device and I want to run one application by the button from other application.

I read about Tizen::App::AppManager , but I don't find any functions for starting user's application from other user's application.

What can help me?

Edited by: Brock Boland on 17 Mar, 2014 Reason: Paragraph tags added automatically from tizen_format_fix module.

Responses

18 Replies
muditha murthy
For launching othe application from your application you need ot use AppManager::LaunchApplication() . Refer the help topic Launching other applications(Tizen Native App Programming > Programming Guide > App: Controlling Your Application)
Anil Kumar

Hi Muditha Murthy,

I am a new bee to Tizen. Even i am interesting knowing to launch an app from another. I have gone through the Programming guide as specified above, not cleared yet.

Could you please share us any sample application that will help us a lot.

Thanks in advance.

 

kimi
Anil Kumar

Hi Kimi,

Thanks for the such a good link.

In the Active Applications Section one part of the code Snippet seems confusing to me:
App *app;  
How can we get app pointer ??

In the code no where this variable is filling and has been using ?

Please clarify.

Alex Ashirov

Hi,

It seems that App *app = App::GetInstance(); is missed.

kimi

Hi,

Yes App *app = App::GetInstance(); is missed.

But still, the code works. looks like the method gets called implicitly.

 

Kimi.

Anil Kumar

Thanks Alex and Kimi for the help.

I am looking for the instance of the app (say SecondApp) launched by my app (say FirstApp). Below is the code snippet:

In the FisrtApp:       

{
    ...
    AppId appId = L"SecondApp.AppId";
    AppManager* add = AppManager::GetInstance();
    AppControl* pAc = AppManager::FindAppControlN(appId, L"http://tizen.org/appcontrol/operation/main");

    App *app ;// I need the app instance of second app.
    AppLog("GetAppDataPath :: %ls", app->GetAppDataPath().GetPointer());
    ...
}

Is it possible to get the instance of the SecondApp in FirstApp ?

Anil

Alex Ashirov

Hi Anil,

I think, it is not possible. The App class represents instance of your application (FirstApp). You may interact with other application using AppControl class.

Anil Kumar

Thanks Alex.

My main motto is to get the AppState of other application from my current Application using below API:

AppState Tizen::App::App::GetAppState ( void    ) const

Please help me how to get the state ?

Anil

kimi

Hi,

You can get instance of another application from the current application by using 

static AppResource *     GetInstanceByAppId (const AppId &appId)

But for this you need to have Platform privilege.

 

Kimi.

Anil Kumar

Thanks Kimi.

How can i get Platform privilege?

Anil.

Alex Ashirov

Hi Anil,

Unfortunately, these privileges are open only to a specific set of Tizen application developers. Please read for more information about privileges:

https://developer.tizen.org/help/index.jsp?topic=%2Forg.tizen.gettingstarted%2Fhtml%2Ftizen_overview%2Fsecurity.htm

Halli Kumar

Hi Alex,

Thanks for the information. You mean to say, there is no way we can get that privilege. Is there any body or forum in Tizen which can be contacted to get that privilege in an authorized way?

Note: I need this as I am developin a tool which has to simulate key events to test an application. I got to know the API GenerateKeyEvent API can be used to simulate key events. But it needs platform level privilege. Hence wanted to know the process or procedure to get the same. Also, it would be helpful if any pointers for simulating the key events in any other way on Tizen.

 

Alex Ashirov

Hi Halli,

Actually I don’t know the procedure how and there you can request the platform privileges. IMHO, they are only available for the Tizen platform developers.

Alex Ashirov

Please somebody correct me if I am wrong.

Anil Kumar

Hi Kimi,

I have gone thourhg AppResource class, no where i found to get the instance of the launched application. Could your please explain a bit more to know the appState() of another application, as i am very new to Tizen.

Anil

 

 

kimi

hi Anil,

 

As discussed above, Platform privilege is required for it.

 

Kimi.

Halli Kumar

Hi Kimi,

Correct me if I am wrong. From the replies it is clear that we need platform level privilege to get the instance. Fine, lets say we got the platform level privilege, then we will be able to get the AppResource instance of another application. But it is resource instance I believe, will this instance be helpful to know lets say, I want to know whether that application exited gracefully or got terminated because of some unexpected error etc. For eg, on Windows we have ExitCode event handler of a process which can be registered for to get notified when a process exits. Then the exit code will let us know if the exit is gracefull or because of some error.

In the same way, on Tizen if we want to get the status of another application's exit, what is the way?

Sorry, I am new to Tizen and hence exploring. Please guide me or point me where I can get these information.

Thanks in advance.