Languages

Menu
Sites
Language
How to start a native browser from my app?

Hello,

Could you please suggest how to open a web url in native device browser from my app? 

Thanks you in advance, Maria

Responses

5 Replies
Alex Dem

Hi,
for implicit launch:

        app_control_h app_control;

        app_control_create(&app_control);
        app_control_set_operation(app_control, APP_CONTROL_OPERATION_VIEW);
        app_control_set_uri(app_control, "http://www.google.com");

        if (app_control_send_launch_request(app_control, NULL, NULL) == APP_CONTROL_ERROR_NONE){}
        else {}

        app_control_destroy(app_control);

For explicit launch (if you know AppId of browser):

        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, "com.samsung.browser");
        app_control_set_uri(app_control, "www.google.com");

        if (app_control_send_launch_request(app_control, NULL, NULL) == APP_CONTROL_ERROR_NONE) {}
        else {}

        app_control_destroy(app_control);

Please add also http://tizen.org/privilege/appmanager.launch privilege into manifest.

Alexey.

rohit sijwali

If i want to open it in explicitly and want size of browser to be set how can i do that?

Alex Dem

Hi,
What do you mean regarding size of browser? Is it fullscreen mode or how to select  kind(type) of browser if there is more than 1 browser?
Alexey.

rohit sijwali

Is there any extra data so that i can open the browser in desired size(width,height).

Alex Dem

Hi,
I did not face with such possibility (did not find in dev-guide)

Here is regarding Browser (it's for Web app but for Native should be the same)
https://developer.tizen.org/development/guides/web-application/tizen-features/application/application/common-application-controls
Look like only http://tizen.org/appcontrol/data/text key is available as extra data key for "search" via browser.
But maybe someone else could help.
Alexey.