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.

Android / Very slow file load times...

Author
Message
Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 29th Jun 2012 02:16 Edited at: 29th Jun 2012 03:01
My current project loads some data from text files, quit a bit of data. When I run the project with the AppGameKit Player on my Android phone and Kindle Fire, it takes less than 2 seconds to load the files. When I compile and build the project with cygwin and eclipse, it takes over 2 and a half minutes to load the same text files.

Any thoughts on this? Does the AppGameKit player store it's files somewhere different than the compiled program? Does the Android program have to "unpack" itself every time it runs?

I can't put my game up for sale on the Android stores if it takes almost 3 minutes to startup, this is really bugging me.

EDIT: Hmmm, the AppGameKit Player creates a folder on my sd card in AGK/gamename/media, with my graphics and text files in it. My actual game creates a folder in AGK/unknown/media with two text files that I write, but NOT with my graphics and text files. Is this what should be happening? Shouldn't my game have it's own folder instead of using the AppGameKit folder? Or maybe not, since my game IS actually the player, but it only runs my game bytecode.

Very puzzling.

Some days, the bear will eat you.
Some days, you'll eat the bear.
Today, I'm eating the bear!
Funnell7
13
Years of Service
User Offline
Joined: 8th Sep 2011
Location: UK, England
Posted: 29th Jun 2012 10:48
I have the same problem with the 'Unknown' directory'. Thread here:

http://forum.thegamecreators.com/?m=forum_view&t=197480&b=46

Unfortunately, I am yet to find a solution.Would be good to know if anyone else has had any success. This is especially a problem when you have multiple AppGameKit apps installed, both using the same filename...
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 29th Jun 2012 17:11
Rich, the initial load from Eclipse takes a while.

But you should see that the application is installed on your device once Eclipse has done its thing.

Then you can run it as many times as you want directly, without Eclipse.

Try running the now installed app and see if it still takes a long time. Mine starts right up.

Cheers,
Ancient Lady
AGK Community Tester
Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 29th Jun 2012 18:07 Edited at: 29th Jun 2012 18:08
@AL, the APK is installed on the Android device, no trouble or delays with Eclipse.

The problem is that the app takes so long to start up on the phone/tablet. My loading screen has three messages:

Loading Dictionary...

Loading Graphics...

Creating Sprites...

When broadcast and run through the player, "Loading Dictionary..." is displayed for less than two seconds.

When run as an installed app on the device, "Loading Dictionary..." is displayed for about 2 minutes and 45 seconds.

Then, on both the player version and the app version, "Loading Graphics..." and "Creating Sprites..." are only displayed for a second or two before the main game menu comes up.

So there's a big delay loading the dictionary files when running the installed app.

Some days, the bear will eat you.
Some days, you'll eat the bear.
Today, I'm eating the bear!
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 29th Jun 2012 19:04
When broadcast, it is actually running on your PC. The IDE loads all the files from your PC and not from the Android device.

How big is your dictionary file? And what do you do when you load it?

Cheers,
Ancient Lady
AGK Community Tester
Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 29th Jun 2012 20:03
Quote: "When broadcast, it is actually running on your PC"


I don't think that's correct. If broadcast to the AppGameKit Viewer, yes. But when it's broadcast to the AppGameKit Player, I believe it transfers all the files to the device.

The load times are acceptable on my iPad and iPod Touch, just not on the Android devices.

The data is 10 files, various sizes ranging from 1KB to 191KB, about 820KB total. It's used to generate random words, and to check player input for "legal" words.

Some days, the bear will eat you.
Some days, you'll eat the bear.
Today, I'm eating the bear!
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 29th Jun 2012 20:15
Okay, a stab in the dark here....

Do you create any files when you load the dictionary files?

If you create files, maybe it does it in a different location when you broadcast as opposed to when you run it on the device. And maybe, where it creates the file(s) is a slower device for running versus broadcast?

Cheers,
Ancient Lady
AGK Community Tester
Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 29th Jun 2012 21:12 Edited at: 29th Jun 2012 21:48
Good thinking, but no, I don't create any files while I'm loading in the dictionary. I do create two files later, a config file and a scores file, but they are both really small.

In the compiled and installed Android game, the config/scores are written to the sd card in AGK/Unknown/media. Those are the only two files in the folder.

With the broadcast version, the folder is AGK/gamename/media, and all the dictionary files are in there with all my game graphics and my .byc file, as to be expected. Everything from the media folder gets copied to the device in a broadcast.

I can't find the dictionary files nor my game graphics on the sd card, so I'm assuming those files have to be unpacked somehow before they can be loaded by my code, and thus the long load time.

EDIT:

Now here's something interesting... in the game, I load in some other data from files with the .txt extension, and I found these in a "Documents" folder while exploring the files on my Kindle Fire. Apparently the Android OS thinks it knows to store ".txt" files in an internal documents folder. I'm going to rename my dictionary files to a ".txt" extension, see if that gets rid of the delay.

MORE EDIT: Didn't work, still takes alomst 3 minutes to load the dictionary files. Rats.

Some days, the bear will eat you.
Some days, you'll eat the bear.
Today, I'm eating the bear!
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 29th Jun 2012 21:22
Okay, I'm out of ideas.

But I still think there is something suspicious about the way the loaded game doesn't use the game name for the media directory it creates.

Cheers,
Ancient Lady
AGK Community Tester
Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 29th Jun 2012 21:24
Quote: "But I still think there is something suspicious about the way the loaded game doesn't use the game name for the media directory it creates."


Agreed. I think this is a bug.

Some days, the bear will eat you.
Some days, you'll eat the bear.
Today, I'm eating the bear!
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 29th Jun 2012 22:32
It's definitely a bug. But I don't think it's been reported in the list.

Cheers,
Ancient Lady
AGK Community Tester
Kevin Picone
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 30th Jun 2012 06:46
Sounds like you might have a lot of string thrashing going on. Which may mean changing the loader, or perhaps avoiding any unnecessary concentration might be worth looking at.

Funnell7
13
Years of Service
User Offline
Joined: 8th Sep 2011
Location: UK, England
Posted: 3rd Jul 2012 18:27 Edited at: 3rd Jul 2012 18:28
Quote: "It's definitely a bug. But I don't think it's been reported in the list."


Have just added it to the bug board... I'm not very good at explaining things though, ha, so hope it makes sense...

EDIT: Issue 367.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 3rd Jul 2012 20:29
Funnell7, thank you for adding the issue to the list.

One of the Community Testers (or all of us) will do what we can to test the problem and prove that it is reproducable and then flag it as confirmed in our list system (http://www.tgcct.triassicassociates.com/issues.php).

I cannot personally test it because my Android tablet has scrambled its brains and cannot recognize the sd card anymore.

Cheers,
Ancient Lady
AGK Community Tester

Login to post a reply

Server time is: 2024-11-23 15:03:33
Your offset time is: 2024-11-23 15:03:33