Languages

Menu
Sites
Language
Gear S app with settings - free text box

Hi,

I am trying to add a free text box to my settings.xml file for the Gear  S app that I'm working on.
Unfortunately, the examples I find do not have free text input. So, is it textbox, text, edittex ?

What is the correct notation of XML code for putting a textbox to my settings ?

Thanks.

 

Responses

7 Replies
AVSukhov

Hello,

You can find info in API Documentation:

http://img-developer.samsung.com/contents/cmm/SamsungGearApplication_Programming_Guide_1.0_140723.pdf

Paragraph: 5.1.4 <Item>

mekabe remain

Thanks. But that document doesn't explain anything.

For example, I couldn't find the setting type for a free text entry (text box ?)

Also, it is not clarified how to parse the settings on the Gear app.

 

any idea on those 2 points ?

 

AVSukhov

Hello,

1. If there is not settings type for free text entry then what makes you think that it exists.

2.  Register an application control in the config.xml file to receive setting changes:

<tizen:app-control>
   <tizen:src name="index.html"/>
   <tizen:operation name="http://tizen.org/appcontrol/operation/remote_settings"/>
</tizen:app-control>

And  implement code for reading the updatedsettings.xml file:

function readUpdatedSetting(doSetting)
{
   if(!doSetting)

   return;

   var path = "wgt-private/updatedsettings.xml";
   tizen.filesystem.resolve(path, function(file) 
   {
      file.readAsText(function(text)
      {
         doSetting((new DOMParser()).parseFromString(text, "text/xml"));
      });
      file.parent.deleteFile(path);
   });
}

For more info please see documentation.

mekabe remain

>>1. If there is not settings type for free text entry then what makes you think that it exists.

Because it should exist. If not, then we wouldn't be able to get text preference from user.

>>2.  Register an application control in the config.xml file to receive setting changes.

I already did that. But I don't understand to which variable the settings will be stored, and how shall I read them in the code.

 

Thanks.

 

mekabe remain

the textbox equivalent seems to be inputbox. I can get a text input now.

But I don't know how to reach the set variables. 

in which documentation can I find that ?

 

 

mekabe remain

I'd appreciate any help please...

 

AVSukhov

Hello,

I think this topic helps you:

https://developer.tizen.org/forums/web-application-development/gear-can-you-explain-settings.xml-and-updatedsettings.xml