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 / Limitations with saving images...

Author
Message
=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 8th Dec 2013 01:55
I've not had a very successful evening this evening with AGK.

I've been working on the "output" bit of my project, and of the 2 ideas I had for outputting images from my app, I seem to have hit some obstacles.

1) Send as an attachment to an email - Until I realised that you can't add an attachment to a mailto link anymore (if you ever could?) It seems php is the way to do it, but sadly it's not a language I'm overly familiar with.

2) Save image to the gallery - Again, I figured this would be straight forward, but sadly this is not the case. the SaveImage() command can only access folders inside the sandbox of your app (Which don't show up in the gallery, obviously). Some forum hunting revealed the PrintImage() command, which does save to a different path, but on my Tab 2 7.0 this folder also does not show up in the gallery (It also doesn't give you an option to change the file name)

So there we go, I have an almost completed app apart from the bit where you can't as yet do anything useful with the output (e.g. save it or send it on)

Has anyone else tried to save an image to the gallery? Does the PrintImage() command work on some devices and not others? (I will test it on my Galaxy Y at some point) and if it does, Does this qualify as a bug?

I'm sure I could get around the saving limitation by converting the whole project to Tier 2 and using some native code to save to the gallery properly, but again, I have little or no experience with working with c++.

I'm gonna stop typing now, not sure if I'm asking for help, or just grumbling, lol.

Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 8th Dec 2013 03:08
The one problem with Tier 2 file stuff is that the paths and things are so very different across platforms. I use bits in Windows so that I can save/move files about. But the same commands would probably not work in iOS/Android because the paths would be so different.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
xCept
21
Years of Service
User Offline
Joined: 15th Dec 2002
Location:
Posted: 8th Dec 2013 04:46
The PrintImage() command has improved marginally since I first used it. I had requested some improvements for one of my own WIPs that remains unreleased. Initially it was pretty worthless on most mobile devices as it saved each image as "PrintedImage.png" overwriting as needed.

Paul subsequently added an increment to it so it won't overwrite existing files, but you still have no control over the location or specific filename and on Android it still gets saved to the root with no gallery insert. Ideally the command would be renamed so it is more logical on mobile platforms and would include a couple parameters [i.e., saveImageExternal(str name, str path)]

I do believe the image does get saved to the gallery on iOS. On Android using Java the gallery can be refreshed after the image is saved via an intent broadcast [e.g., sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED...] But not sure how you'd work this into your AppGameKit project and is definitely something I'd like to see improved in future releases.
=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 8th Dec 2013 12:18 Edited at: 8th Dec 2013 12:31
@Ancient Lady:
Yes, I appreciate the path differences between platforms but I was assuming there is a simple (and officially recommended) method to use, something like android.gallery.addimage() (I know, ever the optimist, lol)

@xCept:
Yeah, I think it was your thread I saw Paul saying about the PrintImage() command. I don't currently have the facilities to test it on my iDevices but it would make sense that it would at least work on 1 platform (A lot of features it seems were added for iOS first before android)

>Edit<
Ok, this is weird... I just looked at the tablet now, and the images I saved last night ARE actually in the gallery where they are supposed to be? I'm sure I didn't overlook them yesterday so I can only assume there is a problem with the gallery refresh like xCept was saying.

So, I'm happier now, I'm sure I can cobble something together from php snippets to upload/send the e-mail and I can save images to the gallery (Even if they don't show up straight away )

I think I agree with xCept as well about renaming the PrintImage() command and adding the ability to change the filename at least, if not the /pictures/ path. But I'd also like to see it refresh the gallery after the image has been saved.

Login to post a reply

Server time is: 2024-11-24 23:29:00
Your offset time is: 2024-11-24 23:29:00