nightfixed
nightfixed

Reputation: 841

Android HERE SDK - sample app is not replacing app_id and app_code

I am trying to run the sample application according to the starter guide: https://developer.here.com/documentation/android-premium/dev_guide/topics/app-run-simple.html

My problem is that, the requested URLs don't contain the appropriate app_id and app_code, as they exist in the manifest:

    <meta-data
        android:name="com.here.android.maps.appid" android:value="asdfghjklp098" />
    <meta-data
        android:name="com.here.android.maps.apptoken" android:value="123poiiuyttrrwq" />

When I try to read the manifest values in code, using the following:

       try {
        ApplicationInfo app = getPackageManager().getApplicationInfo(getPackageName(), PackageManager.GET_META_DATA);
        Bundle bundle = app.metaData;
        Log.d("MetaDataLog", bundle.getString("com.here.android.maps.appid"));
          //prints asdfghjklp098
        Log.d("MetaDataLog", bundle.getString("com.here.android.maps.apptoken"));
         //prints 123poiiuyttrrwq
       } catch (PackageManager.NameNotFoundException e) {
        e.printStackTrace();
       }

The manifest meta-data is loaded correctly. The tile URLs request look like this:

E/a.a.a.a.a.z0$d: IOException : while creating server connection. | failed to connect to 2.base.maps.api.here.com/2.18.232.228 (port 443) from /10.0.2.16 (port 55900) after 5000ms for URL: https://2.base.maps.api.here.com/maptile/2.1/maptile/newest/normal.day/11/324/701/512/png8?app_id={APP_ID}&app_code={APP_CODE}&lg=ENG&lg2=def&pview=DEF&ppi=320

Any idea what could be the issue ?

Upvotes: 0

Views: 66

Answers (1)

nightfixed
nightfixed

Reputation: 841

Solved the issue. The problem was, I was running on emulator.

I tested on another physical device, and the app was running fine.

Tip: DO NOT use emulators, even if the documentation states that they are supported. https://developer.here.com/documentation/android-premium/dev_guide/topics/system-requirements.html

Upvotes: 1

Related Questions