- Home /
Transfer images to Samsung device from within Unity Application?
So basically what i want to do is be notified within my unity application when the device is connected (so that i can enable a button) and then be able to select images from within my app (can do this part already) and have them be transferred/copied/uploaded to the cellphone to be viewed inside a GearVR headset. Im using Unity 5.5.2 f1 and coding in c#. Any help would be much appreciated!
Thanks
be notified within my unity application when the device is connected
Connected to what?
have them be transferred/copied/uploaded to the cellphone to be viewed inside a GearVR headset.
Its confusing, copying from which device to which device? On Which device Unity App is running?
Connected to the computer while the app is open. So the unity app runs on the computer and images on the computer would need to be transferred to the cellphone to be viewed within the default GearVR 360 image viewing app.
now it makes sense. Please also edit the question so that you can get help quickly.
First, the phone and computer need to be in the same network to communicate. Next, as the app on android start, it will broadcast some UDP packets at some specific interval to notify it's existence in the network.
Computer app can listen to this UDP packets and get the address of the android device.
Once you have the address you can either send all the images with a TCP connection, which will be complex tailored solution
OR
1) Run a small Http server(mongoose server) which can server images on your computer. 2) Now copy all images selected on the computer to that directory(mongoose directory). also write a file which lists all files (e.g. allfiles.txt) in that directory. 3) notify android device with a udp packet that it can read the data now. android will know the address of computer from this packet and can request that text file (allfiles.txt). 4) request for each image in the list on computer address. (e.g. http://addressOfComputer/image1.jpg)