Android Working directory and extensions

W

Wraithious

Guest
Hello, I am making an extension that, as well as many other things, can put a file from the game's included files into a folder that the player (or game developer) chooses, it works fine if you want to transfer a file from the device to a chosen folder, but getting the address to the game asset folder to pass to the extension does not work, this is the results of the log output I added to check what the address being passed is:

Code:
11-05 22:38:31.715 24866 24930 I yoyo    : got file: assets/wildDubz.mp3
11-05 22:38:31.716 24866 24930 I yoyo    : File exists: false
11-05 22:38:31.716 24866 24930 I yoyo    : Couldn't find file
As you can see the word assets is being passed instead of the actual path. These are some of the ways I tried passing the needed path:

Code:
///Save audio from game to new folder
if canRec=1 SaveFromAs(working_directory+"/wildDubz.mp3",global.myFolder,"coppied",0);//file in, folder out, new file name, set as ringtone

///Save audio from game to new folder
var wfld = string(working_directory);
if canRec=1 SaveFromAs(wfld+"/wildDubz.mp3",global.myFolder,"coppied",0);
Both result in the same exact log output.

So how can I get working_directory to give the actual string path I need to pass to my extension?
 
W

Wraithious

Guest
program_directory didn't work but the game_save_id is definitely giving me a file name now, one note is you have to do a final build to test it or it defaults to the gmStudio folder, but I'm still getting the can't find file error but I'm going to keep trying different things, this is the path I'm getting now:
Code:
/data/user/0/com.companyname.GM_Audio_Save/files
so far in the string I've tried replacing the word files with assets, grouped together files/assets, removed the word files, tried with datafiles also, Now I'm going to import the sound into gms' sounds folder on the tree and try again with different folder names and since gms converts it to .ogg I'll have to change the file extension in my test function, thanks for the help! if all else fails I'll try making a method in my extension to find it.

EDIT
Nope, none of that worked, but there is a whole other function in android java to get the asset folder, and it's different than copying files from external to external folders, so I guess I'll have to do it that way inside my java extension file.
 
Last edited by a moderator:
W

Wraithious

Guest
Does anyone have a rooted phone? if you do can you please put a file in your included files in the resource tree, and then find the address to that file, I just need the part of the address after the com.companyName/gameName/I NEED TO KNOW THIS PART
please if anyone could do that it would be awesome
 
Top