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:
// Project: ziptest
// Created: 2017-01-24
// show all errors
SetErrorMode(2)
// set window properties
SetWindowTitle( "ziptest" )
SetWindowSize( 1024, 768, 0 )
// set display properties
SetVirtualResolution( 400, 400 )
SetOrientationAllowed( 1, 1, 1, 1 )
SetSyncRate( 30, 0 ) // 30fps instead of 60 to save battery
UseNewDefaultFonts( 1 ) // since version 2.0.20 we can use nicer default fonts
ExtractZip("t1.zip","")
loadimage(1,"gru.png")
createsprite(1,1)
SetSpritePositionByOffset(1,200,200)
do
print(getFileCount())
Print( ScreenFPS() )
Sync()
loop
BUT the following does:
// Project: ziptest
// Created: 2017-01-24
// show all errors
SetErrorMode(2)
// set window properties
SetWindowTitle( "ziptest" )
SetWindowSize( 1024, 768, 0 )
// set display properties
SetVirtualResolution( 400, 400 )
SetOrientationAllowed( 1, 1, 1, 1 )
SetSyncRate( 30, 0 ) // 30fps instead of 60 to save battery
UseNewDefaultFonts( 1 ) // since version 2.0.20 we can use nicer default fonts
CreateMemblockFromFile(1,"t1.zip")
CreateFileFromMemblock("t1.zip",1)
ExtractZip("t1.zip","")
loadimage(1,"gru.png")
createsprite(1,1)
SetSpritePositionByOffset(1,200,200)
do
print(getFileCount())
Print( ScreenFPS() )
Sync()
loop
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.