Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
jherico's avatar
jherico
Adventurer
12 years ago

Android development discussion

This was posted in the 'new user thread':

"rupert" wrote:
I'm interested in Android support and I haven't found any definitive threads in the forums. In understand that it is in the pipeline, but there seems to be no SDK currently available.

I can see potential for an Android device sending HDMI to a rift as a mirrored or second screen with the mobile device doubling as a handheld controller (touchscreen and orientation sensing). Quite what that would mean from an SDK point of view I'm not sure, but it would be interesting to get a view on feasibility from the community.


Android development is certainly possible, but no, the existing SDK is unlikely to be very useful in this regard. I've done some initial work on creating a 'movie viewer' for Android using my Kindle Fire HD 8.9, which has HDMI out.

Producing the distortion code is relatively straightforward. I've got a Java example located here that performs distortion. Using it on Android would require adapting the GL call from JOGL to the Android equivalents. I've actually done a version that does this but it's not yet published on a public repository.

Doing the head tracking is a little bit more tricky. First, you have to be able to have your Android device act as a USB host, rather than a client. Then you have to fetch the HID information from the Rift, and produce a SensorFusion work-alike that parses the individual sensor messages and creates an overall transform out of them. Again, I've done some work on this, which is available here, but again, this code is designed for working on a PC, not on an Android device. It relies on the Java hidapi library, which I haven't tested on Android yet.

Another alternative would be to attempt to use the Android DDK to compile the existing SDK. The SDK does have some pre-processor defines that detect and act on the presence of an Android environment, but I haven't attempted to use them. Taking this route would probably mean your entire project would have to be C/C++ or you'd need to create or find JNI or JNA bindings for the SDK to access the functionality from your Java Android application. Neither is a trivial amount of work.

1 Reply

  • @jherico Nice work. Clearly there is some solid engineering to be done to take this further and I hope you will keep sharing your progress.