Java API examples

Added example for RegisterDevice