Using .Net Extensions to Disable GPS Status Button

1680
1
05-12-2014 11:15 PM
LukaPetravic
New Contributor
Hi I am a new developer as far as ARCGIS Mobile .Net extensions and tasks are concerned.

I was wondering is it possible to make the GPS status button on the top right corner of ARCGIS mobile somehow obscured or unusable or invisible so the user can't disconnect/reconnect from GPS? Either that or obscuring/disabling the "GPS Status" and "Disconnect from GPS" and "Reconnect to GPS" menu options.
0 Kudos
1 Reply
AkhilParujanwala
New Contributor III
Hi Luka,

I am replying here so that everyone can see how to do this.

First make and an extension to your Out-Of-The-Box WPF ArcGIS Mobile Application.
There are guides on how to make an extension.

The code to get rid of the menu items under the GPS symbol in the top right corner is:
MobileApplication.Current.GpsMenuItems.Clear();

When users click on the GPS Icon in the top right corner no menu items will appear. Meaning users will not be able to see their GPS status or Connect or Disconnect the GPS.

But if you remove the menu items to below the GPS Icon, users won't be able to connect to the GPS unless you have coded a function to connect to the GPS.

In my application I have a button as part of the IStartUp Pages which will allow the users to click on own (coded) connect to GPS button.
Here's the code on how to connect to the GPS using code:

SerialPortGpsConnection aSerialPortGpsConnection = (SerialPortGpsConnection)MobileApplication.Current.GpsConnectionManager.GpsDisplay.GpsConnection;
aSerialPortGpsConnection.PortName = "Auto";
SerialPortGpsConnection.Open();

I would put this into a try and catch in the case that you don't have a physical gps connected yet, or if the GPS is not yet sending NMEA strings to the computer/ArcGIS Mobile.

If you have any further questions please let me know.


Regards,

Akhil P.
0 Kudos