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 / On android 4.1 folder & directory commands fail

Author
Message
Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 10th Sep 2012 02:20
HI all.

Just a heads up, and a plea for someone to tell me I'm wrong, but nearly all the directory and folder commands fail on android 4.1. Set folder doesn't work, but setcurrentdir does sometimes, often not. Getfolder and getcurrentdir both hang the app totally and it closes with no messages. Getfirstfolder returns an empty string, as does getnextfolder. These errors only happen once transferred to the device, so it is possible that it only happens through the android player (i'm running the latest beta from the downloads section), the PC player is fine and the code is working perfectly so it's possible a fully compiled version will work ok, i'll check that tomorrow. Actually does make it totally impossible to test the code on native without first transferring it.

Oh, and as a side note, changing directory on the player appears to be case sensitive but not on the PC one? (i.e. if the folder is called "Images" and you [/code]setcurrentdir("images")[code] it will work through AppGameKit, but fail on the android player).

Anyone else found this???
Digital Awakening
AGK Developer
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 10th Sep 2012 08:30
Android is always case sensitive. That's why people have problems loading their media.


Demo 2 is out! Click the image for more.
Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 10th Sep 2012 13:12
Yeah, it caught me for a while, but I don't remember the documentation mentioning it.

It's far more the non working folder commands that present me a problem though, as my project is almost completely dependant on them working. Got around the non working getfirstfolder and getnextfolder commands and got them working so my project is back on, but getfolder still kills the player which is just a pain. Tonight I'll compile a simple test program and see if it is just the player.
MarcoBruti
12
Years of Service
User Offline
Joined: 20th Nov 2011
Location: Caput Mundi
Posted: 10th Sep 2012 15:06
folder commands never worked properly in AGK-Android. I do not use them and I put everything in the media folder, except when I have to load media from well-know dir, e.g. "buttons/buttons.PNG".
I think that in general TGC has got no time or resources to fix them, since it is spreading over a bunch of projects, hoping that one of them will bring them fame and fortune. But as far as I understand, AppGameKit is not obtaining so great success, so they are not wasting many resources onto it, or, to be more precise, they are focusing on the on-line version (Freedom Engine).
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 10th Sep 2012 23:35
MarcoBruti, i used to think your same way and felt very sad about AGK.

However recently Lee Bamber explained what is going on behind the scenes and reassured many people.

TGC have been keeping many things in the dark, and this turned out to their disadvantage as people started complaining.

I hope that you are wrong and AppGameKit will grow better and better! Otherwise I am going to move over all my development to Windows8 & HTML5
Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 11th Sep 2012 00:08 Edited at: 11th Sep 2012 00:11
Well, for those of us struggling, just like the music commands I found a work around (sort of). Get folder dosn't work, however the getfirstfolder and getnextfolder I did get working, as does setcurrentdir when used in combination with these. For example, say your path is "media/images/level1", I found that sometimes failed on the player, even though it worked fine on the PC player. However, if before setting the directory you use getfirstfolder and getnextfolder until they return "images", then setcurrentdir seems to work ok if you assign it via a variable. I.e.

If you repeat the process for "level1" then again it seems ok. So, if you use
to reset to default, using getfirstfolder via a variable again seems to allow you to change root locations no problem and as often as you like.

No idea why, but the help files say that getfolder and getcurrentdir both return the folder name with a "/" character, however no other command returns a folder name with a "/" character so my guess is this is an android problem, or a character that we can't see (if you use message to see the result there's no visible special character).

Of course, still no idea if compiled projects are affected.

Big question Lee/Paul - when is in app purchasing going to be added, my project is almost entirely dependant on this!!!
Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 11th Sep 2012 00:34
UPDATE:

I've made an interesting discovery. The setcurrentdir command apparently will work with an absolute path, but only in relation to the root of the device and with a leading slash. If you set up a folder called "images" in the media folder, then another inside that called "player", then do

this appears to work fine. I load the last subfolder from an array called data$, and it works with that too by using:

The key seems to be the leading "/" character, and then the same character at the end. Setfolder, getfolder and getcurrentdirectory still crash it every time though.

