I want to write a native application in c to get the value of region in Tizen. The compiled c code must be run on the Tizen phone and I need to get the Value of language region. The callback function i got from Tizen source is
int app_cb_broker_appcore_region_changed(void *data)
{
app_region_format_changed_cb region_changed_cb;
region_changed_cb = app_context.callbacks->region_format_changed;
if (region_changed_cb != NULL)
{
region_changed_cb(app_context.user_data);
}
return 0;
}
How to use this function to get the value of current region?
I am not familiar with Tizen, but as far as I can see in the code, there is a struct variable (app_context) that has an attribute (callbacks) which should be a pointer to a struct of callback function pointers. One of those function pointers is region_format_changed. So you should define your function and pass it to that pointer so that it gets called (back) and you can handle the parameters which is passed (app_context.user_data).
For example.
Step 1. You define and write your callback function
void my_region_changed_cb(typeof(app_context.user_data) data)
{
//The code of your handler here
}
Step 2. Somewhere in your initialization code you set the callback attribute
//...
app_context.callbacks->region_format_changed = (&my_region_changed_cb);
//...
Hope it helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With