How to allow SDK to access Wifi/Internet hotspots
I have seen several customers struggling with the following use case:
If you are running any of our HERE SDK application on any device, it's been found that when you switch on the mobile hostspot and try to access online services like routing, navigation etc, your app will report an error saying "Offline". To fix this kindly configure Proxy DNS as a workaround -<br />private void initializeHERESDK() { String accessKeyID = "yourKeyID"; String accessKeySecret = "yourKeySecret"; SDKOptions options = new SDKOptions(accessKeyID, accessKeySecret); InetAddress dnsAddress = null; try { dnsAddress = InetAddress.getByName("1.1.1.1"); } catch (UnknownHostException e) { e.printStackTrace(); } // Create a NetworkEndpoint instance with the InetAddress NetworkEndpoint dnsServer = new NetworkEndpoint(dnsAddress); // Add the NetworkEndpoint to the domainNameSystemServers field of NetworkSettings options.networkSettings.domainNameSystemServers.add(dnsServer); if (dnsAddress != null) { Log.d("HERE_SDK_DNS", "Using DNS server: " + dnsAddress.getHostAddress()); } else { Log.d("HERE_SDK_DNS", "Failed to set custom DNS server."); } try { Context context = this; SDKNativeEngine.makeSharedInstance(context, options); } catch (InstantiationErrorException e) { throw new RuntimeException("Initialization of HERE SDK failed: " + e.error.name()); }}`<br />