Languages

Menu
Sites
Language
Unzip file in Samsung gear with javascript code

Hi Everyone!

I tried to searching the way to unzip files in  samsung gear device usign javascript code but I still cannot found the correct way to to that.
if you have any ideas please help me.
Thanks you so much for any helps

Responses

3 Replies
Marco Buettner

Since Tizen 2.3.1 you can use the "Archive API" 

https://developer.tizen.org/development/api-references/web-application?redirect=https://developer.tizen.org/dev-guide/2.3.1/org.tizen.web.apireference/html/device_api/wearable/tizen/archive.html

Iqbal Hossain

You may use extractAll function..here is an examle from api reference

function errorCallback(error) {
     console.log(error);
 }

 function successCallback() {
     console.log("done");
 }

 function progressCallback(opId, val, name) {
     console.log("extracting operation (: " + opId + ") is in progress (" + (val * 100).toFixed(1) + "%)");
 }

 function openSuccess(archive) {
     archive.extractAll("music", successCallback, errorCallback, progressCallback);
 }

 tizen.archive.open("downloads/some_archive.zip", "r", openSuccess);

https://developer.tizen.org/development/api-references/web-application?redirect=https://developer.tizen.org/dev-guide/2.3.1/org.tizen.web.apireference/html/device_api/wearable/tizen/archive.html#ArchiveFile::extractAll

let us know if it works for you 

Iqbal Hossain

Did it solve your problem ? @ minh hoat tran