Question: We are an overseas app, the market department to Malaysia open over there market, found a problem, is our app location problem, or Chengdu positioning, the main reason is the use of this app in Malaysia, the request with the latitude and longitude parameters are Chengdu, resulting in the server returned to the location of Chengdu.
First, the Android positioning method
Android is commonly used in three ways: GPS-based positioning, base station-based positioning, WiFi-based positioning
1) based on GPS positioning
GPS positioning needs GPS module (hardware) support, no GPS module is unable to GPS positioning.
The biggest advantage of GPs positioning is that its positioning accuracy is high, the disadvantage is high power consumption, positioning slow, indoor and basement basic positioning.
2) based on base station location
Based on the collection of mobile phone base station information and mobile phone-related information (MNC, MCC, LAC) to locate, base station positioning the biggest advantage is: fast positioning speed, the disadvantage is: positioning accuracy is slightly worse, no network signal can not be used.
3) based on WiFi location:
Similar to the base station location, the location is based on the WiFi information acquired by the current device.
You can view your program's preferred targeting methods from Androidmanifest.xml:
Android.permission.access_fine_location→gps positioning
android.permission.access_coarse_location→ Network Location
Second, theAndroid application positioning principle
Locationmanager is a user location service for managing Android, using it to listen for current location information and define the information to be returned, such as latitude and longitude, azimuth, etc.
Note the point:
1, if the program has the right to open the GPS, the user set off the GPS but also to obtain the location of the demand will automatically open the GPS for positioning, positioning will automatically turn off the GPS;
2, the positioning must set the time-out period, or if it is not possible to locate the situation will remain stuck in the positioning can not exit the use of other functions;
3, if the time-out can be the location of the last position (Locationmanager has the method can get the position of the previous location), if the last location is empty, prompting the user to locate the failure.
Third, the determination of the position of the angle from which to consider
1, check three kinds of positioning method positioning can be successful, accurate positioning accuracy and no error;
2, three kinds of positioning orthogonal combination, check the positioning function and positioning accuracy;
3, the program has to open the GPS access, shut down the network and GPS, check whether positioning and positioning accuracy;
4. Two processing conditions for failed positioning (failure prompt and whether to return to last position);
5, the positioning process and calls, short MMS, Bluetooth conflict;
6, the positioning process with the function key interaction;
7, different network environment (mobile, unicom, telecommunications in the 3g/2g) positioning speed and accuracy;
8, different environment (indoor, outdoor, elevator) positioning and accuracy;
9. Local test field positioning (DDMS simulation)
Especially 9th, this is the pit, not the test.
Android location Test (PIT)