Languages

Menu
Sites
Language
Gear s3 : elm_win_add() not working on watch app but works in regular app

In this link : https://developer.tizen.org/forums/native-application-development/gear-s3-possible-communicate-between-our-apps

Vladyslav Prysiazhnyi has good solution for configuring watch app, but I got problems with this method :

"Unfortunately, the creating a new window by elm_win_add() function has bug or something when using it with watch app, for example it will crash if I use elm_entry_add after keyboard shown and using elm_spinner_add after tap to focus on the selection (happened only on device, emulator works fine)

And maybe its a bug because after couple of retry, then the spinner works, and after spinner works, the entry works too"

 

"tried the same call using regular app is work on device, only watch app that is crashed"

 

So in conclusion :

- In emulator, no crash

- In device crash when using elm_entry_add or elm_spinner_add (and tap to focus) - this is ONLY in watch app, regular app working fine

- In device after sometime it works well (after couple of retry)

 

Is there anyway to resolve this ?

 

Thanks

Responses

5 Replies
Yasin Ali

Hi,

Can you share some of your code ?

Tizen is me

    Evas_Object *popupwin;
	Evas_Object *popupconform;
	Evas_Object *circle_surface;
	Evas_Object *naviframe;
	Evas_Object *layout;
	Evas_Object *scroller;
	Evas_Object *entry;
	Elm_Object_Item *naviitem; // naviframe pushed item

	char *edj_path = NULL;

	popupwin = elm_win_add(NULL, "popup", ELM_WIN_BASIC);
	elm_win_conformant_set(popupwin, EINA_TRUE);
	elm_win_autodel_set(popupwin, EINA_TRUE);
	/* Conformant */
	popupconform = elm_conformant_add(popupwin);
	evas_object_size_hint_weight_set(popupconform, EVAS_HINT_EXPAND,
	EVAS_HINT_EXPAND);
	elm_win_resize_object_add(popupwin, popupconform);
	evas_object_show(popupconform);

	circle_surface = eext_circle_surface_conformant_add(
			popupconform);

	// naviframe
	naviframe = elm_naviframe_add(popupconform); // using conform is working fine
	elm_object_part_content_set(popupconform, "elm.swallow.content",
			naviframe);
	eext_object_event_callback_add(naviframe, EEXT_CALLBACK_BACK,
			eext_naviframe_back_cb, NULL); // this must be called
	eext_object_event_callback_add(naviframe, EEXT_CALLBACK_MORE,
			eext_naviframe_more_cb, NULL); // this must be called

	scroller = elm_scroller_add(naviframe);
	evas_object_size_hint_align_set(scroller, EVAS_HINT_FILL, EVAS_HINT_FILL);
	evas_object_size_hint_weight_set(scroller, EVAS_HINT_EXPAND,
	EVAS_HINT_EXPAND);

	edj_path = _create_resource_path("edje/entry.edj");

	layout = elm_layout_add(scroller);
	elm_layout_file_set(layout, edj_path, "entry_layout");
	evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, 0.0);
	evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, 0.0);

	entry = elm_entry_add(layout);
	elm_entry_prediction_allow_set(entry, EINA_FALSE);
	elm_entry_autocapital_type_set(entry, ELM_AUTOCAPITAL_TYPE_NONE);

	elm_entry_single_line_set(entry, EINA_TRUE);
	elm_entry_scrollable_set(entry, EINA_TRUE);
	elm_scroller_policy_set(entry, ELM_SCROLLER_POLICY_OFF,
			ELM_SCROLLER_POLICY_AUTO);

	elm_object_part_text_set(entry, "elm.guide", "entry");


	elm_entry_cursor_end_set(entry);
	evas_object_size_hint_weight_set(entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
	evas_object_size_hint_align_set(entry, EVAS_HINT_FILL, EVAS_HINT_FILL);

	elm_object_part_content_set(layout, "entry_part", entry);
	elm_object_content_set(scroller, layout);

	naviitem = elm_naviframe_item_push(naviframe, "entrytimezone", NULL, NULL, scroller,
			"empty");
	elm_object_focus_set(entry, EINA_TRUE);
	evas_object_show(popupwin);

And for entry.edj

/*
 * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *
 */
collections {
   base_scale: 1.0;
   group { name: "entry_layout";
      parts {
         part { name: "bg";
            type: RECT;
            scale: 1;
            description { state: "default" 0.0;
               color: 0 0 0 0;
            }
         }
         part { name: "top_padding";
            type: RECT;
            scale: 1;
            description { state: "default" 0.0;
               min: 0 30;
               align: 0.5 0.0;
               fixed: 0 1;
               rel1 {
                  relative: 0 0;
                  to: "bg";
               }
               rel2 {
                  relative: 1 0;
                  to: "bg";
               }
               color: 0 0 0 0;
            }
         }
         part { name: "left_padding";
            type: RECT;
            scale: 1;
            description { state: "default" 0.0;
               min: 82 0;
               fixed: 1 0;
               rel1 {
                  relative: 0 0;
                  to: "bg";
               }
               rel2 {
                  relative: 0 1;
                  to: "bg";
               }
               color: 0 0 0 0;
               align: 0.0 0.5;
            }
         }
         part { name: "right_padding";
            type: RECT;
            scale: 1;
            description { state: "default" 0.0;
               min: 82 0;
               fixed: 1 0;
               rel1 {
                  relative: 1 0;
                  to: "bg";
               }
               rel2 {
                  to: "bg";
               }
               color: 0 0 0 0;
               align: 1.0 0.5;
            }
         }
         part { name: "bg_entry";
            type: RECT;
            mouse_events: 0;
            scale:1;
            description { state: "default" 0.0;
               min: 0 39;
               max: -1 39;
               fixed: 1 1;
               rel1 {
                  relative: 0.0 1.0;
                  to_y: "top_padding";
               }
               color: 0 0 0 0;
               align: 0 0;
            }
         }
         part { name: "entry_part";
            type: SWALLOW;
            scale: 1;
            description { state: "default" 0.0;
               min: 0 39;
               max: -1 39;
               fixed: 1 1;
               rel1 {
                  relative: 1.0 0.0;
                  to_x: "left_padding";
                  to_y: "bg_entry";
               }
               rel2 {
                  relative: 0.0 0.0;
                  to_x: "right_padding";
                  to_y: "bg_entry";
               }
               align: 0 0;
            }
         }
      }
   }
}

I just tried it on analog watch sample and it crashed

Yasin Ali

You may try with different win type in

 elm_win_add(NULL, "popup", *** );

For reference:

typedef enum
{
   ELM_WIN_BASIC, /**< A normal window. Indicates a normal, top-level
                     window. Almost every window will be created with this
                     type. */
   ELM_WIN_DIALOG_BASIC, /**< Used for simple dialog windows/ */
   ELM_WIN_DESKTOP, /**< For special desktop windows, like a background
                       window holding desktop icons. */
   ELM_WIN_DOCK, /**< The window is used as a dock or panel. Usually would
                    be kept on top of any other window by the Window
                    Manager. */
   ELM_WIN_TOOLBAR, /**< The window is used to hold a floating toolbar, or
                       similar. */
   ELM_WIN_MENU, /**< Similar to #ELM_WIN_TOOLBAR. */
   ELM_WIN_UTILITY, /**< A persistent utility window, like a toolbox or
                       palette. */
   ELM_WIN_SPLASH, /**< Splash window for a starting up application. */
   ELM_WIN_DROPDOWN_MENU, /**< The window is a dropdown menu, as when an
                             entry in a menubar is clicked. Typically used
                             with elm_win_override_set(). This hint exists
                             for completion only, as the EFL way of
                             implementing a menu would not normally use a
                             separate window for its contents. */
   ELM_WIN_POPUP_MENU, /**< Like #ELM_WIN_DROPDOWN_MENU, but for the menu
                          triggered by right-clicking an object. */
   ELM_WIN_TOOLTIP, /**< The window is a tooltip. A short piece of
                       explanatory text that typically appear after the
                       mouse cursor hovers over an object for a while.
                       Typically used with elm_win_override_set() and also
                       not very commonly used in the EFL. */
   ELM_WIN_NOTIFICATION, /**< A notification window, like a warning about
                            battery life or a new E-Mail received. */
   ELM_WIN_COMBO, /**< A window holding the contents of a combo box. Not
                     usually used in the EFL. */
   ELM_WIN_DND, /**< Used to indicate the window is a representation of an
                   object being dragged across different windows, or even
                   applications. Typically used with
                   elm_win_override_set(). */
   ELM_WIN_INLINED_IMAGE, /**< The window is rendered onto an image
                             buffer. No actual window is created for this
                             type, instead the window and all of its
                             contents will be rendered to an image buffer.
                             This allows to have children window inside a
                             parent one just like any other object would
                             be, and do other things like applying @c
                             Evas_Map effects to it. This is the only type
                             of window that requires the @c parent
                             parameter of elm_win_add() to be a valid @c
                             Evas_Object. */
   ELM_WIN_SOCKET_IMAGE,/**< The window is rendered onto an image buffer
           and can be shown other process's plug image object.
        No actual window is created for this type,
        instead the window and all of its contents will be
        rendered to an image buffer and can be shown
        other process's plug image object*/
} Elm_Win_Type;

 

 

Tizen is me

Hi, thanks for answering, I'll try your suggestion, but is watch app is different than regular app ? Since above code is

working in regular app and even in watch app (in emulator), and after some clicking, it worked in device too, how can we debug this problem ? (crash dont show anything in log)

 

Yasin Ali

Watch application has the capability to use limited resources within watch compared to mobile device or

emulator that is powered by your pc having some extra facilities than actual watch. If you don't get any

crash log then I think you have to investigate using dlog_debug following application flow of control.