I'm developing a web app for Samsung Gear using Tizen 2.4.
My app contains some widgets which the user can configure. Each widget instance will show different (dynamic) information based on the selected config.
Sadly the Galaxy Widgets don't retain their information on reboot. I have a widget which users can make several instances of, and each instance has it's own information.
Since I don't want my users to reconfigure each widget after each reboot, I decided to store the state information of each widget instance in the preferences file.
I thought I could simply use the widget instance id as a key. But I can't find a way to fetch it. The documentation also doesn't mention this. I noticed that there is a function called InstanceID() but I can't get it to work. Here is the widgets documentation
I was hoping to have a widget function such as tizen.widgetservice.getWidgetInstance().id which I could call inside the widget itsellf. But I can't find anything similar.
Is such a thing possible? How can I get the instance ID of the current widget itself?
Crude example about what I want to achieve below. (This is the desired widet code)
The index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<link rel="stylesheet" href="lib/tau.stripped.css" />
<!-- load theme file for your application -->
<link rel="stylesheet" href="css/style.css" />
<script src="language.js"></script>
</head>
<body>
<div id="content"></div>
</body>
</html>
The app.js
(function () {
function init() {
document.getElementById('content').textContent = tizen.widgetservice.getWidgetInstance().id;
}
window.onload = init();
}());
I do NOT want the Widget id, I want the INSTANCE id. So when 1 type of widget has 5 instances, I want to get 5 different ids.