Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / ExtractZip() Bug Not Working When Exported to APK

Author
Message
Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 23rd Jan 2017 22:29
As stated in this Post. https://forum.thegamecreators.com/thread/217839
Has this been fixed?
We need this to work because on Google play we are limited to a 100mb apk and
need to download our media separately in a zip file. Also the ExtractZip() command should allow
us to unzip the file from the SD card and write the contents to the resource folder which it does not.
The coffee is lovely dark and deep,and I have code to write before I sleep.
Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 24th Jan 2017 04:32
I did some testing in Tier2 and it will unzip the file when I use android studio which installs the apk and does not use
the AppGameKit player.
I still can not unzip from the SD card to the resource folder.
The coffee is lovely dark and deep,and I have code to write before I sleep.
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 24th Jan 2017 14:09
Try moving the zip into your sandbox folder before attempting to open it. i.e.:

creatememblockfromfile(1,"my.zip")
createfilefrommemblock("my.zip",1)
extractzip("my.zip")

V2 T1 (Mostly)
Phone Tap!
Uzmadesign
Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 24th Jan 2017 21:08
CJB

What do you mean by the sandbox folder?

Quote: "creatememblockfromfile(1,"my.zip")
createfilefrommemblock("my.zip",1)
extractzip("my.zip")"


Which problem will this solve?
Also ExtractZip() takes 2 parameters, does this code run?
The coffee is lovely dark and deep,and I have code to write before I sleep.
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 25th Jan 2017 09:08 Edited at: 25th Jan 2017 10:04
Sorry, I didn't check that code, but it was only to give you the general idea.

As a thorough test, I created a zip file called t1.zip, containing an image called gru.png. With t1.zip in the media folder the following does not work when exported as an APK:



BUT the following does:


By creating a memblock from the zip file, and then writing the memblock out as a zip file, you are copying it from the apps media folder into it's app-data folder (the safe "sandbox" area where your app will write data by default). ExtractZip appears to be able to read from there ok. If it can read a ZIP by copying it in this way, then I can't see why it wouldn't work if you had grabbed the file from the web and saved it in the same location.

This DOES confirm the bug, but is also a workaround for now.
V2 T1 (Mostly)
Phone Tap!
Uzmadesign
Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 25th Jan 2017 14:50
Quote: "ExtractZip appears to be able to read from there ok. If it can read a ZIP by copying it in this way, then I can't see why it wouldn't work if you had grabbed the file from the web and saved it in the same location."


Yes, but this does not explain why it works differently when broadcast.
This makes it confusing as the command help does not explain it.
This is why I suggest ExtractZip() command should allow us to unzip the file from the SD card and write the contents to the resource folder which it does not.
The coffee is lovely dark and deep,and I have code to write before I sleep.
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 25th Jan 2017 15:32
Perhaps the player app doesn't have the SD card permission in the manifest?

Login to post a reply

Server time is: 2024-09-29 23:25:21
Your offset time is: 2024-09-29 23:25:21