5

i am working on an android application that requires to be controlled by LEAP-motion. the leap sdk currently only supports windows and mac. but is there a way (any open library/tutorial etc.) to make the leap motion device talk to an android phone?

leap motion uses a USB connection to the phone , i have a usb OTG adapter and can directly plug in leap.

Any sort of help will be greatly appreciated.

Syed Usman
  • 300
  • 3
  • 8
  • no idea is this help you or not, but you can surly get a idea http://marctan.com/blog/2013/05/26/leap-motion-and-android-a-match-made-in-heaven/ – Sree Jul 21 '14 at 11:39
  • i have already gone through that one. it connects LEAP to PC and uses a NODE.js server to relay all the motion data to android in real time. I want to connect leap directly to android. – Syed Usman Jul 21 '14 at 11:58
  • sorry i have't tried that one or seen any example, any way good luck – Sree Jul 21 '14 at 12:12
  • Currently no public driver/SDK exists for Android. However, [someone has been able to connect Leap to Android](https://www.youtube.com/watch?v=94lhdAQRgOU) – Sga Jul 22 '14 at 06:47

2 Answers2

4

Introduction

Ya, I know your question contains the word "directly". My solution is not direct but it is an alternative you may consider. I have come up to a smooth acceptable solution to make LeapMotion work on Android (indirectly).

Pre-requisites

  • A PC or a Mac with npm as the "PROXY"
  • npm install binaryjs
  • npm install sleep
  • An Android device with Wi-fi capability ("DEVICE")
  • Leap Motion device ("LEAP MOTION") connected to the "PROXY"
  • Wi-fi LAN connection between the "DEVICE" and "PROXY"

The basic idea of this solution is to use the PROXY to make the impossible (Android+LeapMotion) to become possible. The PROXY will read the data from LEAP MOTION using the Javascript SDK and stream (ya, it's streaming rather than posting) the data to node.js instance running on it.

The DEVICE will connect to the PROXY and stream (ya, it's again streaming rather than polling) the hand position data and present it as a red circle on screen.

Step-by-step guide

  1. Download the PROXY project here

  2. Extract the project

  3. Run in on your instance of node.js server on your PC or Mac (e.g. node index.js)

  4. Mark down the IP of the PROXY

  5. Open your browser (Chrome and Safari are proven working) and browse http://localhost:5000 to verify it is running

  6. Download the Android project for your DEVICE here

  7. Import the project in ADT

  8. Open strings.xml to modify the IP address to the IP address of PROXY

  9. Run the project on YOUR DEVICE

  10. Move your hand above the LEAP MOTION and see the red circle moving according to your hand's direction

Direct connection

In fact I have tried to make the LEAP MOTION work directly on Android. There are certain difficulties. Firstly, the USB adapter of the Android device has to be USB host and providing sufficient power to LEAP MOTION. Then, if you could adb the Android device, you should be able to find /dev/video? after plugging in the cable. AFAIK, LEAP MOTION works like a video camera which streams video data to the other end of the cable (format unknown). But certainly, without an official SDK, we couldn't get the Hand, Bone, Gesture, Arm and other higher level API support. So, let's wait for SDK or use my indirect solution.

Patrick Chan
  • 1,019
  • 10
  • 14
  • Hey, I'm trying to experiment with your approach because I have the same basic need. However, I'm stuck on step 3. How do I get the index.js to run? I tried node index.js but it throws an error saying it can't find module 'sleep' at multiple locations in module.js and index.js. Can you help? – Darth Coder Feb 06 '15 at 03:25
  • yes, it requires some libraries. You can simply npm install sleep, or other required libraries. – Patrick Chan Feb 06 '15 at 04:38
  • I tried installing sleep but I'm getting errors. Is there a way I can get sleep and other libraries through npm or some repository? Could you explain further? Thanks! – Darth Coder Feb 06 '15 at 05:14
  • I do not remember quite clearly, but very probably it has some dependencies. just try to install all its dependencies and it could work – Patrick Chan Feb 06 '15 at 16:11
  • Leap Motion offers Alpha Android support. Contact developers@leapmotion.com to get access~ – Peter Ehrlich Nov 05 '15 at 19:28
1

Please go to the Leap Motion community. There is an Alpha SDK for Android but you need to request access so you can download the files and connect your LM directly to your Android device. I tested this and it works great. Orion is still not compatible with Android but they are working on it.

Matthew Strawbridge
  • 19,940
  • 10
  • 72
  • 93
Chop Labalagun
  • 592
  • 1
  • 6
  • 19