Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / How would I send data from AGK to PC?

Author
Message
Cyborg ART
17
Years of Service
User Offline
Joined: 14th Jan 2007
Location: Sweden - Sthlm
Posted: 4th Dec 2013 09:07
I am looking for a solid solution to send accelerometer-data from my phone to my PC. What would be the best way to set up a stable connection between these two units.
Is it possible to use the multiplayer commands for this? Or does it have to be Android to Android and PC to PC?

Any suggestions? I will go ahead and try the multiplayer.

JimHawkins
15
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 4th Dec 2013 10:02
Use the multiplayer. It has the network calls you need.

-- Jim - When is there going to be a release?
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 4th Dec 2013 11:04
Quote: "Is it possible to use the multiplayer commands for this? Or does it have to be Android to Android and PC to PC?"


I have successfully sent data from PC to Android, and the other way around. After a lot of playing around I decided that the best method was to always use CreateNetworkMessage( ). Start the message with an identifier that tells the receiving device what to expect.

e.g
"COORD" - read 2 floats representing longitude, latitude
"DEV" - read one string representing device name

Cyborg ART
17
Years of Service
User Offline
Joined: 14th Jan 2007
Location: Sweden - Sthlm
Posted: 4th Dec 2013 12:51
Thanks!
I haven't tested it yet, I begun testing if it was possible to send data between my AGK-appliction and Maya. Which now works

Will go on to multiplayer now. Its been a while since I worked with multiplayer.

BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 5th Dec 2013 19:51
Quote: "I begun testing if it was possible to send data between my AGK-appliction and Maya. Which now works "


How have you achieved this? Is it a method that will work with any Windows program? For example I would love to write a .NET program that sends data to AGK.

Cyborg ART
17
Years of Service
User Offline
Joined: 14th Jan 2007
Location: Sweden - Sthlm
Posted: 6th Dec 2013 10:53
Its a bit of a hack. Now I have an app that send accelerometer data from my phone via the multiplayer commands to a server application (also written in AGK) that gathers the values and writes a piece of MEL code and saves it as a mel-file. Then I use an expression in Maya on the camera to evaluate the mel-file every frame.

Its not the correct way, but it works



BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 6th Dec 2013 11:00
If it works, it's a good hack

I was hoping to check the file time to see if it had been updated (my requirement is slower than yours). Unfortunately there is no file date command

My next idea is to make the first line a counter so I can just read the first byte to check if updated. But this will mean constantly hitting the hard drive.

Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 6th Dec 2013 15:44
BatVink, if you are working in Tier 2, there are probably commands that can get file date/time information.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master

Login to post a reply

Server time is: 2024-11-24 23:32:55
Your offset time is: 2024-11-24 23:32:55