I was following this tutorial found on the wiki to access my phone's GPS and I got a script alert for the error
"Error: Security Access Check Failed".
The tutorial was found from: http://wiki.forum.nokia.com/index.ph...ition_with_WRT
The code I used was:
GPSLocation() is basically a simple object I created with 2 properties and some simple methods to store the longitude and latitude values.Code:function alertMyLoc(){ var myLoc = new GPSLocation (); var so; try { //Retrieves the Service object to the ILocation interface so = device.getServiceObject("Service.Location", "ILocation"); } catch (e) { alert(' ' +e); } // This specifies update option used while retrieving location estimation. var updateoptions = new Object(); // Setting PartialUpdates to 'FALSE' ensures that user get atleast // BasicLocationInformation (Longitude, Lattitude, and Altitude.) is the default when no LocationInformationClass criteria is given. updateoptions.PartialUpdates = false; var criteria = new Object(); criteria.Updateoptions = updateoptions; try { //Executes the GetLocation method and sets the callbackLocation as the callback function to be called. so.ILocation.GetLocation(criteria,function(transId, eventCode, result) { myLoc.lat = result.ReturnValue.Latitude; myLoc.lng = result.ReturnValue.Longitude; alert("My Location: " + myLoc.lat + " & " + myLoc.lng); }); } catch (e) { alert ("getLocationAsync: " + e); } }
The error came from the first "try".
Can someone advise what went wrong?
Many thanks!

Reply With Quote


