Jump to content

Recommended Posts

Posted

I'd like to create a plugin for X-Plane that takes data from an Android phone.  The first thing I'd like to accomplish is the ability to read the phone's accelerometer data from within X-Plane.  I can think of a lot of cool uses for this, but I don't have a specific goal in mind.  Right now I'd just like to get the framework laid out to allow X-Plane and Android to communicate.

I'm not a great programmer.  All of my experience has been with scripting and interpreted languages (PHP/ASP.Net/a small bit of Python).

I guess I'd have to learn Java to create an app for Android that pushes the data out.  I can use the Python SDK for X-Plane plugin.

As far as communicating between the two, I would think my choices are between Bluetooth, Wifi networking, and a physical USB cable.  I don't have an Android phone yet, but will be getting one in the next couple of weeks.

Is this too be of a project for a novice programmer?  Right now, my main goal is just to create some custom datarefs in X-Plane that use real-time information from the androids different sensors.

  I'm not trying to put out payware, just trying to learn.

Posted

Just a few thoughts: don't care about the link layer (how are the Phone and Computer connected "physically"). Use a network protocol. For the beginning TCP/IP might be a good choice.

As the "simplest" approach you have a client-server model. You plugin is the server (it receives the data from the phone). I don't know about Python for the X-Planbe SDK but for C/C++ there are some hints how to open a network socket and listen for incoming data within a plugin.

A rough idea of the workflow could be:

first: learn about Java and the Android-API. You need to find a way how to read the accelerometer data inside a Java-app.

second: take a look at the docs for the java.net.* (especially java.net.socket.*) packages. Those will help you to send the data aut of the phone.

third: checkout the xsquawkbox IPC SDK. it will give you an idea how to receive the data within a plugin (it's C++, not python).

http://download.oracle.com/javase/6/docs/api/java/net/package-summary.html

http://www.xsquawkbox.net/xsb/developer

Posted

Learning Java: several painful days, at least.

Wiimote Plus: $40 US from Amazon

http://www.amazon.com/Wii-Remote-Plus-Black-Nintendo/dp/B0045FCKVI/ref=sr_1_1?ie=UTF8&qid=1289164979&sr=8-1

Wiimote has accelerometers.

Wiimote PLUS adds a Gyroscope.

Wiimote also has high speed infrared cameras that can be used for all sorts of cool stuff. (White boards, Track IR, LOTS.)

Wiimote tools and frameworks exist that let you play on your desktop computer for coding, not on some phone.

You can play around in Python.

Having explored the wiimote and the iPod Touch for this stuff I recommend you get yourself a WiiMote, the start up cost and barrier to entry is MUCH MUCH lower and ulimately the WiiMote, with it's high speed infrared camera, is much more suited to game-sensor applications than any phone i've seen yet.

Posted

Thanks for the replies gentlemen. 

Sven:  I'll be taking a look at that shortly, at least to get an idea of how difficult it will be.  I'll report back if I decide to start working on this concept.

Indi:  The Wiimote is a great idea.  I never even thought of that.  Eventually, though, I'd like to feed information back to the Android.  I have no plans yet, but it'd be cool to have some kind of informational display there.  Maybe an FMS, some instruments, moving map, TCAS... something along those lines.

It'd just be experimental.  I don't want to have an obligation to paying customers, so I can't see myself every putting out any payware.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...