- Home /
Problem is not reproducible or outdated
Android Mysql Database online
Hi all, i make a connection from Unity project and Database in Altervista, in pc, inside a Unity or pc application it work, but if i build apk and run it on my device, it can't connect to the server.
I use WWW form and PHP command.
I have include System.Data and MySql.Data.MySqlClient libraries.
what i do wrong?
Answer by MakeCodeNow · Sep 28, 2014 at 04:40 AM
You probably need to enable network permissions for your android apk. Android apps require that the app request and that the user grant permission for each device feature like network access, sd card access, camera access, etc.
Ok. That looks good. Do you have a custom manifest.xml file? If so it overwrites those settings. Also, do you added any debug logging or looked at the included logs? That's the next step to figure out why it's not connecting. Learn how to use LogCat in the Android Dev Env if you haven't already.
in androidmanifest i have this permission:
<uses-permission android:name="android.permission.ACCESS_NETWOR$$anonymous$$_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
in my mobile, the WWW returns this error:
java.net.malformedurlexception protocol not found
What is the URL that you are using? $$anonymous$$aybe you have a malformed URL that somehow works on PC but not on device.
Answer by stultitia1 · Jan 26, 2016 at 12:25 PM
Hi, I have the same problem. I have a database in digital ocean and I can insert or read the data. If I press play the scene run perfectly. But when I swhitch platform to Android, show me in all my scripts the error: BCE0005: Unknown Identifier: 'variable_name'. Please, can you help me?
Answer by PaLmCivetMenace · Dec 23, 2016 at 04:30 PM
Dude see if you have the full address with such as with "https://" in the beginning Although it works on pc without the full address it doesnt work so on mobile. I had the same problem.But with the full address it worked on android too. Hopefully you found an answer here