This is very odd....the help files specifically say that using absoulte paths doesn't work......
JimHawkins
14
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 11th Sep 2012 10:00
I get directory information BEFORE actually launching AppGameKit itself. On the PC AppGameKit switches the current directory into the User area, which is very irritating. Obviously, you can't do this in T1.

-- Jim DO IT FASTER, EASIER AND BETTER WITH AppGameKit FOR PASCAL
Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 11th Sep 2012 13:29
Well, I was slightly worried, however I emailed tgc directly and they were very helpful, and I known that work and development has Def not stopped on the updates that they promised, so I'm happy to be patient and get every other aspect of my project up and running.

As for the freedom engine, I know very lite about it, other than its cloud based and should be able to do things such as sims social? The simple fact is, tgc are a business, and they have to make money, so I'm assuming therefor that this means you will pay a regular hosting fee for server capacity for such products then? At the moment, not something I'm interested in, however I imagine there is significant more money to be made there than old style apps.... Everyone knows things like sims social is just a con. Lol.
MarcoBruti
12
Years of Service
User Offline
Joined: 20th Nov 2011
Location: Caput Mundi
Posted: 11th Sep 2012 15:27
About dir commands, I refuse myself to use "strangely behaving" commands in an undocumented (or documented only by fora). When I'll use them again in the future, how could I manage to use them in that particular way and with the particular sequence and that particular format such that they word???
Sorry, but I prefer to amuse myself with more interesting activities.
Waiting for FE or next AppGameKit to implements folder commands decently, some words to answer to this (and the other thread).
First of all, I do not want to say that AppGameKit is dead, I only focus that TGC, in my understanding, is finding its way to stay on the market with a successful product that AppGameKit, sorry to say that, at the moment is not. The problem is the lack of a decent documentation (despite a lot of people saying that it is good, I do not understand what some people mean for "good documentation", maybe the help files and fora are "documentation"? sorry not to be aligned ), a complex and sometimes obscure process to generate executables for Android, a lot of buggy and undocumented commands, T1 Basic missing some useful constructs and so on. Apart bugs opened since many months...
Anyway the product "in se" is very good , I am only listing some "defects", and everything (including people) on the earth has got many defects, and especially wives know very well about the cons of their husbands.
The fact that many people have published a lot of working and noticeable apps, shows that it deserves more attention than at the moment the Internet media show.
I hope that TGC efforts, with FE launch and presence at Intel roadshow, will boost the sales and popularity, and this will bring a virtual circle, that will improve language, commands, documentation, features, etc.
But if FE will start with the same approach with the same cons as AppGameKit, I would not bet a lot on its future.
There is the background of DBPro users, but it enough.
Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 11th Sep 2012 18:04
Marco,

You raise some good points, but I feel I must counter with some, in the nicest possible way. Firstly, my device uses 4.1, where as this is 2.3? So in effect, an xp program running on dozens of hardware configurations under win 8. Yeah..... That would work well. :-P
We also forget what the program is actually doing too. Have you ever tried native android development? I'm amazed anything ever gets released, it's a joke when Iast looked. Lol. There is a reason most of us are using a basic language to begin with after all.
And lastly, and this is a personal bug bear, I code vb apps for a living, which are used quite literally by thousands of people country wide..... And in any app/tool I make 25-30% of the time is writing it, the rest making it work with windows foibles, varying settings, and general idiots who manage things that I couldn't think up if it was my full time job. What we are doing is basic programming, and programming is about figuring out ways of making things work!!
MarcoBruti
12
Years of Service
User Offline
Joined: 20th Nov 2011
Location: Caput Mundi
Posted: 11th Sep 2012 19:58
@Santman,
we are talking about us=developers, not about dummy users. There are a lot of books on VB (the language you use for your full-time job) not only help files or fora lol. I did not try Android native programming, but I started at the eraly age of 14, and I programmed with Basic, Java, C, C++, Prolog, Assembler, VB, Fortran, Pascal, Javascript, Perl, PHP, Python, Ruby, HTML, BASH/KSH and FOR EACH language, I have more than one paper books, PDF ebooks or manuals.
I do not fear Android programming at all, as I do not fear anything in the IT arena...after 29 years of computer programming...but...since developing games is not my full time job, I have got not time to spend with native programming (Tier-2 or Pascal) and, since I am intentionally focused on Tier-1 (as most of the people) I would like to have some good documentation to start with (apart buying expensive books). I managed to do without a book or manual (there are 6 apps of mine on Google Play, ranging from 500 to 6000 LoC), so I have no problems. Anyway I think that the AppGameKit customer would be glad to have a user&reference guide, and then make his/her way using fora, examples, trial&error etc. Is it a huge request that TGC would never meet? I think that with FE they should change approach, otherwise...there are a lot of mega-flops around. I hope not, of course.
Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 14th Sep 2012 00:48
Another update, the above seems to fail utterly when compiled under android 4.1.

