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 / read files from apk

Author
Message
Juande
12
Years of Service
User Offline
Joined: 2nd Sep 2011
Location:
Posted: 24th Feb 2013 17:46
Hi everyone,

I am tired... I have problems with extractzip and opentoread after build my apk for android.

My apk file has a zip file (images) and txt files with the stage of my game in folder assets/media. If i install my apk in my phone the application is closed...

I have tried this simple example and the aplication is closed:



If I use AppGameKit player (my current version is 1.08 beta8), i don't have any problem, but with my apk, the app is closed. If I write a file and then I read this file, the apk works fine.

What am i doing wrong?

Thanks
Juande
12
Years of Service
User Offline
Joined: 2nd Sep 2011
Location:
Posted: 24th Feb 2013 20:35
I get it! The problem is in readbyte command (i suppose that extractzip works with readbyte). These commands only works from the write/reading folder of the user (at least on Android 4.1). I have not got read a byte or extract the zip from reading folder...

My solution is:

1. copy the file in write/reading folder using readstring (readstring and readinteger work fine in both folders)

2. read byte to byte / extract the zip

Greetings!
Marl
12
Years of Service
User Offline
Joined: 19th Nov 2011
Location: Bradford, UK
Posted: 1st Mar 2013 19:53
The .apk file is already a compressed file, so perhaps the question to ask is do you need them in a zip within a zip?

Rather than extract the images, why not just read them from the apk?
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 1st Mar 2013 20:00
The same goes for iOS apps, the data is compressed and not visible as a file by file thing.

The only reason you might want a zip file is in a Windows environment.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Juande
12
Years of Service
User Offline
Joined: 2nd Sep 2011
Location:
Posted: 4th Mar 2013 15:39
Yes, it's stupid... sorry for my question

Greetings
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 4th Mar 2013 16:11
No question is ever stupid. Because if it is one you need to ask, then it is something you need to know, regardless of whether other people already know.

Sometimes the obvious stuff isn't obvious until it gets pointed out. No one can be expected to know or see everything that is going on.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master

Login to post a reply

Server time is: 2024-05-07 00:42:59
Your offset time is: 2024-05-07 00:42:59