Questions
Why does my NavInfo Map API Map not display the basemap?
Check if the correct AK is used in the program, and if there is permission to open a network connection. Online mode requires Internet connection and offline mode requires offline data.
How does the API get location information?
In [Navinfo Navigation SDK for Android], if you need to locate by non-GPS, you can use the MPS hybrid positioning interface of the navinfo, combined with the development kit to achieve the current user positioning, and can be displayed on the map through the dot The corresponding location. In the program, if you need to use this function, you need to register the GPS and network usage rights first. The MPS hybrid positioning interface supports GPS, base station and WIFI integrated positioning, and the data achieves nationwide coverage.
How do I add a map authorization AK in my app?
Using the key (AK) needs to add the jar and so related to the base library to the project
1. Add AK configuration to AndroidManifest
AKs is configured in AndroidManifest. The code example is as follows:
<application andoid:name=".SDKApplication" android:icon="@drawable/icon" android:label="@string/app_name"> <meta-data android:name="Navinfo_AK" Android:value="you applied for AK"/> …… </application>
2. Initialize the base library in the application
You can customize the Application when the application is initialized, initialize the authorization and pass in the AK. The sample code is as follows:
public class SDKApplication extends Application { @Override public void onCreate() { super.onCreate(); NavinfoApi.init(this); } }
How do I use live traffic?
First initialize the MapRenderer object and then set mRenderer.enableTmc(true) to start real-time traffic, and mRenderer.enableTmc(false) to cancel real-time traffic.
What is the operation of the gesture on the map in the SDK?
Single-point movable map with multiple points to control the horizontal angle of the map and the direction of the map.
After playing multiple points on the map, do you operate on a single point?
Map Doting Generally, when you declare this object with CustomAnnotation and Annotation, you need to pass in multiple parameters such as: CustomAnnotation(int zLevel, NdsPoint pos, int iconId, Vector2DF pivot, android.graphics.Bitmap icon), when creating multiple objects The iconIds cannot be the same, and if they are the same, there will be problems.
Compile runtime error log troubleshooting
Development Tools for Android Studio 3.0+
1. If you filter out "invalid ak" error under Logcat
Troubleshooting steps:
1.1 Check whether the value corresponding to the meta-data node android:name="Navinfo_AK" is correctly filled in AndroidManifest.xml.
1.2 Check whether the application node has android:name in AndroidManifest.xml, whether there is a class name, whether NavinfoApi.init(this) is called in onCreate() in this class
1.3 The operation of the demo requires developers to go to https://lbs.navinfo.com/dev/app_list to register the login user and obtain the AK according to the instructions in the development guide.
2. Filter out "Digital signature verification failed" under Logcat
Troubleshooting steps:
2.1 Compile the apk, use the command `keytool -printcert -jarfile complete apk path` under window, and check whether the SHA1 value of the apk certificate fingerprint is consistent with the corresponding SHA1 filled in the application in the open platform.
2.2 Please confirm that the compiled version is release or debug version, and confirm that the AK of the project is consistent with the value of the security code SHA1 filled in by the corresponding application in the open platform.
2.3 Please confirm that the application PackageName corresponding to AK in the open platform matches the value of applicationId in app/build.gradle in your project.
3. If the prompt {status=403, message='network error'} in the demo project, please check the above two types of errors.