Languages

Menu
Sites
Language
Get Actove window

Hi List,

I am working on a Native app in Tizen 2.3 Mobile. (Z1 target)

I have the requirement to get the Current active window and its AppID. That is I am interested in the application displayed on the device.

Thru App manager I can get all the contexts for all the running apps. But there is no way to determine the active on Display app.

Any method to get the currently displayed App details. It will be helpful if I can get the currently displayed window's PID. Which I can match to the running context's PID.

 

I have another requirement of getting an event when ever the Status Bar is dragged down.

 

Please share your inputs.

regards,

Ashwini

Responses

3 Replies
Ashwini Kumar

I see in earlier Tizen version there was an API getActiveApp()...

anything similar on 2.3?

Alex Dem

Hi,
I do not remember exactly, but afaik in 2.2.1 : was api to detect current active app and ability to add listener to detect when active app was changed, but I did not remeber api to get active window (frame/form) from other app.
afaik no such api in 2.3 too. All I have found you could:
1) Retrieves all application contexts of running applications with app_manager_foreach_app_context
2) check that desired app is running with app_manager_is_running    (    const char *     app_id,
bool *     running ) .
Alexey.

Leo Liao

As alex said, you could test if  your app is running by app_manager_is_running(). Several applications can be running at the same time, but only one can get focus. I do not see Tizen provided the API

Tizen application can have following states:

State                     Description

READY                   Application is launched.
CREATED              Application starts the main loop.
RUNNING             Application is running and visible to the user.
PAUSED                Application is running but invisible to the user.
TERMINATED      Application is terminated.

So only one application could be in RUNNING state, other applications loose focus entered into PAUSED state.

The application state changes are managed by the underlying framework.

We know there are two iterator functions are used to travel through a list of applications. The app_manager_foreach_app_context() function is used in running applications and the app_manager_foreach_app_info() function is used in available applications.

So it should can be retrieve application state from the handle app_context_h. But unfortunately, Tizen does not expose the method to retrieve state from the handle app_context_h, also it does not expose a method to get which app get focus. If you really need to know it, there should be a new method designed to get these information by Application Manager.

You need to raise this question to Samsung framework development team to ask them to add this API.