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 / How do I save an image in the Android 'Pictures' folder?

Author
Message
basicFanatic
3
Years of Service
User Offline
Joined: 7th Jun 2017
Location:
Posted: 9th Sep 2020 09:26
So far, my code goes like this:



But I have no idea if it saved the file anywhere. At least, I was unable to find it. And even assuming that it somehow did save the file somewhere, that somewhere isn't the Pictures folder.
blink0k
Moderator
7
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 9th Sep 2020 10:09
Have a look at GetWritePath()
basicFanatic
3
Years of Service
User Offline
Joined: 7th Jun 2017
Location:
Posted: 10th Sep 2020 10:21
Good idea! It gave me:
Quote: "/data/user/0/my.cool.drawing_app/files/"

This looks very different from the version of the file system I see when I plug the phone into my PC, or use the phones build-in file browser. While I did find a folder called my.cool.drawing_app, it was empty. Strange.
blink0k
Moderator
7
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 10th Sep 2020 11:15
I think everything will be obfuscated but you can use the Share group of commands to export stuff.
You could also try to open the image after you have saved it
BITBITBIT
3
Years of Service
User Offline
Joined: 2nd Apr 2017
Location:
Posted: 10th Sep 2020 19:12 Edited at: 10th Sep 2020 19:18
I'm not 100% sure with saved images, but we no longer can write to external file outside of the hidden app /local folder (the path you returned from GetWritePath() I think) in the new versions of Android 10 and above. So any images you saved will go to the that path. The 'Pictures' folder you are targeting seems to be external, so I presume we cannot save to that anymore:

https://forum.thegamecreators.com/thread/226631
basicFanatic
3
Years of Service
User Offline
Joined: 7th Jun 2017
Location:
Posted: 11th Sep 2020 09:47
Oh, good to know! It's a drawing prog, so some ability to save your work would be nice.

On the other hand, I could let it be a gimmicky feature that it doesn't have any save-function whatsoever. (but hinting that the user can take a screenshot with power+vol-down)
basicFanatic
3
Years of Service
User Offline
Joined: 7th Jun 2017
Location:
Posted: 11th Sep 2020 18:21
Annoyance! shareImage() makes me run out of GPU at the sync()
blink0k
Moderator
7
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 11th Sep 2020 22:54
Separate out the shareimage() command and see if it works
basicFanatic
3
Years of Service
User Offline
Joined: 7th Jun 2017
Location:
Posted: 12th Sep 2020 08:27
Good call! The code (shown below) still runs dry on GPU.

I think I'll let the only way to save the image be to take a screenshot. Incidentally, this fits the program, since the canvas you're drawing on is the exact size of your screen.

I know it's gimmicky like the Dickens, but I really like the idea of a drawing program without a saving function. It's permadeath for art!

Anyone got a cool title for this?

fubarpk
Retired Moderator
15
Years of Service
User Offline
Joined: 11th Jan 2005
Location: Adelaide
Posted: 12th Sep 2020 08:51
Quote: "Anyone got a cool title for this?"

i always liked michelangelo but thats taken as a great sprite package perhaps a play on monalisa

fubarpk on Itch...………...https://fubarpk.itch.io/
fubarpk on googleplay..https://play.google.com/store/apps/developer?id=fubarpk
blink0k
Moderator
7
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 12th Sep 2020 08:51 Edited at: 12th Sep 2020 09:59
That works fine for me
basicFanatic
3
Years of Service
User Offline
Joined: 7th Jun 2017
Location:
Posted: 12th Sep 2020 08:58
Strange? My phone must be awry somehow.
blink0k
Moderator
7
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 12th Sep 2020 10:01
How about "Canvas Kaos". Seeing as you can't save the image
basicFanatic
3
Years of Service
User Offline
Joined: 7th Jun 2017
Location:
Posted: 12th Sep 2020 12:06
Not bad! Maybe I'll go for CANVOS, mixing canvas and chaos.
Conjured Entertainment
AGK Developer
15
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 12th Sep 2020 13:08 Edited at: 12th Sep 2020 13:24
Quote: "Anyone got a cool title for this?"

ICP ? (Not to be confused with Insane Clown Posse)

Which could also be an extension for the files if you wanted to make it need the program to use them. (even though they could really be PNGs in disguise)

Insaniam Convertunt Pingere


Of course, the file extension idea was for PCs not mobiles, but... just throwing it out there.

Coding things my way since 1981 -- Currently using AppGameKit V2 Tier 1
blink0k
Moderator
7
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 13th Sep 2020 09:03
One thing i would suggest is to not create the render image on the fly. Create it on startup and reuse it

Login to post a reply

Server time is: 2020-10-22 02:25:38
Your offset time is: 2020-10-22 02:25:38