Loading config file in android
Re: Loading config file in android
Does anybody know the default location for sfs-config.xml on android?
Re: Loading config file in android
I have no idea. It should be packed in the .apk file, but I am not sure.
In our Android examples we don't use an external config file. It's not even useful, since there's no way (or need) to change it after the code is compiled, so it's useless.
You can simply create a ConfigData object and populate the config directly from code, before connecting.
Then use the SmartFox.connect(ConfigData cf) and you're done.
Cheers
In our Android examples we don't use an external config file. It's not even useful, since there's no way (or need) to change it after the code is compiled, so it's useless.
You can simply create a ConfigData object and populate the config directly from code, before connecting.
Then use the SmartFox.connect(ConfigData cf) and you're done.
Cheers
Re: Loading config file in android
Thanks for the advice, I hadn't noticed the ConfigData object.
I had needed sfs-config.xml because file upload getHttpUploadURI() returns null in java without an httpPort configured, but it looks like one can set the httpPort in the ConfigData object and it works.
If anybody still needs to use the config file on android, I had a solution where I copied the file from the local folder to an absolute path upon initial install of the app, which ended up working fine. But now I'm switching to ConfigData as it is easier to deal with.
I had needed sfs-config.xml because file upload getHttpUploadURI() returns null in java without an httpPort configured, but it looks like one can set the httpPort in the ConfigData object and it works.
If anybody still needs to use the config file on android, I had a solution where I copied the file from the local folder to an absolute path upon initial install of the app, which ended up working fine. But now I'm switching to ConfigData as it is easier to deal with.
Return to “SFS2X Java / Android API”
Who is online
Users browsing this forum: No registered users and 31 guests