java - I don't get any altitude data (GPS Android) -
I'm applying a GPS, latitude, longitude, speed, height ... but I did not find any data on this one For me always get 1.0 as a value. (This is what happens with speed).
I tried with simulator of GPX in Eclipse (DMS) and on Terminal (KML Simulator, not on the road). ..but it always shows 0.0 or 1.0.
My code is as follows:
Private location currentLoc; Personal Location Previous Lock;
Criteria for GPS ...
// Criteria object is optional. Representation value of "GPS" criteria will return oGPSSettings = new criteria (); OGPSSettings.setAccuracy (Criteria.ACCURACY_FINE); OGPSSettings.setSpeedRequired (true); OGPSSettings.setAltitudeRequired (true); OGPSSettings.setBearingRequired (incorrect); OGPSSettings.setCostAllowed (false); OGPSSettings.setPowerRequirement (Criteria.POWER_MEDIUM);
When a new location is received ...
Public zero transfers at the @Override (location location) {currentLoc = location; String sText = "height:" + currentLoc.getAltitude (); TxtOutput.setText (sText); } // sets this place as the last location PreviousLoc = currentLoc; }
I removed the code from things like displaying latitude, longitude ... now I will only show height
Question is : you Why does it feel like this? Latitude and longitude works fine, but the height is probably not a hardware issue? Because the code looks right, I think it should work only with the getAltitude function
Thank you in advance!
Can you ask "android.permission.ACCESS_FINE_LOCATION" in your manifest? Also try changing ACCURACY_FINE to ACCURACY_HIGH
Comments
Post a Comment