Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 /
This question was closed Feb 11, 2015 at 10:55 AM by Prasanna for the following reason:

Found the mistake.

avatar image
0
Question by Prasanna · Feb 10, 2015 at 01:05 PM · c#androidscreenshotcapturedatapath

Screenshot is not save properly into the folder.

Hi guys, am using Application.persistentDataPath to save my screenshot into my phone. I created one folder when i start the application, so i choose that folder for my destination path for saving my screenshot, but it's not working everytime it shows the screenshot under the data path only. where i miss the point for this condition?

This line is for save path in android:

 if(Shot_Taken == true)
         {
             Origin_Path = System.IO.Path.Combine(Application.persistentDataPath, Screen_Shot_File_Name);
             // This is the path to save screenshot.
             File_Path = "/mnt/sdcard/DCIM/Augmented Reality/" + Screen_Shot_File_Name;
             if(System.IO.File.Exists(Origin_Path))
             {
                 System.IO.File.Move(Origin_Path, File_Path);
                 Shot_Taken = false;
             }
         }

This line i used splashscreen scene in my application:

 private void Awake()
     {
         System.IO.Directory.CreateDirectory ("/mnt/sdcard/DCIM/Augmented Reality");
     }

and sometimes my screenshot is not taking properly, if i take 5 screenshots it will show only 2 or 3.

This is for taking screenshots:

 public void OnCaptureScreen()
     {
         Active = false;
         // Increament the screenshot count.
         Screen_Shot_Count++;
         // Save the screenshot name as Screenshot_1.png, Screenshot_2.png, with date format...
         Screen_Shot_File_Name = "Screenshot__" + Screen_Shot_Count + System.DateTime.Now.ToString("__yyyy-MM-dd") + ".png";
         Application.CaptureScreenshot(Screen_Shot_File_Name);
         StartCoroutine (Active_Objects());
     }

Comment
Add comment · Show 9
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 pako · Feb 10, 2015 at 02:23 PM 0
Share

Some debug info would be useful from your 1st code snippet i.e. if(Shot_Taken == true){}:

  1. Debug.Log(Origin_Path) //just after Origin_Path gets set

  2. Debug.Log("Origin_Path Exists") //1st line inside the if(System.IO.File.Exists(Origin_Path)) statement

Note: Path.Combine() needs a $$anonymous$$imum of .net framework 4, but I think that Unity/$$anonymous$$ono does not support that. I'm not sure about this, but I remember having some problems with using .net framework 4 calls, and after endless googling decided not to use it.

avatar image giulio-pierucci · Feb 10, 2015 at 03:56 PM 0
Share

Did you already read this?

http://answers.unity3d.com/questions/204372/saving-screenshots-to-android-gallery.html

avatar image Prasanna · Feb 11, 2015 at 09:18 AM 0
Share

Some of the page is not available @giulio.pierucci

avatar image Prasanna · Feb 11, 2015 at 09:19 AM 0
Share

How can i use debug option when i run application into my phone, because my unity remote is not working. @pako

avatar image pako · Feb 11, 2015 at 09:46 AM 0
Share

Ins$$anonymous$$d of debug.log you can show a relevant message using the GUI.

Show more comments

0 Replies

  • Sort: 

Follow this Question

Answers Answers and Comments

20 People are following this question.

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

Related Questions

Multiple Cars not working 1 Answer

Application.temporaryCachePath is empty on some devices 1 Answer

Distribute terrain in zones 3 Answers

Deleting file on android 0 Answers

Application.CaptureScreenshot() does not save any image on Android while it does on Editor! 0 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