diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..77ea506
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+.settings/
+.sign/
+
+.metadata/
diff --git a/.settings/.jsdtscope b/.settings/.jsdtscope
deleted file mode 100644
index c487c06..0000000
--- a/.settings/.jsdtscope
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/.settings/org.eclipse.wst.css.core.prefs b/.settings/org.eclipse.wst.css.core.prefs
deleted file mode 100644
index 5ddc6bd..0000000
--- a/.settings/org.eclipse.wst.css.core.prefs
+++ /dev/null
@@ -1,2 +0,0 @@
-css-profile/=org.eclipse.wst.css.core.cssprofile.css3
-eclipse.preferences.version=1
diff --git a/.settings/org.eclipse.wst.jsdt.ui.superType.container b/.settings/org.eclipse.wst.jsdt.ui.superType.container
deleted file mode 100644
index 3bd5d0a..0000000
--- a/.settings/org.eclipse.wst.jsdt.ui.superType.container
+++ /dev/null
@@ -1 +0,0 @@
-org.eclipse.wst.jsdt.launching.baseBrowserLibrary
\ No newline at end of file
diff --git a/.settings/org.eclipse.wst.jsdt.ui.superType.name b/.settings/org.eclipse.wst.jsdt.ui.superType.name
deleted file mode 100644
index 05bd71b..0000000
--- a/.settings/org.eclipse.wst.jsdt.ui.superType.name
+++ /dev/null
@@ -1 +0,0 @@
-Window
\ No newline at end of file
diff --git a/.sign/.manifest.tmp b/.sign/.manifest.tmp
deleted file mode 100644
index 69ee1e0..0000000
--- a/.sign/.manifest.tmp
+++ /dev/null
@@ -1,73 +0,0 @@
-.git/COMMIT_EDITMSG__DEL__zcfTfR42Hp+H75bMNYkDQLV9RYb7Fr10Bnmdza0/wbk=
-.git/HEAD__DEL__9vK5RfbEEbAro9qces6I3PcbavZbouDYmqgpAAQrWhA=
-.git/config__DEL__/Rbd4AUUTUPjlJZYYUUBZKcEeNgeUuzmriIZUFh7T/s=
-.git/description__DEL__hatsFj1DoX6pz3eIMIvKFGbxsKjRzJLibpv2PaQGKu4=
-.git/hooks/applypatch-msg.sample__DEL__AiNJeguLAzqlijpSG4YphpOGz3qw4vEBlj0yiqYhk/c=
-.git/hooks/commit-msg.sample__DEL__H3TV6SkpebVz69WXQdRsuT/zkazdCD00C5Q3B1PZJDc=
-.git/hooks/fsmonitor-watchman.sample__DEL__9IPZjlVDNG3iWkVWsl310pYOz/Dq6SVe2F+3DV0Ex3k=
-.git/hooks/post-update.sample__DEL__gXZa8trvMjBh3LxeYfwWSBy3SzusmtihdLGGUjWG9sU=
-.git/hooks/pre-applypatch.sample__DEL__4VxbRp6j4KaVvqbyyCvPjmKCEHSTnd2Ft34AB/8WVHU=
-.git/hooks/pre-commit.sample__DEL__EscjI1Ex8cVXbGUqwqCgB/JhqTwN3ERbHc7mzZjjB4g=
-.git/hooks/pre-push.sample__DEL__SxEZ4eE6ISVxl29K7neEfNvUCXhUbWJzpVfiOJgaQNE=
-.git/hooks/pre-rebase.sample__DEL__T+vOhneQBSM4B29OZsxH77FIedGAl9HWHIJhhZ6qp7M=
-.git/hooks/pre-receive.sample__DEL__pMPSuce7P9jRRBwxvU7nGlldZrRPz0ndsxAlIyAWmYk=
-.git/hooks/prepare-commit-msg.sample__DEL__6d3KpBif3dJe2X/Ix4nsp7bKFjkLI5KuMnbwyOGqRhk=
-.git/hooks/update.sample__DEL__dRwDcyACTsLuJ1fz/64LEK0slGNnaE5wWdTcl+rH5DE=
-.git/index__DEL__pyS8kEZfsVBGpOv9SvlFqo6UBj2HpGQgNcHX4Rs3Utg=
-.git/info/exclude__DEL__ZnH+g7egfIky7okWTR8nk7IxgFjri5jcXAbuClo7DsE=
-.git/logs/HEAD__DEL__wpmVLUxvBL3eAdGAtZjwyYpbwNfeY94DatVmpCucCrs=
-.git/logs/refs/heads/master__DEL__wpmVLUxvBL3eAdGAtZjwyYpbwNfeY94DatVmpCucCrs=
-.git/logs/refs/remotes/origin/master__DEL__btdsa2RxeDDqQsRq2xXhygBmAPEBTar3K9p6FIPo2Ng=
-.git/objects/02/741fe0d44ace36d88f500de55fe02f60e39681__DEL__cVGnHJSbIxxTbHZ4cc0XEetbMGr4Ig04SwFvCJL0tcg=
-.git/objects/05/bd71b6ec2c1982d1e8a5653073281994564ae8__DEL__PXNsl0l7EuMPFASARrf2c4vkfoU8MqkL51Cf4LHE3Ik=
-.git/objects/07/89c5456f19123401bbbea06ccc14cd42067219__DEL__wl7lmcXANjTQcOsw471SlI61qAqEpWF6oTpIbNZsGwQ=
-.git/objects/13/fb568ca97112e3039b47ab7b9f36de9834ee89__DEL__rqiQE/qsgBRiZw6iG+cFJxVCHRIhuay+VEK+82gvaFQ=
-.git/objects/1a/30a49ab1682a8c70f37f960b7d1871c5942eb9__DEL__cTC88UJJXLJyBu7pmRkB07i2eLJk4EVv/DBrMDlG2Jk=
-.git/objects/1c/1a4d080ef81238e544eab07ae38d6e727dba85__DEL__NCXGus1XG1CzGfD8cnKh9R6Yoh5qQibiIvC1KioagDU=
-.git/objects/23/86351522759e2a0b051a0cb0e4b35a56dff088__DEL__9KKkz5G0UwI91vXfoRqDff+Kg+vZkM5aU2GGZ77/nug=
-.git/objects/25/e212adedb872da5b017d291d48f55c61a38b29__DEL__QDKqylvpL5aKPcDz/9zSuGXDiGaa0HESAG0hK13UMpk=
-.git/objects/28/7c88e226a4ec4c071904c15bf4f645ac3cd2dc__DEL__wwu4NPLQylGD4xQh9o083s2OtoFpL3dRLSMUfxyXunQ=
-.git/objects/2d/64341eef53052d2dacc5f5a4ad01c75b8dd652__DEL__dk7aYwpCa5ILFLFs53nmgi7a/fhAWv4OpIqistb4Qm4=
-.git/objects/3b/d5d0a4803967bc0bf72a7dd66d7e292ed2e586__DEL__NWl0p1AAhqGIhpiPNnefVL7uzkqYFG1ZET6Oni7l45M=
-.git/objects/4a/b357c7634f49e522aeaaedefa83c4ff08443a9__DEL__a0Cz4lWC+0xWCzZUYUQL5O/bt35C7pRZ1XW3fOKXBBo=
-.git/objects/4e/35166f13f37f8c3aed30d3019174573a026f4a__DEL__QvXy5hjAaFV6M3+qW1WfnrX4ZyFuiBAqpnCqfAheYXE=
-.git/objects/53/f31f54130c9a3441480f9e416f805437fb71c9__DEL__TI9vZZsmF1Ydh6O/gd51GoLyXZZyto7wjobmKY2woQo=
-.git/objects/5d/dc6bd5f24cf4e67a53e20384dfc868809d10b3__DEL__zIPachBagXO0J8zFADVIaaSzJRpTr24o5b0VEKPnHS0=
-.git/objects/66/de0dcf1f16eb3dfe1aedf78790b4e002c08516__DEL__FZmqOATlAZ5v6hGivuWkZ9NLyIA0B464HQ9hvqMUJBQ=
-.git/objects/6f/2bf25b4a2c42093a219e1f448e60df4691edd9__DEL__GIQkHw2nvNnV/t1FJI6M9nGukDfi3PkzR+YQVBdkoew=
-.git/objects/78/fdbb1d64048da4271091ddb1768f8670919069__DEL__3hbwK3TLaW1TVvT461gSaigsje2W/Ol74Ps+ElGSyIQ=
-.git/objects/7c/a3e1f9fd26cc61f712e13322b05c7e24ce1813__DEL__HvEW3s9pr5lX/U/e4ZOjuGQ5UKstesDe/4eJic1wvlo=
-.git/objects/84/f503801400f81a402f3fb3f2830ec00ab4c630__DEL__evQo0GymDPIEFqd5BUKUqhrrNQXb9nr3wqTmCHV+J48=
-.git/objects/86/49fa565d87dd3c332e8e318c779b8e53ffea0b__DEL__C3Xw+yuUDSdezXAhqzBXlRS1SPXOSn2AyLwueNf7ug4=
-.git/objects/8a/1d8c688268b802bd5ad18a64b883016b132076__DEL__fB08qAMNyvrNiut/zN7hw0epaAbaQDnXxDBRQx7HGlE=
-.git/objects/8e/5d802326c308c497e217c4d5b600f2f11ac3c4__DEL__I9nY+iedh8TO2HV91DIps+SueQgcc0WCoPaYqIhzUq0=
-.git/objects/90/a27f9cea6e8f02e05a8bbab5d14650e3e932af__DEL__lpDm120MOA6vW/mrh0cy1pu67SJ6dPu/cY8rN8I7xW8=
-.git/objects/99/96115961d2aa418fb03ff90d529f642f4f7261__DEL__3VGlqOkDSaru/bmv6eS/4byvPdKJeBDS6Bo/lnU2bgY=
-.git/objects/9d/ab2d1408775ca4094f6806e481cf85e8709ec4__DEL__8dWV9Unqdt7vmdOSzL5TGY9RETmJ1B9ZpX7jLIO3qBs=
-.git/objects/9f/29e0dab7efd2ce2bda4adb262584b22321e534__DEL__KJdBI+69yuhRSrTwXepr5NJxdIXgmy1V+2rtaOmYYok=
-.git/objects/9f/8c12f57065dff219dd33568a55e81ffee69f4e__DEL__lf8xF9EWtMhpmIGzqX+k8LnCZI0pmzyvQrchmCzvxGg=
-.git/objects/a5/5db3f213c6fd9f1611473c99181cb6bd8ce9f2__DEL__Hljb7WQV6HW2SlXWnf79Z0JHFEEXiF854oWTNGeoqG0=
-.git/objects/b6/2f236dddb5e68cc7e60e76c9f773b0eb90ce31__DEL__mEncbCDO5beLVf4GshoEy6LOyko6GMkMcEErkep3JDM=
-.git/objects/c4/87c068cae1a73c7bf7239555c1329610507ec9__DEL__PBdNy+ElDdG/ulzGKnoHefxPQEVB5zq5pMe/pZHZRAc=
-.git/objects/c8/c746454b625dbe8b6259a6bd2d4f0cd03f0d24__DEL__KKHH2pD0qfizOadYZbJkZrm29T/oVjobBOqJM+rRwYg=
-.git/objects/d1/cc196d5d84ce44efa808521b9ad8fdc51ecead__DEL__12mjogpHHWqxDDPm4hsC7303iOQBAb4eoC4CjMKYPYg=
-.git/objects/d4/7f9cd915695b4798f907982d77646a99bf4264__DEL__N8tjv5j1qEgx6o08Q8GEEq+c5oVBme8ZkQ1esJ7fjTM=
-.git/objects/d6/45695673349e3947e8e5ae42332d0ac3164cd7__DEL__bK1/lEV5blLPpFrn/ZNVdLDE2RnlA4SnQhDpURW+znc=
-.git/objects/d6/732ea134c5ff05e87ee89dbad7c5f97bb7724b__DEL__hTPwSlNSKTaSuUMuvBi0AzOTFOEpKwcbrCd4aQ/6cHk=
-.git/objects/d6/e10997a5611ce965e0c34551b973478dc7172e__DEL__vm4JtKqoDEF/pwWpYnqKnfacIDpptH1kPV47pgSIcH0=
-.git/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391__DEL__FkxfqAZ/rPGkPwnOPQ416/U6f1cj7L8VqGZ8/FPCb2w=
-.git/objects/e6/e64a7a10f9c3f4c2218db906b18d6c96f153e1__DEL__ORQK4eEcZ9zLwMxPa08xowgH4TMPKDOsAJxkYscIos8=
-.git/objects/f0/fc0dd5e890f0a3929c22ac364c71e6623f4e8e__DEL__zgSOtLXhZmKmL98vDoytepbOXYqk43npI3T5HsIbgjc=
-.git/refs/heads/master__DEL__+tXu3ZGHKDRFy0S40mBgm+tGdOosszeJESBI/NtHvnM=
-.git/refs/remotes/origin/master__DEL__+tXu3ZGHKDRFy0S40mBgm+tGdOosszeJESBI/NtHvnM=
-LICENSE.APLv2__DEL__z8d0m5b2O9McPEK1xHG/dWgUBT6EfBDz6wA0F7xSPTA=
-NOTICE__DEL__ijjaB8GEO5OJP/jK6n7Hr3vZFI9gy8ocoDhviViKNnU=
-README.md__DEL__47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=
-config.xml__DEL__coG2QfwI4dJYdeBpyPbkCmdN8sAQ8/P74NTeGIx6kWk=
-css/style.css__DEL__YCx4tiqoai276nR9sDZsPUcn0/z3Xi4XYMDXIcnGRhU=
-icon.jpg__DEL__2ZXXmZkVOzH42v5SF/c73PYgxmcHHRii2/gn73UUhlo=
-icon.png__DEL__kd617JYkX8IEUQERd72gL14zj6pgNVcKiSRAFQz6HX8=
-index.html__DEL__CdntWzqB8DQYZKIF68hQqqZVLQPbLRf1hXjozO+agxA=
-js/app.js__DEL__qAH6L1c0b9HsljfVO01W4pPPJppPjS4q9bbHtrfap1o=
-version.txt__DEL__jFS/q38a6b0acUjq5B57Co9K03JuDKxw+COi1F255gw=
-author-signature.xml__DEL__zbeHy8sdYpGk8PQBOxft9I40IMiu1StArvdue2tmgvM=
diff --git a/.sign/author-signature.xml b/.sign/author-signature.xml
deleted file mode 100644
index 94d0352..0000000
--- a/.sign/author-signature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EBCwUAA4IBAQB/ZlNMTzlIHqC3mFSq
-ptuQDZG96XnYqiWsbYkqGgNhcq6c/B3TQsg7Z8cxXY/eqJQDN5gbrIpiUugMRdSOpAEcxF3lwd5k
-oOzVLn+3I7x1k6Q4pZdi1fJx+1XjCtrQgPqtvwM77urNqIA1MSG6HUPxYAKkRKjWPsg346E8S/c1
-Hq4UVBYEFcDC467uvWtYjxjEVQTmNUaUcQLU9P6VEL4QW+t7V54IN6IJDr9HoOGSgApxIBDDU46b
-MUwl+yK0GPvhrviwfVPkfmys1hn5N+gWectQVpBB1gbfy2KlLCCvW/Kl1VmtYz1kWwTyG8bwcjE0
-GLkwKNN5lPod+FmMhuW9
-
-
-
-
-
\ No newline at end of file
diff --git a/.sign/signature1.xml b/.sign/signature1.xml
deleted file mode 100644
index b097cff..0000000
--- a/.sign/signature1.xml
+++ /dev/null
@@ -1,356 +0,0 @@
-
-
-
-
-
-
-zcfTfR42Hp+H75bMNYkDQLV9RYb7Fr10Bnmdza0/wbk=
-
-
-
-9vK5RfbEEbAro9qces6I3PcbavZbouDYmqgpAAQrWhA=
-
-
-
-/Rbd4AUUTUPjlJZYYUUBZKcEeNgeUuzmriIZUFh7T/s=
-
-
-
-hatsFj1DoX6pz3eIMIvKFGbxsKjRzJLibpv2PaQGKu4=
-
-
-
-AiNJeguLAzqlijpSG4YphpOGz3qw4vEBlj0yiqYhk/c=
-
-
-
-H3TV6SkpebVz69WXQdRsuT/zkazdCD00C5Q3B1PZJDc=
-
-
-
-9IPZjlVDNG3iWkVWsl310pYOz/Dq6SVe2F+3DV0Ex3k=
-
-
-
-gXZa8trvMjBh3LxeYfwWSBy3SzusmtihdLGGUjWG9sU=
-
-
-
-4VxbRp6j4KaVvqbyyCvPjmKCEHSTnd2Ft34AB/8WVHU=
-
-
-
-EscjI1Ex8cVXbGUqwqCgB/JhqTwN3ERbHc7mzZjjB4g=
-
-
-
-SxEZ4eE6ISVxl29K7neEfNvUCXhUbWJzpVfiOJgaQNE=
-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IGA1UECAwLU291dGggS29yZWExDjAMBgNVBAcMBVN1d29uMSYwJAYDVQQKDB1TYW1zdW5nIEVs
-ZWN0cm9uaWNzIENvLiwgTHRkLjEPMA0GA1UECwwGTW9iaWxlMTAwLgYDVQQDDCdTYW1zdW5nIFRp
-emVuIERFVkVMT1BFUiBQdWJsaWMgQ0EgQ2xhc3MwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK
-AoIBAQCkqW9d0zO5NFOc7u164DKe9Yx+yEgUnsbhnJasqHaqT71qaMxyCOjyysZi7gGycDcgmLcU
-tr2wSMTGWPibK8SrJ8bV/J1cy9nTpljM3s+lbPIVVxZeufhJkU79tXImHLolERd0vui+rj0Xpd9O
-zlyNTRt0+PWVT1taWcbfHL7pUD25hMkTc8C3bC+dUoT1/RhCkXgmUvIor3EnnU0rBtAl4qNtg5y1
-7RLT8dyicieAHCcW923YC/ngMZxnBjbL2Ht1RBUvrL6K3X5+l0VeF4qC3g7TKm/a/SGjq12ZD4sc
-7rglzjSNlTVSGag6/2WkqxE6HheEBWaloYOdauzwydFNAgMBAAGjEDAOMAwGA1UdEwQFMAMBAf8w
-DQYJKoZIhvcNAQELBQADggEBAG88wKjKeTbj5I6wMEvRihd+gWrESJX3bXUSlHWjUfYKcvg3GzM9
-cdooscqJdYgN8ezQuYiJQRk7BaPHSlPGkchsPUjvSM6WvIn9IT+VsEuVBrZNbZMSv6lM6wNig3TE
-h2OxFTW6Bt8mCZB74EP2wb+39Fr5aJwWvmkxQjct3/O+GYPQhe0Lu1qpbbMhzafYYybSmO+om02V
-cTWyJ/vtLUNyGfN7aHyBm6PFE5piAfpBaO9Az+zWil1HOsnzu1tGGnyV6IzQ/UiIo5P2sD8I5lEO
-Xdf9Eicy9y5z2Ci2zrmDcAGWL8o5wOWrCqML2ijximFzyQ/swlMC9xBIX9RCFws=
-
-
-
-
-
\ No newline at end of file
diff --git a/.tproject b/.tproject
index 7ca3e1f..dd94734 100644
--- a/.tproject
+++ b/.tproject
@@ -7,5 +7,6 @@
+
diff --git a/CalendarWatch.wgt b/CalendarWatch.wgt
index f804e46..d9fad5d 100644
Binary files a/CalendarWatch.wgt and b/CalendarWatch.wgt differ
diff --git a/certificates/author.p12 b/certificates/author.p12
new file mode 100644
index 0000000..a21f6f9
Binary files /dev/null and b/certificates/author.p12 differ
diff --git a/certificates/distributor.p12 b/certificates/distributor.p12
new file mode 100644
index 0000000..476f17b
Binary files /dev/null and b/certificates/distributor.p12 differ
diff --git a/config.xml b/config.xml
index 2329725..363d070 100644
--- a/config.xml
+++ b/config.xml
@@ -1,6 +1,6 @@
-
-
+
+
Raphael Maenle
@@ -13,5 +13,6 @@
+
diff --git a/js/app.js b/js/app.js
index 03240c2..1c29d8a 100644
--- a/js/app.js
+++ b/js/app.js
@@ -11,10 +11,18 @@
* 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.
+ * limitations under the License.
*/
-var events;
+
+/* 'downloads' for debugging,
+ * 'wgt-private' for any release */
+var STORAGE_SPACE = "wgt-private";
+var SHORT_WAIT = 10000;
+var LONG_WAIT = 600000;
+var wait_time = LONG_WAIT;
+var events = null;
+var deviceFingerprint = null;
var eventsTimeStamp = 0;
(function() {
@@ -24,85 +32,207 @@ var eventsTimeStamp = 0;
ctxContent,
center,
watchRadius;
-
- function readJSON(path) {
- var xhr = new XMLHttpRequest();
- xhr.open('GET', path, true);
- xhr.responseType = 'blob';
- xhr.onload = function(e) {
- if (this.status == 0) {
- var file = new File([this.response], 'temp');
- var fileReader = new FileReader();
- fileReader.addEventListener('load', function(){
- events = JSON.parse(fileReader.result);
-
- var onError = function(e) {
- console.log('Error!' + e.message);
- };
-
- var onResolveSuccess = function(dir) {
- var onListFilesSuccess = function(files) {
- files.forEach(function(file) {
- if (!file.isDirectory) {
- dir.deleteFile(file.fullPath, onDeleteSuccess, onError);
- }
- });
- };
-
- dir.listFiles(onListFilesSuccess, onError);
- };
-
- var onDeleteSuccess = function() {};
-
- tizen.filesystem.resolve('/opt/usr/media/Downloads', onResolveSuccess, onError);
-
-
-
- });
- fileReader.readAsText(file);
- }
+
+
+ function deleteFile(name, callback) {
+
+ /* successful resolution of wgt-private */
+ function onsuccess(dir){
+ var dirfile = null;
+ try {
+ dirfile = dir.resolve(name);
+ } catch (exc) {
+ console.log(exc.message)
+ }
+
+ // if file not existed, call callback with null
+ if(dirfile == null) {
+ callback();
+ return;
+ } else {
+
+ // if file was found, delete it
+ dir.deleteFile(dirfile.fullPath, function() {
+ console.log("deleted");
+ callback();
+ },
+ function(e) {console.log(e)});
+ }
+ }
+
+ function onerror(e){
+ console.log("error"+e);
}
- xhr.send();
+
+ function onsuccessPermission(){
+ tizen.filesystem.resolve(STORAGE_SPACE, onsuccess, onerror, "rw");
+ }
+
+ function onErrorPermission(e){
+ console.log("error "+ JSON.stringify(e));
+ }
+
+ tizen.ppm.requestPermission("http://tizen.org/privilege/mediastorage", onsuccessPermission, onErrorPermission);
+ }
+
+ function clearDownloads() {
+ var onError = function(e) {
+ console.log('Error!' + e.message);
+ };
+
+ var onResolveSuccess = function(dir) {
+ var onListFilesSuccess = function(files) {
+ files.forEach(function(file) {
+ if (!file.isDirectory) {
+ dir.deleteFile(file.fullPath, onDeleteSuccess, onError);
+ }
+ });
+ };
+
+ dir.listFiles(onListFilesSuccess, onError);
+ };
+
+ var onDeleteSuccess = function() {};
+
+ tizen.filesystem.resolve('/opt/usr/media/Downloads', onResolveSuccess, onError);
+
}
- function getJSON() {
- var downloadRequest = new tizen.DownloadRequest('https://longitudecalendar.com/userinfo/107971745944668140075/calendarevents.json', 'downloads');
- tizen.systeminfo.getPropertyValue('NETWORK', function(networkInfo) {
- if (networkInfo.networkType === 'NONE') {
- console.log('Network connection is not available.Download is not possible.');
- downloadRequest = null;
- }
- });
+ function getJsonFile(name, callback) {
+ console.log("searching for File");
+ /* successful resolution of wgt-private */
+ function onsuccess(dir){
+ var dirfile = null;
+ try {
+ dirfile = dir.resolve(name);
+ } catch (exc) {
+ console.log(exc.message)
+ }
- var listener = {
- /* When the download progresses (interval is platform-dependent) */
- onprogress: function(id, receivedSize, totalSize) {
- console.log('progress for id: ' + id);
- console.log('received: ' + receivedSize + ", total: " + totalSize);
- },
+ // if file not existed, call callback with null
+ if(dirfile == null) {
+ callback(null)
+ return;
+ } else {
+
+ // if file was found, call callback with json
+ dirfile.openStream("r", function(fs) {
+ callback(JSON.parse(fs.read(dirfile.fileSize)));
+ fs.close();
+ });
+ }
+ }
+
+ function onerror(e){
+ console.log("error"+e);
+ }
+
+ function onsuccessPermission(){
+ tizen.filesystem.resolve(STORAGE_SPACE, onsuccess, onerror, "rw");
+ }
+
+ function onErrorPermission(e){
+ console.log("error "+ JSON.stringify(e));
+ }
+
+ tizen.ppm.requestPermission("http://tizen.org/privilege/mediastorage", onsuccessPermission, onErrorPermission);
+ }
+
+ function readJSON() {
+ /* - requests permission to view media storage
+ * - resolves the file 'calendarevents'
+ * - opens stream and reads entire file as json
+ */
+
+ getJsonFile("calendarevents", function(eventlist) {events = eventlist;});
+ }
+
+ function getNewFingerprintFromServer() {
+ getFileFromServer("/devicefingerprint.json", function() {
+ console.log("getting device fingerprint from server")
+ getJsonFile("devicefingerprint", function(df) {devicefingerprint = df; console.log(devicefingerprint)});
+ });
+ }
+
- /* When the user pauses the download */
- onpaused: function(id) {
- console.log('Paused with id: ' + id);
- },
+ function getDeviceFingerprint() {
+ // check if device id set already as global, if it is return
+ if(deviceFingerprint != null)
+ return;
+
+ // otherwise, check if there is a devicefingerprint file in wgt-private
+ // if there is, open it up and get your device ID from it
+ getJsonFile("devicefingerprint", function(df) {
+ if(df != null) {
+ deviceFingerprint = df;
+ } else {
+ // otherwise, ask the longitude server for a device fingerprint file
+ getNewFingerprintFromServer();
+ }
+ })
+
+ }
+
+ function getFileFromServer(route, callback) {
+ console.log("getting file");
+ var server = "https://longitudecalendar.com/"
+ var downloadRequest = new tizen.DownloadRequest(server + route, STORAGE_SPACE);
+ tizen.systeminfo.getPropertyValue('NETWORK', function(networkInfo) {
+ if (networkInfo.networkType === 'NONE') {
+ console.log('Network connection is not available.Download is not possible.');
+ downloadRequest = null;
+ }
+ });
+
+ var listener = {
+ /* When the download progresses (interval is platform-dependent) */
+ onprogress: function(id, receivedSize, totalSize) {
+ console.log('progress for id: ' + id);
+ },
- /* When the user cancels the download */
- oncanceled: function(id) {
- console.log('Canceled with id: ' + id);
- },
+ /* When the user pauses the download */
+ onpaused: function(id) {
+ console.log('Paused with id: ' + id);
+ },
- /* When the download is completed */
- oncompleted: function(id, fullPath) {
- console.log('Completed with id: ' + id + ', full path: ' + fullPath);
- readJSON(fullPath);
- },
+ /* When the user cancels the download */
+ oncanceled: function(id) {
+ console.log('Canceled with id: ' + id);
+ },
- /* When the download fails */
- onfailed: function(id, error) {
- console.log('Failed with id: ' + id + ', error name: ' + error.name);
- }
- };
- downloadId = tizen.download.start(downloadRequest, listener);
+ /* When the download is completed */
+ oncompleted: function(id, fullPath) {
+ console.log('Completed with id: ' + id + ', full path: ' + fullPath);
+ callback();
+ },
+
+ /* When the download fails */
+ onfailed: function(id, error) {
+ console.log('Failed with id: ' + id + ', error name: ' + error.name);
+ }
+ };
+ tizen.download.start(downloadRequest, listener);
+ }
+
+ function updateCalendar() {
+
+ if(deviceFingerprint == null) {
+ console.log("no fingerprint, loading from file or server");
+ getDeviceFingerprint();
+ wait_time = SHORT_WAIT;
+ return false;
+ }
+
+ function deleteCallback() {
+ console.log("done");
+ console.log("getting new calendar events");
+ getFileFromServer("device/" + deviceFingerprint.deviceName + "/calendarevents.json", readJSON);
+ }
+
+ console.log("deleting calendarevents");
+ deleteFile("calendarevents", deleteCallback);
+
+ return true;
}
/**
@@ -258,8 +388,8 @@ var eventsTimeStamp = 0;
function renderEarth(date, minute, second) {
- earthColor = "#0077BE";
- earthDistance = document.body.clientWidth / 2 - 120;
+ var earthColor = "#0077BE";
+ var earthDistance = document.body.clientWidth / 2 - 120;
renderCircle(ctxContent, polToCart(earthDistance, minuteToAngle(minute + second / 60)), 10, earthColor);
}
@@ -291,9 +421,7 @@ var eventsTimeStamp = 0;
* @private
*/
function drawWatchLayout() {
- var grd,
- angle,
- i,
+ var i,
j;
// Clear canvas
@@ -347,32 +475,35 @@ var eventsTimeStamp = 0;
// Draw the minute needle
renderEarth(ctxContent, minute, second);
- // renderNeedle(ctxContent, Math.PI * (((minute + second / 60) / 30) - 0.5), 0, 0.70, 3, "#454545");
-
- // Draw the minute/hour circle
- // renderCircle(ctxContent, center, 8, "#454545");
-
- // Draw the second needle
- // ctxContent.shadowOffsetX = 4;
- // ctxContent.shadowOffsetY = 4;
- // renderNeedle(ctxContent, Math.PI * ((second / 30) - 0.5), -0.10, 0.85, 1, "#c4c4c4");
-
- // Draw the second circle
- // ctxContent.shadowOffsetX = 0;
- // ctxContent.shadowOffsetY = 0;
- // renderCircle(ctxContent, center, 5, "#c4c4c4");
-
- // Draw the center circle
- // renderCircle(ctxContent, center, 2, "#454545");
-
- // Draw the text for date
- // renderText(ctxContent, date, center.x, center.y + (watchRadius * 0.5), 25, "#999999");
-
+
+ /* if no return from server yet */
if(events == null)
return;
-
- thickness = 18;
- edge = document.body.clientWidth / 2 - thickness / 2 - 2;
+
+ /* if device not on server anymore */
+ if(events.kind == "not found") {
+ deviceFingerprint = null;
+ events = null;
+ deleteFile("devicefingerprint", function() {});
+ wait_time = SHORT_WAIT;
+ return;
+ }
+ /* if device not registered */
+ if(events.kind == "unregistered") {
+ wait_time = SHORT_WAIT;
+ if(deviceFingerprint === null) {
+ } else {
+ renderText(ctxContent, deviceFingerprint.deviceName, center.x, center.y, 20, "FF0000");
+ }
+ return;
+ }
+
+ console.log("switched to long wait");
+ wait_time = LONG_WAIT;
+
+ /* else: device registered and all events saved */
+ var thickness = 18;
+ var edge = document.body.clientWidth / 2 - thickness / 2 - 2;
for(var event in events.events){
var startedBeforeToday = false;
@@ -426,15 +557,13 @@ var eventsTimeStamp = 0;
}
- function updateCalendar(offset_ms) {
+ function loopCalendar(offset_ms) {
var d = new Date();
var currentTime = d.getTime();
- console.log("current Time: " + currentTime);
if(eventsTimeStamp + offset_ms < currentTime){
- console.log("updating Events");
- getJSON();
- eventsTimeStamp = currentTime;
- }
+ updateCalendar();
+ eventsTimeStamp = currentTime;
+ }
}
@@ -482,6 +611,7 @@ var eventsTimeStamp = 0;
* @private
*/
function init() {
+ // clearDownloads();
setDefaultVariables();
setDefaultEvents();
@@ -492,7 +622,7 @@ var eventsTimeStamp = 0;
// Update the content of the watch every second
setInterval(function() {
drawWatchContent();
- updateCalendar(60000);
+ loopCalendar(wait_time);
}, 1000);
}
@@ -520,4 +650,4 @@ document.addEventListener('timetick', function(ev) {
/* Update the UI */
drawWatchContent();
-});
\ No newline at end of file
+});