I made a simple test program, and got interesting results. A new project, three folders in the media folder, and the default four files (two text, the .byc and the .agc file). Now, getfirstfile and getnextfile SEEM to work ok, but on the android device they totally skip the .agc file. Using getfirstfolder and getnextfolder return nothing. However, if you start with setcurrentdir("") then repeat the folder discovery routine, then getfirstfolder() will find media no problem....but no other folders! But the really interesting thing - if you reset to the default directory, then perform the file scan, the app finds all the AppGameKit files (missing.png) etc, but none of your files.....but will oddly find everything on the PC AFTER the AppGameKit files. So then....essentially what is happening is, the folder and file commands can only detect things created by AppGameKit and not windows (the media folder is created automatically, as are three of the files except the .agc file which isn't created until you compile it)??? Can anyone confirm if this is the case if you create everything on linux, or is this perhaps a permissions issue or a windows folder/file issue??

If you try and create a folder, it works perfectly well via the PC app but does not create anything - on the android device it makes no difference.

Another interesting thing, storing the results in an array for the files, then printing them to the screen numbered - not only does it read them backwards, but it's the third of the four files it skips. And, under 4.1 there's no trace to be found of either the AppGameKit folder, a thegamecreators folder, or your compiled project even after it's installed and working.

I have attahced the test files for others/the game creators to see.

Attachments

Login to view attachments
Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 14th Sep 2012 01:19
Last update - I compiled and ran this program, and it still refused to find any of the windows based files, but created a folder no problem itself - however it didn;t find this until it;s second run.

In short....these commands don't work. Period.
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 14th Sep 2012 23:48
i bet all these problems will disappear when the next version of agk comes out.

the tgc have got a nexus7 which uses the latest android version and i bet that they already fixed the file problems
Naphier
13
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 8th Jan 2013 04:06 Edited at: 8th Jan 2013 04:09
Just to document this for others:
Apparently AppGameKit player doesn't delete subdirectories of the media folder on the Android device.
If I broadcast a program with folderA and folderB then later remove folderA it continues to show up on the Android device when I call the directory names with GetDirectory().
They even persist after a reboot of the Android device (I'm using Nexus 7).
The workaround I've used is to create a new project with a different name. PIA...

EDIT - If you add a directory to the project it is not a problem...

MikeMax
AGK Academic Backer
12
Years of Service
User Offline
Joined: 13th Dec 2011
Location: Paris
Posted: 8th Jan 2013 10:56 Edited at: 8th Jan 2013 11:04
Yes, the only way is to have root access on android device (4.1+) and delete root:/data/user/0/com.thegamecreators.agk_player/files/projectname/media/folder(depend on the android version).
Or as said before, rename the project.
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 8th Jan 2013 16:44
Quote: "Apparently AppGameKit player doesn't delete subdirectories of the media folder on the Android device."


This is true, although if you uninstall the app and reinstall it, the folders will be cleared.
Naphier
13
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 8th Jan 2013 22:59
Will there be changes to the AppGameKit player to compensate for this? Can you use DeleteFolder() to force removal of these?
I'll probably just root this weekend day as I've been wanting to but haven't had a reason to do so yet.
Cheers!

Nexus 7 (Jelly Bean 4.1.2) -- HTC Droid Incredible 2 (Gingerbread 2.3.?) -- Motorola Droid X (Gingerbread 2.3.4)
Willing to test for you!
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 9th Jan 2013 00:17
DeleteFolder should work, but I've not tried it in this case.

Login to post a reply

Server time is: 2024-05-06 19:12:31
Your offset time is: 2024-05-06 19:12:31