Languages

Menu
Sites
Language
How to send data through Ewebkit to html file


I am showing google map in tizen native using Ewebkit. Is it possible to send data (like latitude, longitude) to html page through Ewebkit? If not, how can i pass these data to the html page while loading? Here is my code....


Evas_Object* HelloWorldMainView::onCreate( Evas_Object* parent, void* viewParam )
{
setTitle( "app-assist-efl");
char edjPath[PATH_MAX] ={0,};
char *resPath = app_get_resource_path();
if (resPath) {
snprintf(edjPath, sizeof(edjPath), "%s%s", resPath, EDJ_FILE);
free(resPath);
}
Evas_Object* ewk = ewk_view_add(evas_object_evas_get(parent));
evas_object_size_hint_weight_set(ewk, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
char str[100] = "";
snprintf(str, 99, "file://%s%s", app_get_shared_resource_path(), "web/google/index.html");
ewk_view_url_set(ewk, str);
evas_object_move(ewk, 0, 0);
evas_object_show(ewk);
return ewk;
}

Responses

2 Replies
Vikram

Hi,

As your sample code, seems the html page is a static file stored in your local device, under the app's sub-folder, right? If yes, I think you can't send data to the html page.

Jean Yang

Hi, 

If you want to communication with the web page, that means you need get back the data from the web page, and send the request to web page, I think use the curl is better way.

If you just send the url to view the web page, I think the ewk_view_url_set is enough.