0

Ok, so I have a MySQL DB holding my workouts, I've written API to produce json, and I want to access it from my phone. I built a Unity Android App using System.Net and System.IO to retrieve JSON and put it into a serialized object. Works great on the PC, but when I put it on the phone it doesn't retrieve the data.

Started working on a version using UnityEngine.Networking, but have to rewrite my code to handle the async read, so I haven't tested it on the android device yet.

  1. Does System.Net work on Android Phones in Unity? Is it most likely a permissions thing, or does it flat out not work?

  2. If I can't use System.Net, would UnityEngine.Networking do the trick? Or is there another protocol that can have an Android app read JSON from a web API?

Tanoshimi
  • 463
  • 1
  • 4
  • 11

1 Answers1

0

Your question about System.Net supporting on android devices has been answered by @fattie here: Is System.Net.Sockets compatible with Unity targeting iOS?

But anyway, you can use UnityEngine.Networking instead of System.Net. For more information see https://docs.unity3d.com/ScriptReference/Networking.UnityWebRequest.html

Abolfazl
  • 100
  • 1
  • 9