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 / GetImage - SaveImage - Where are the files?

Author
Message
JRNTexas
13
Years of Service
User Offline
Joined: 24th May 2011
Location: Austin, Texas
Posted: 2nd Mar 2015 18:16 Edited at: 5th Mar 2015 05:26
I've added the following code to my app:



When I compile and run it on my PC, I can find the files it creates. However, I cannot find them on my phone.

I have a suspicion that the files are in my app directory using the specified path and therefore are not accessible via the Android OS utilities.

How do I store the images on my phone where I can find them?

Thanks
3d point in space
15
Years of Service
User Offline
Joined: 30th Jun 2009
Location: Idaho
Posted: 2nd Mar 2015 18:37
you forgot to render the screen before you got your image. Read the help guide on more information about rendering.

Developer of Space Chips, pianobasic, zipzapzoom, and vet pinball apps. Developed the tiled map engine seen on the showcase. Veteran for the military.
JRNTexas
13
Years of Service
User Offline
Joined: 24th May 2011
Location: Austin, Texas
Posted: 2nd Mar 2015 19:03
@3rd point in space

Thanks for the reply.

I left out a little of the code. I do render the image in another area of the app, and I find the files on my pc.

But I cannot find them on my Android devices - multiple.
JRNTexas
13
Years of Service
User Offline
Joined: 24th May 2011
Location: Austin, Texas
Posted: 4th Mar 2015 13:39
-BUMP-

Can anyone tell me where I can find a file I've saved on and Android device?
Funnell7
13
Years of Service
User Offline
Joined: 8th Sep 2011
Location: UK, England
Posted: 4th Mar 2015 14:11
Quote: "Can anyone tell me where I can find a file I've saved on and Android device?"


In your gallery? Although I think I've read that there is an issue with saving images, and you need to reboot your device before they show up... Or, I'm talking nonsense, which is also entirely possible

Using AppGameKit V2 Tier 1
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 4th Mar 2015 14:52
App-Data sandbox more likely.

V2 T1 (Mostly)
Uzmadesign
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 4th Mar 2015 16:19
Its also possible if u connect your phone at pc u got
a virtual file listing and some files are not listed.

or test if there was a error at save, u can print on screen.
SetErrorMode ( mode )
GetErrorOccurred ()
GetLastError ()

AGK 108 (B)19 + AppGameKit V2 Alpha .. : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
JRNTexas
13
Years of Service
User Offline
Joined: 24th May 2011
Location: Austin, Texas
Posted: 5th Mar 2015 05:25
I appreciate the comments and suggestions.

I am installing an APK directly on 8 different Android systems so the program is not being "broadcast" to the systems. Therefore, the file is probably on the Android system, but I just can't find it using methods available to most users and I can't write it to someplace that is easily user accessible.

@ Markus, I will use your error code to see if the file gets written, but I believe it is being written.

I have used FK (File Commander) to search several different Android systems for the file to no avail. However, FK does not show system or program files. I believe my program is saving the file in it's own directory using the path I specify.

It saves the file on a PC and I can find it. So I don't think it is experiencing an error condition writing the file.

I can't figure out how to use a path that will save the file in a user accessible area on Android, like the screen capture, DCIM or picture directories.

I believe my problem is a path problem. I can't come up with the correct path. I don't seem to be able to get to "root" or a user accessible area from within my app.
Polaraul
9
Years of Service
User Offline
Joined: 13th Dec 2014
Location:
Posted: 5th Mar 2015 13:34
@JRNTTexas Hi there. I had a similar problem in my last Android app. I initially used the Saveimage() command, however, I could not locate any images saved on my device using this method. After some digging around the most probable cause I could find is that, due to the sandbox nature of AppGameKit, images cannot be saved outside of the application directory on Android. In the end I used PrintImage(), however, this too has issues.

You could also try posting this question on the Steam forums. It has been my experience, and due to the fact those forums are more public facing, that devs seem to respond more there.

Hope you find a solution, I know how frustrating it can be!

www.polaraul.com
Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 5th Mar 2015 18:43
Quote: "After some digging around the most probable cause I could find is that, due to the sandbox nature of AppGameKit, images cannot be saved outside of the application directory on Android. "

I have tested other people's programs that save files externally and they send a message saying it is saving to /sdcard/pictures/filename.png
My phone doesn't have an sdcard installed though, so it saves to /phone/pictures/filename.png

It is easy to find navigating with the File Manager, without the need for a reboot like the Gallery seems to require.


Coding things my way since 1981 -- Currently using AppGameKit V2 Tier 1
JRNTexas
13
Years of Service
User Offline
Joined: 24th May 2011
Location: Austin, Texas
Posted: 6th Mar 2015 01:57
@ Polaraul, Thanks for the PrintImage() suggestion, I will try that if other path alternatives fail me.

Quote: "the most probable cause I could find is that, due to the sandbox nature of AGK"
...Since I have installed my app, it should have the same capabilities as any other app and not be using a "sandbox".

@ Congjured, In my code, I have been using SD card because that is what it looks like from other apps I have been using and I think my problem is a path problem, i.e. I should have been using /sdcard/ instead of /SD card/... I know that Android is case sensitive so everything about using a "correct" path is an issue.

Thanks guys for your help!
JRNTexas
13
Years of Service
User Offline
Joined: 24th May 2011
Location: Austin, Texas
Posted: 6th Mar 2015 03:56 Edited at: 6th Mar 2015 04:10
I found this info under help>setfolder

Quote: "Only two folders are accessible to your AppGameKit app; the read folder and the write folder. "


Then later in the same help file it states:

Quote: "There are two ways to return to the root path."


Root?????

Can someone definitively tell me if this really means that I have no access to other "public" areas of my devices, as many other games and apps seem to have?

Thanks!
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 10th Mar 2015 18:04
On both iOS and Android apps are sandboxed so that files they read and write are hidden from the rest of the device, and other apps. There are exceptions like the PrintImage command which can export to the photos section of the device, and on Android the WRITE_EXTERNAL_STORAGE permission allows writing to the /sdcard/ folder, but this isn't exposed in AppGameKit due to it being platform specific.

Quote: "Root?????"


It means the root of the path that AppGameKit has access to, i.e. its sandboxed file system. Perhaps a poor choice of words on my part for those familiar with Linux.
JRNTexas
13
Years of Service
User Offline
Joined: 24th May 2011
Location: Austin, Texas
Posted: 11th Mar 2015 08:09
@Paul...Thanks for the reply...I will see if I can get PrintImage to do what I need.

I realize that every situation is not straight forward and simple. And there may not be a viable "solution" to a specific issue given the constraints of the entire environment.

I've been a long time user of TGC products. You are doing a great job with AGK. I appreciate your answer and the insight.
Polaraul
9
Years of Service
User Offline
Joined: 13th Dec 2014
Location:
Posted: 11th Mar 2015 13:15
@JRNTexas The only issue with PrintImage() is that your users will need to reboot the device for the image to show up in their media gallery. Depending on you app, this may be something to be aware of. http://forum.thegamecreators.com/?m=forum_view&t=213571&b=41

www.polaraul.com

Login to post a reply

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