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 / Problem with GetNextFile? Some help please.

Author
Message
peterJBE
16
Years of Service
User Offline
Joined: 11th Mar 2008
Location: Belgium
Posted: 24th Dec 2011 16:42
This code functions well on my windows PC.
But it crashes on the Android player on my ZTE Skate.
It seems I can call GetNextFile several time but then it crashes (the android player shuts down).



Can someone have a look at this code?
westalke
12
Years of Service
User Offline
Joined: 8th Dec 2011
Location:
Posted: 25th Dec 2011 11:23
the question seems like - what is GetNextFile() actually returning.
are you doing a file exists test and returning a "" ?

Cause it seems like the issue is most likely related to what the value of s actually is ...

Westa
peterJBE
16
Years of Service
User Offline
Joined: 11th Mar 2008
Location: Belgium
Posted: 26th Dec 2011 11:07
@westalke: Thank you for looking at this.

From the manual: function GetNextFile()
Quote: "
Returns an empty string if there are no more files in the current directory.
"


Can someone test my program on the Android Player on their device.

Did some tests. It seems that the program detects the empty file well and exits the while loop. But the player stops working(terminates) when the function returns.
Maybe it has something to do with trying to read the name of the *.byc file wich can be open. The name of the *.byc file is never entered in the filess array of my program.

The problem is not present on Windows.
westalke
12
Years of Service
User Offline
Joined: 8th Dec 2011
Location:
Posted: 28th Dec 2011 11:32
Just had another look at your code.

As far as I know arrays in AppGameKit were supposed to be base 1 not base 0 - so I'm wondering if the interpreter is throwing an internal memory exception when u try to set:

filess[i] = s while i is equal to 0.

Maybe try altering the structure of your code to be a little cleaner as well to avoid this possible issue all together.

peterJBE
16
Years of Service
User Offline
Joined: 11th Mar 2008
Location: Belgium
Posted: 28th Dec 2011 21:08 Edited at: 28th Dec 2011 21:09
@westalke: Thank you for looking at my code and cleaning it up.

The code below works fine on Windows but not on the Android Player and the Bada Player


The following code works well on all three platforms. The only difference is that I donĀ“t use a user defined function.

Has someone an explanation? Can someone test the code on BADA and/or Android.
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 29th Dec 2011 17:55
I'd check that readConfigFiles() is actually returning something. I'm having issues with returned values when returning them in User Functions. It's hard to explain, but it's there! lol

My signature is NOT a moderator plaything! Stop changing it!
LeeBamber
TGC Lead Developer
24
Years of Service
User Offline
Joined: 21st Jan 2000
Location: England
Posted: 6th Jan 2012 12:02
If you can drill down to the exact cause of the crash (looks like you found out how to reproduce it), could you report it here: http://code.google.com/p/agk/issues/list Thanks!

Also, I have noticed a few requests from users to have their app tested on other devices that they do not own. Is this a service you would be interested in TGC offering? Nothing for right now, but some sort of part-automated system that could accept your AppGameKit app and media, run it on the device and stream the results back to you.

I drink tea, and in my spare time I write software.
peterJBE
16
Years of Service
User Offline
Joined: 11th Mar 2008
Location: Belgium
Posted: 6th Jan 2012 16:11
@Lee.

I post it on the issues list. I were not sure if it was my code or it was a AppGameKit bug.

I have Bada, Android and Windows available for testing. For the other platforms, especially Ios and MacOS, the proposed service would interesting, for me.

Login to post a reply

Server time is: 2024-04-16 20:10:44
Your offset time is: 2024-04-16 20:10:44