Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by hxflyer · Jun 27, 2011 at 06:42 AM · screenshotcapture

how to take a screenshot and save to image gallery on Android

I use Application.CaptureScreenshot(screenshotFilename) to capture and save snapshots, but the file is just saved in the application folder, it can't be accessed by the gallery or photosAlumb app, does anybody know hot to save the image to the gallery or photosAlumb?

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image cregox · Dec 09, 2013 at 08:03 PM 0
Share

much related: http://answers.unity3d.com/questions/200173/android-how-to-refresh-the-gallery-.html#comment-593163

avatar image DeveshPandey · Sep 19, 2015 at 01:44 PM 0
Share

use this plugin http://u3d.as/86U

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by foobuggy · Dec 09, 2013 at 09:27 PM

You should check the android developer site for information related to this:

http://developer.android.com/guide/topics/data/data-storage.html#filesExternal


 Music/ - Media scanner classifies all media found here as user music.
 Podcasts/ - Media scanner classifies all media found here as a podcast.
 Ringtones/ - Media scanner classifies all media found here as a ringtone.
 Alarms/ - Media scanner classifies all media found here as an alarm sound.
 Notifications/ - Media scanner classifies all media found here as a notification sound.
 Pictures/ - All photos (excluding those taken with the camera).
 Movies/ - All movies (excluding those taken with the camcorder).
 Download/ - Miscellaneous downloads.


Ultimately, you'd want to store (write the file using System.IO methods) the screenshot file to one of these directories and Android's built in MediaScanner should pick up on the newly added file. This will cause the image to appear in the device's gallery/photo list.

Comment
Add comment · Show 4 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image cregox · Dec 10, 2013 at 12:21 AM 0
Share

It really isn't this simple. Look at the link I've posted.

avatar image foobuggy · Dec 10, 2013 at 04:24 AM 0
Share

Android's $$anonymous$$ediaScanner is set to automatically update those default folder locations on all devices at regular intervals. On most devices, these are also pre-existing folders that live on an sd-card or in an emulated sd-card location. Perhaps I'm misunderstanding your question. Can you only save the screenshots to the application folder or would it be possible for you to save them into something like the pre-existing "Pictures/" folder so as to avoid the extra code needed to control the native processes? I've saved both image and audio files a number of times to these default folders on Android devices with no trouble at all in having them appear as ringtones or in the gallery. The only time it gets tricky is if you're forced to use a custom location. For that, you may need to use some native Android code to get the functionality required. I'm sorry if I misunderstood your question.

avatar image cregox · Dec 10, 2013 at 12:58 PM 0
Share

It's not my question. @hxflyer just wants to save the picture and see it in gallery. Saving in the right place isn't enough for most devices. As you've mentioned, it is a problem with media scanner and waiting for its regular interval is also not enough. In my tests on a few devices, only rebooting would make it work. But, I'll give you this, maybe this is all before android 4. I haven't tested this at all since the first android 4. (except the method with dll I've linked still works fine, obviously).

avatar image DeveshPandey · Jan 13, 2018 at 12:13 PM 0
Share

Here is the way to save your screenshot or texture to native gallery http://unitydevelopers.blogspot.in/2014/06/capture-and-save-to-camera-roll-and.html

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

upload a screenshot directly to flickr (or any other photosharing website) 1 Answer

Can someone help me fix my Javascript for Flickering Light? 6 Answers

Setting Scroll View Width GUILayout 1 Answer

Material doesn't have a color property '_Color' 4 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges