Languages

Menu
Sites
Language
How to emulate home button press.

I want to go to home screen programmatically (Without hardware home button press).

This should make all the open apps to go in background and show home screen.

How to do this?

Which api to call to lower all the apps.

Responses

7 Replies
Armaan-Ul- Islam

It would be 'Application Manager API'. You might like to check out the Guide here:

https://developer.tizen.org/development/guides/native-application/application-management/application-manager

 

I guess the Methodology should be to retrieve all running application contexts. Then destroy all the contexts one by one. A hint that strikes my mind is:

app_manager_foreach_app_context()

app_context_destroy ()

Please check the API references for details and design alternative & working solutions, Thanks.

 

Application Manager API References

Application Context API References

 

Vikram Dattu

Thanks for the link.

But, I don't want to kill running apps.

I just want them to go in background and show home screen.

Pressing home button doesn't kill all running app, it just sends them in background. I want to emulate this behaviour.

Armaan-Ul- Islam

Welcome.

This post here says draging app to backgroung is not possible from Tizen Native yet.

https://developer.tizen.org/forums/native-application-development/how-send-native-app-background-state?langswitch=en

 

My suggestion would be to launch HomeScreen application using Application API. See Code Sample here:

https://developer.tizen.org/community/code-snippet/native-code-snippet/launch-another-application?langswitch=en

 

( Is it your comment on the Code Snippet? Seems you already have the similar Idea I am thinking )

 

I have generated the list of app ids from my devices, If its Tizen mobile then I suspect these:

com.samsung.homescreen
org.tizen.homescreen
com.samsung.homescreen-kiosk
com.samsung.emergency-home
com.samsung.emergency-home-loading
setting-homescreen-efl

And for Tizen wearable I suspect:

com.samsung.w-home
org.tizen.w-home
Vikram Dattu

This works but partially!

com.samsung.homescreen

It minimizes all the apps but doesn't change the state of home screen. If app drawer is opened before, it remains opened.

Other options either do nothing or some weird stuff.

I wished for exact emulation for home button press, but let's see.

 

But, I have problem with this partial solutionas well. Because, will it be definite that homescreen app id will always be

com.samsung.homescreen

?

What if it's not?

Isn't there are few lines of code which do work?

Armaan-Ul- Islam

Yes, it would be 'com.samsung.homescreen' if the app is on Samsung device.

(Unless Samsung changes it themselve) .

 

In case, If its not com.samsung.homescreen , you can easily identify the app id using app manager (sample app) of something like this code snippet

Vikram Dattu

I mean, there must be a proper solution! Right?

Armaan-Ul- Islam

Not necessarily, Providing API function that would virtualize or fake a Home Button press event could be considered a ''nice to have" feature, but not "must have" feature for a mobile development platform.