Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
The following listing is an example of the Java code required to fetch the handset location obtained via GPS for use within a Java application.
Criteria cr = new Criteria(); cr.setPreferredPowerConsumption(Criteria.POWER_USAGE_LOW cr.setAddressInfoRequired(false); cr.setAltitudeRequired(false); cr.setSpeedAndCourseRequired(false); cr.setHorizontalAccuracy(Criteria.NO_REQUIREMENT); cr.setVerticalAccuracy(Criteria.NO_REQUIREMENT); //cr.setPreferredResponseTime(30); locationProvider = LocationProvider.getInstance(cr); |