Java API

fixed RegisterDevice example