Languages

Menu
Sites
Language
Problems with native browser

Hello,

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

Thanks you in advance,

Responses

2 Replies
Mohammad Nur Nobi
void open_url(const char *uri_url)
{
    app_control_h app_control;
	int error_code = 0;

	INF("number_uri : [%s]", uri_url);

	error_code = app_control_create(&app_control);
	if(error_code != APP_CONTROL_ERROR_NONE) 
		ERR("app_control_create Error!);
	
	error_code = app_control_set_operation(app_control, APP_CONTROL_OPERATION_VIEW);
	if(error_code != APP_CONTROL_ERROR_NONE) 
		ERR("app_control_set_operation Error!);

	app_control_set_uri(app_control, uri_url);

	error_code = app_control_send_launch_request(app_control, NULL, NULL);
	if(error_code != APP_CONTROL_ERROR_NONE) 
		ERR("app_control_send_launch_request Error!);

	error_code = app_control_destroy(app_control);
	if(error_code != APP_CONTROL_ERROR_NONE) 
		ERR("app_control_destroy Error!);
}

 

Now, call 
open_url("www.google.com");

Alex Dem

Hi,
In additional, fyi: here is common tutorial https://developer.tizen.org/dev-guide/2.3.1/org.tizen.tutorials/html/native/app_framework/application_tutorial_n.htm#use
and please do not forget to add  http://tizen.org/privilege/appmanager.launch  privilege into manifest.
Alexey.