on 07-24-2014 11:02 AM
Hi,
Does anyone know if I can access the device location in an Agentry application?
The permissions for the Android Work Manager list GPS/Network location so I guess it might be possible?
Could I enhance one of the objects to include the location and pass it back to SAP?
Thanks,
Gregor
Tags edited by: Michael Appleby
Gregor,
Yes. Do it in a two step transaction process. First add 3 properties to the main object: Location (type location), Latitude (Decimal) and Longitude (Decimal).
Run a transaction called ResetGPS: One property is Location. This points to the location object in the Main object. Use initial value of rule before data entry. Add a rule called ResetLocationGPS. It looks like this:
GPS_LOCATION
0
Above rule uses the GPS_LOCATION System rule function to force the GPS to query the current position.
Apply the above transaction.
Run a second transaction called QueryGPS. Two properties here. Latitude points to the latitude main object property, and also longitude points to longitude main object property. Both properties use rule after data entry. The latitude rule looks like this. Do something similar for the longitude:
The BestEntry.GPSPrecision is a global and is set to 8. This limits the length of the returned value after the decimal point so it isn't so large. If you don't care about limiting the value, you can just take the FROM_DECIMAL_VALUE of the Current Latitude and forget the rest.
Apply this transaction.
Now the current lat and long are stored in the main object properties and can be used however you like. This worked for me on an iPhone, but should work exactly the same on any GPS enabled device.
Jason Latko - Senior Product Developer at SAP
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.