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 / Is there a way to set current working directory to other than default read/write folder?

Author
Message
hakimfullmetal
9
Years of Service
User Offline
Joined: 17th Feb 2015
Location:
Posted: 1st Apr 2015 08:37
I was on android, and tried to use the File commands to explore the folders and files in an android phone.

But, I noticed that the SetFolder() command only deals with files/folders in default read/write directory, which is the folder containing the app I'm testing.
This limits file manipulations to only within the default folder.

Is there any way to get out of this default folder, and set the working directory to other folders in the phone memory?
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 1st Apr 2015 10:06
No you can't, it's a security feature of AppGameKit (And possibly Android).

Quidquid latine dictum sit, altum sonatur
hakimfullmetal
9
Years of Service
User Offline
Joined: 17th Feb 2015
Location:
Posted: 1st Apr 2015 11:38
Well, that is disappointing.
Well I guess its acceptable.
But can't it be made so AppGameKit at least can read the files/folders?
Its ok if files cannot be changed, but unable to at least view the files is really putting a damper on my project progress.
JimHawkins
15
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 1st Apr 2015 12:38 Edited at: 1st Apr 2015 12:41
It is possible on Android, so this may be an AppGameKit restriction. The following link shows what's possible in Delphi, using the TPath object:

http://docwiki.embarcadero.com/RADStudio/XE5/en/Standard_RTL_Path_Functions_across_the_Supported_Target_Platforms

I think this should be a high priority for an update.

Notice that iOS is far more restrictive than Android!!!!!

<<It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration.>> Dijkstra
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 1st Apr 2015 12:48
Keeping AppGameKit in the sandbox I think is a deliberate move in an attempt to prevent it from being used for malicious purposes (and consequently getting dumped for the stores).

Maybe going Tier2 and using some other 3rd party libs to read/write outside the sandbox is an option for those who need this functionality?

V2 T1 (Mostly)
Uzmadesign
JimHawkins
15
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 1st Apr 2015 13:24
A lot of the folders are read-only, so I don't think that's an issue.

<<It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration.>> Dijkstra
hakimfullmetal
9
Years of Service
User Offline
Joined: 17th Feb 2015
Location:
Posted: 1st Apr 2015 14:56
If I'm not mistaken, access to primary storage/internal memory is still granted. I think it's going too far to restrict all kind of access.

If we're going to make a more variable/out of the box games/apps than what's clogging up the market, these kinds of functionality is indispensable.
Really hope AppGameKit developer will reconsider their policy/decision.

I mean, AppGameKit is full of potential, really hate to see it got mundaned down by restrictions that it doesn't even need.
Sph!nx
15
Years of Service
User Offline
Joined: 3rd Dec 2008
Location: The Netherlands
Posted: 1st Apr 2015 18:58 Edited at: 1st Apr 2015 19:01
I use AppGameKit to create windows apps and games. This seems to work for me to set read and write as the same dir as the exe:


Regards Sph!nx
hakimfullmetal
9
Years of Service
User Offline
Joined: 17th Feb 2015
Location:
Posted: 2nd Apr 2015 15:05 Edited at: 2nd Apr 2015 15:56
On Windows, let's say that you wanted to set root for reading in a folder in the D drive, then what is the indentation that you use for setfolder("") and setrawwritepath() ?

Is it this
D:\Games

or this?
D:/Games

Something quite strange happened.
So I wanted to change the read and write path to a new path (outside the default folder) on Windows.
I set the write folder using setrawwritepath() to a folder in C drive, and GetWritePath() indeed shows the write path is the one I specified.

After that, I called the combinations of GetFirstFile() and GetNextFile() to scan the files in that folder.

However, the files that end up scanned are the files in the default root folder. I checked the read path with GetReadPath(), and it still says that the read folder is the default folder.

Am I doing something wrong here?
I thought by calling the SetRawWritePath(), the read path was also changed. But it seems that this is not the case. The read path seems to remain as the default read path.

How do I get the read path to change to the new read path that I wanted (which is outside the default folder, on Windows)?

Project files included. Please test it on Windows PC.

Attachments

Login to view attachments
unlikely
12
Years of Service
User Offline
Joined: 5th Mar 2012
Location: Ohio, USA
Posted: 2nd Apr 2015 23:17 Edited at: 2nd Apr 2015 23:18
File system access on Android is possible if rooted and in a limited fashion with the correct permissions... I think that AppGameKit just doesn't mess around with dynamically adding those to keep things simple. Makes sense to me as there is limited reason to be accessing the Android file system (unless you are making a file explorer / launcher.) The "correct" Android way of doing things is to set up your app as accepting certain actions from other apps, which may be a bit more complex than is appropriate for a games-focused solution like AGK.

Using AppGameKit v2 T1 + T2
Systems: Primary: Mac OS X 10.10
Secondary: Windows 7
hakimfullmetal
9
Years of Service
User Offline
Joined: 17th Feb 2015
Location:
Posted: 3rd Apr 2015 14:30
I tried everything, and there's just no way to 'see' the file outside the default folders.

At most, on Windows, I can set the write folder path to the one I want. That's it. That's all the freedom AppGameKit offers.

Please Paul, give us more freedom. Let them see that AppGameKit is not the same as GameGuru.
Alien Menace
AGK Developer
19
Years of Service
User Offline
Joined: 11th Jan 2005
Location: Earth (just visiting)
Posted: 4th Apr 2015 09:23
People sometimes forget that AppGameKit is suppose to be a Windows and Mac development tool as well as mobile devices. The file commands are way too limited for serious work right now.

Apps published: 4

Login to post a reply

Server time is: 2024-11-25 18:31:09
Your offset time is: 2024-11-25 18:31:09