1. Hello Guest! It's with a heavy heart that we must announce the removal of the Legacy GMC Archive. If you wish to save anything from it, now's the time! Please see this topic for more information.
    Dismiss Notice

Android How to save a screenshot in the Downloads folder

Discussion in 'Programming' started by Mr. Unp3rf3ct, Mar 29, 2018.

  1. Mr. Unp3rf3ct

    Mr. Unp3rf3ct Member

    Joined:
    Feb 24, 2018
    Posts:
    18
    Hey there, quick question. I have been reading up on the whole game maker sandboxed situation, because my project requires saving a file in the Download or another accessible directory. I can not use the default working_directory, because its unaccesible to the user without root.

    Any ideas would be welcome and thanks in advance!
     
  2. rIKmAN

    rIKmAN Member

    Joined:
    Sep 6, 2016
    Posts:
    4,772
    You can use get_save_filename which when combined with the actual saving function for whatever it is you are saving (image, text etc) will allow you to save outside the sandbox.
     
    Mr. Unp3rf3ct likes this.
  3. Mr. Unp3rf3ct

    Mr. Unp3rf3ct Member

    Joined:
    Feb 24, 2018
    Posts:
    18
    Can I ask for an example if it isn't too much please. I'm still very much a noob at saving files. Also it says "Valid for Windows and Mac only"
     
  4. rIKmAN

    rIKmAN Member

    Joined:
    Sep 6, 2016
    Posts:
    4,772
    There is a code example at the bottom of the link I posted that saves a screenshots to the selected folder.

    You didn't mention in your post that you were targeting any other platforms, and you mentioned the "Download" folder so I assumed you were targeting desktop.
     
  5. Mr. Unp3rf3ct

    Mr. Unp3rf3ct Member

    Joined:
    Feb 24, 2018
    Posts:
    18
    I'm Sorry, I added the Android tag and then just forgot to mention it again. I found an extension called folderpick or something along those lines which Seams to work, so I'll try it tomorrow. But thank you anyways, that will come in handy in the future!
     
    Last edited: Apr 5, 2018
    rIKmAN likes this.
  6. rIKmAN

    rIKmAN Member

    Joined:
    Sep 6, 2016
    Posts:
    4,772
    Ahh no problem - yeah I believe you will need an extension to break out of the sandbox, not too sure of the specifics on Android or whether that may be a rejection on the Store - so do your homework to save any headaches down the road just in case.
     
  7. TibiSoft

    TibiSoft Member

    Joined:
    Dec 20, 2017
    Posts:
    9
    Hello All,
    Was it somehow solved? I am looking for the solution for the same issue: to save a file (screenshoot) on Android what expected to be reached by user from any other App later on.
    Thanks.
     
  8. Mr. Unp3rf3ct

    Mr. Unp3rf3ct Member

    Joined:
    Feb 24, 2018
    Posts:
    18
    It's certainly been a while since then, but I'll try my best.
    First I purchased this extension here:
    https://marketplace.yoyogames.com/assets/4257/folderpick
    (Not sponsored or anything)

    And used one of its functions to create a path to the download folder by saying path = *one of the extensions functions* (You'll need to look at the documentation for the extension for this one). Then I saved the surface/the asset by using for example surface_save(path + "/filename.png")

    Hope this helps you
     
  9. TibiSoft

    TibiSoft Member

    Joined:
    Dec 20, 2017
    Posts:
    9
    Thanks for your prompt reply.
    "Accidentaly" today I have already bought it, and just realized afterwards that it is for GMS1. ...Tried once to compie with GMS2 however resulted many errors and I've just given up with that.
    Do you use it with GMS1 or 2?
     
  10. Mr. Unp3rf3ct

    Mr. Unp3rf3ct Member

    Joined:
    Feb 24, 2018
    Posts:
    18
    I still use GMS1 and for development and not even the latest version as it introduced issues for Android development.
    I don't know how those extensions work for GMS2 but maybe you can click contact developer on the extension store and ask them if they can give you a hint, even tho the extension might no longer be supported by them.
    Also maybe try implementing the extension in an empty project first (1 room, 1 object, 1 sprite and the extension) and compile it with Android YYC.

    Good luck, sorry if I wasn't of much help.
     
  11. TibiSoft

    TibiSoft Member

    Joined:
    Dec 20, 2017
    Posts:
    9
    I have tried unfortunately without success.
    Anyway, I do appreciate your support. I try to contact to developers of this extension and/or look for some other solution (other extension?).
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice