Embedded Editor Developer's Guide

Use as a WebView Component

When you use the Embedded Editor in an Android or iOS application, you can either launch the mobile device browser to load the reporting page or use the Android component WebView or iOS component WKVebView. In either case, construct the URL passed to the mobile device browser or WebView/WKVebView based on how you want the user to interact with the Embedded Editor. You need to add the relevant app_id and app_code credentials to the URL in order to use the service.

To launch a browser from an Android device, use the method startBrowser() in MainActivity as follows:
String feedbackUrl = "https://mapfeedback.here.com/";

  // use a view intent on the URL to open the default browser
  Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(feedbackUrl));
  startActivity(browserIntent);
The following steps create an example implementation that illustrates one way to use the Android component WebView. If you are using an iOS application, create the functional equivalent for iOS.
  1. In the application AndroidManifest.xml file, enable the correct permissions as follows:
    <uses-permission android:name="android.permission.INTERNET"/>
      <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
  2. Configure the WebView to enable JavaScript and Geolocation capabilities as follows:
    // make sure we're properly set up to do JavaScript and Geolocation
      WebSettings webSettings = myWebView.getSettings();
      webSettings.setJavaScriptEnabled(true);
      webSettings.setGeolocationEnabled(true);
      webSettings.setGeolocationDatabasePath( this.getFilesDir().getPath());
      //cache the geolocation data
  3. Configure the WebView to handle all URLs in the application as follows:
    // We want the WebView to take care of all URLs and not open a browser
      myWebView.setWebViewClient(new WebViewClient() {
      public boolean shouldOverrideUrlLoading(WebView view, String url) {
      return (false);
      }
      });

    The URL passed to WebView should be constructed to create the correct user experience.

  4. Set up the Back button as follows:
    // we want the back button to work properly inside the widget
      @Override
      public boolean onKeyDown(int keyCode, KeyEvent event) {
      if ((keyCode == KeyEvent.KEYCODE_BACK) && myWebView.canGoBack()) {
    
      // unless we have submitted properly, 'back' takes us back a page in the WebView
      if(!myWebView.getUrl().contains("#/submit")) {
      myWebView.goBack();
      return true;
      }
      }
      return super.onKeyDown(keyCode, event);
      }
  5. Implement logic to completely close the Activity when the URL contains a "#/submit" as this is when the user has submitted a feedback request.

You cannot use this account to purchase a commercial plan on Developer Portal, as it is already associated to plans with different payment methods.

To purchase a commercial plan on Developer Portal, please register for or sign in with a different HERE Account.

Something took longer than expected.

The project should be available soon under your projects page.

Sorry, our services are not available in this region.

Something seems to have gone wrong. Please try again later.

We've detected that your account is set to Australian Dollars (AUD).
Unfortunately, we do not offer checkouts in AUD anymore.
You can continue using your current plan as normal, but to subscribe to one of our new plans,
please register for a new HERE account or contact us for billing questions on selfservesupport@here.com.