I've written a similar OpenUI control on Windows (WPF client) to read the GPS coordinates of the Windows tablet via the Windows GeoLocation API. I've defined external values on the Agentry UI control which loads the OpenUI control. When one of the External Values is accessed e.g. through a Agentry rule, method GetExtensionString(string key) of the OpenUI control is called, fetches the GPS location property which was requested and returns it.
(It also has some additional logic which live updates the GPS position on the transaction screen as a string (so that the user sees the updated location as he moves along))
So, instead of implementing an OpenUI button, you might want to just have another field on which you put an Update Rule which then accesses the External Values of your OpenUI control to retrieve the location data.