Languages

Menu
Sites
Language
Performing Web Search doesn't work on device

Hi,

 

Following Common Application Control description I'm trying to do a web search.

    app_control_create(&app_control);
	app_control_set_operation(app_control, APP_CONTROL_OPERATION_SEARCH);
	app_control_add_extra_data(app_control, APP_CONTROL_DATA_TEXT, "Text to search");
	app_control_send_launch_request(app_control, NULL, NULL);
	app_control_destroy(app_control);

On Emulator it's working fine however on real device (Z3) only web browser is opened but web searching is not being performed.

Anyone know how to resolve this?

Thanks

Edited by: Kamil N on 27 Dec, 2016
View Selected Answer

Responses

6 Replies
Mango Bar

Following app control code works fine in my Z3.

static void btn_web_browser_cb(void *data, Evas_Object *obj, void *event_info)
{
    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.tizen.org");
    if (app_control_send_launch_request(app_control, NULL, NULL) == APP_CONTROL_ERROR_NONE)
        dlog_print(DLOG_INFO, "tag", "Succeeded to launch browser app.");
    else
        dlog_print(DLOG_INFO, "tag", "Failed to launch browser app.");
    app_control_destroy(app_control);

}

Here, com.samsung.browser is samsung browser app id

Kamil N

Thanks for your answer however this code is responsible for opening browser not for doing a web search

Mango Bar

You can do search with that web browser. Write anything in browser address bar , you will get searching result.

Kamil N

It's not what I'm looking for. I want to perform a web searching using given text:

app_control_set_operation(app_control, APP_CONTROL_OPERATION_SEARCH);
app_control_add_extra_data(app_control, APP_CONTROL_DATA_TEXT, "Text to search");

It is descbied here

It works fine on emulator but not on the device. 

Mark as answer
Mango Bar

Use following code for web searching. Add your search keyword in query string.

        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/search?q=Text to search");
	app_control_send_launch_request(app_control,NULL,NULL);
	app_control_destroy(app_control);

 

Kamil N

Thanks, I used it followed your suggestion. It works as expected but not working 

APP_CONTROL_OPERATION_SEARCH

should be marked as a BUG in tizen. 

 

Regards