Blog

Gallery Screenshot

I put together a plugin for Unity iOS and Android the other day and decided other people might find it useful, so its now on the Asset Store.

http://u3d.as/4pz

From the documentation:

“This Plugin will take a screenshot of your app, and register the file so that it appears in your picture gallery (camera roll) on both iOS and Android. Tested and working with Unity 3.5.7 & 4.3 (including free version). Also works great with Vuforia.”

img_for_blog

6 Responses to “Gallery Screenshot”

  1. Vicky:

    So happy to hear about this! Is this a tool good for beginners? And will it work with Unity Free? (I thought iOS and Android were Pro add ons.) Thanks!

  2. Ryan:

    To use the plugin you need enough knowledge to create a GUI button on stage, and from there it is one further line of code to call the plugin, which then takes cares of everything else for you. Pretty simple in programming terms. It’s all explained in the Readme and there is an example in the demo scene.

    And yes it does work with Unity free (as of v4.0 iOS/Android Standard are included with the free version).

  3. Joan:

    We purchased the Screenshot Gallery plugin and a android phone Nexus 4 does not save the pictures in the gallery, but in the application folder. What could be happening?

    Gives this error:

    05-14 18:54:09.047: I / Unity (8627): NullReferenceException: Object reference not set to an instance of an object
    05-14 18:54:09.047: I / Unity (8627): at ScreenshotManager + c__Iterator0.MoveNext () [0x00000] in unknown>: 0

    We have selected from Unity3D you can record to the SD card.

    Thank you very much,
    Joan

    • Ryan:

      Hi Joan, this error most likely occurs when you ask for a callback but don’t delegate a receiver.

      StartCoroutine( ScreenshotManager.Save( "Screenshot", "MyApp", true ));

      Change the last parameter to false (or leave it out entirely) to specify that you don’t want a callback. Cheers.

  4. Joan:

    Hi Ryan,

    Thanks for your answer, but I modified it said and the result is the same. Save the image, but not in the gallery of the phone,but in the application directory.

    Cheers

    • Ryan:

      As of Android KitKat you can’t write anywhere other than folders created by your app:

      http://www.androidcentral.com/kitkat-sdcard-changes

      Using this plugin your image should still appear in the gallery (regardless of where it’s stored), if it’s not feel free to drop an email to ryan@ryanwebb.com, letting me know your Android version and how you are implementing the plugin. Cheers.

Leave a Reply to Joan