Android How to select a file on android to interact with it later?

Aver005

Member
How to select a file on android to interact with it later?

I understand, maybe my question is strange. But for my project I need to make a program for android, which will select the file and upload it to my website.

Please tell me how to do it. Thanks in advance!
 
A

Alex_Beach

Guest
Do you mean you want to ask the user which file they want to open? You can ask the user to enter a filename with: get_string. Then you can use file_text_open_read(//the get_string result). If it's not a text file you're trying to open, there are other commands for different file types, such as ini_open(//the get_string result). Just remember that on Android you CANNOT open files outside of your bundle location: data/data/<package name>
 

Binsk

Member
You cannot access any files other than those included in your project or created by your project when it comes to the Android export. GameMaker is sandboxed and Windows is the only export that allows you to read files outside of it.

If this does not matter to you then search the manual for the file_find_* functions. You can scan for all the file names accessible and create a list for the user to choose from. There is no automated way.
 

Aver005

Member
Do you mean you want to ask the user which file they want to open? You can ask the user to enter a filename with: get_string. Then you can use file_text_open_read(//the get_string result). If it's not a text file you're trying to open, there are other commands for different file types, such as ini_open(//the get_string result). Just remember that on Android you CANNOT open files outside of your bundle location: data/data/<package name>
Thanks! I try with get_string, its not but that's not what I need.
 
Top