Nod Developer Center

Developer Guide

Install example Android app (Instructions for Mac)

  • Use OpenSpatial.jar in your Android Project; view the README file for details
  • Make sure buck is in your $PATH and the Android device is connected to your Mac
  • Open a Terminal window and navigate to the ‘enimai/openspatial/android-sdk/sdk’ directory
  • Run ‘buck install example’
  • Browse installed apps on your Android device for ‘OpenSpatialExample’ (attach image)
  • To test registration and logging of motion (pointer, button) events using an active Nod device, open the example app and use an active Nod device to confirm behavior:
    • pointer movement appears on-screen as a moving white dot (attach image)
    • pressing the tactile button/s renders the white dot red for a moment (attach screenshot)

Sample code

  • Browse to ‘/modules/example/OpenSpatialExample’ using Android Studio
  • Review the AndroidManifest.xml file: (need to add code block)
  • Visit MainScreenActivity (under ‘module_src_com_example_openspatial’)
    • Start a Service by invoking the onCreate() method
      • public void onCreate(Bundle savedInstance)
    • Create a Bound Service by extending the Binder class
      • private ServiceConnection mPointerServiceConnection = new ServiceConnection()
    • MainScreenActivity checks with OpenSpatialService that provides clients with OpenSpatialEvents that they are interested in. The OpenSpatialService class is setup to receive intents from the emulator / BLE service
    • The getConnectedDevices() method is used to get a list of connected devices
    • This is followed by registering the kind of events the client is interested in. Once an event is received from the specified device the service calls the EventListener#OnEventReceived of the specified Listener
      • private void registerForEvents(final BluetoothDevice device)
    • Review try-catch blocks within this method to review declaration and registration for Pointer, Button, Pose6D, Motion6D and Gesture events

More information

If you want to know more, these are some good places to continue exploring:

  • Links to SDKs, developer focussed support, IRC.
  • Engage with the larger Nod development community on a variety of topics