How to get Text Input (Tizen Native App)

1k Views Asked by At

I have been working on a Tizen project where I need to calculate BMI of a person. So i need to take input of the name of the user and the height and weight from the user. So far I have created a functional interface where I can navigate users to the options. I can prompt for input and keyboard pops up. But I am not sure how to take and save the input in a variable like we do on android : int/String x = editText.getText()

I have searched a lot, but the tizen community seems a bit more advanced on documentation. Any help will be appreciated. below are some of the code for edit text (for text input). I just need to know how I can extract the input value from it.

Edit Text code:

static Evas_Object *
create_singlelines_editfield_layout(Evas_Object *parent) {
Evas_Object *editfield, *entry, *button, *buttonOk;

editfield = elm_layout_add(parent);
elm_layout_theme_set(editfield, "layout", "editfield", "singleline");
evas_object_size_hint_align_set(editfield, EVAS_HINT_FILL, 0.5);
evas_object_size_hint_weight_set(editfield, EVAS_HINT_EXPAND, 0.5);

entry = elm_entry_add(editfield);
elm_entry_single_line_set(entry, EINA_TRUE);
elm_entry_scrollable_set(entry, EINA_TRUE);
elm_object_part_text_set(entry, "elm.guide", "Enter Your Weight");
evas_object_smart_callback_add(entry, "focused", editfield_focused_cb, editfield);
evas_object_smart_callback_add(entry, "unfocused", editfield_unfocused_cb, editfield);
evas_object_smart_callback_add(entry, "changed", editfield_changed_cb, editfield);
evas_object_smart_callback_add(entry, "preedit,changed", editfield_changed_cb, editfield);
elm_object_part_content_set(editfield, "elm.swallow.content", entry);
//elm_object_part_content_set(editfield, "elm.swallow.button", button);
return editfield;
}

Thanks

1

There are 1 best solutions below

0
On
char const * const text = elm_entry_entry_get(ad->input);

You can see it in action with :

https://github.com/rzr/ekzekuto