**I have followed Here installation process and still can not get the map to load in the app. Yes i have the actual id and token codes listed in the manifest just not posting them online. Im new to coding and learning through trial and error any help will be greatly appreciated.
This is the xml file**
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<fragment
android:id="@+id/mapfragment"
class=".com.here.android.mpa.services.Mapservice"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
This is the java file
import android.content.Intent;
import android.os.Bundle;
import android.widget.Button;
import com.here.android.mpa.common.GeoCoordinate;
import com.here.android.mpa.common.OnEngineInitListener;
import com.here.android.mpa.mapping.Map;
import com.here.android.mpa.mapping.MapFragment;
import androidx.appcompat.app.AppCompatActivity;
public class ThirdActivity<MapFragment, Map> extends AppCompatActivity {
Button button4;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate ( savedInstanceState );
setContentView ( R.layout.activity_third );
button4 = findViewById(R.id.button4);
button4.setOnClickListener( v -> {
Intent intent = new Intent(ThirdActivity.this,MainActivity.class);
startActivity(intent);
} );
}
}
private Map map = null;
private MapFragment mapFragment = null;
@Override
protected <OnEngineInitListener
public void onEngineInitializationCompleted(OnEngineInitListener.Error error) {
if (error == OnEngineInitListener.Error.NONE) {
map = mapFragment.getMap();
map.setCenter(new GeoCoordinate(37.7397, -121.4252, 0.0), Map.Animation.NONE);
map.setZoomLevel((map.getMaxZoomLevel() + map.getMinZoomLevel()) / 2);
}
}> void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mapFragment = (MapFragment) getFragmentManager().findFragmentById(R.id.mapfragment);
mapFragment.init(new OnEngineInitListener() {
});
}
}
This is the manifest file
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
android:hardwareAccelerated="true"
<services
android:name=".com.here.android.mpa.services.Mapservice"
android:label="HereMapService"
android:process="global.Here.Map.Service.v3"
android:exported="true">
<intent-filter>
<action android:name=".com.here.android.mpa.service.Mapservice.v3."/>
</intent-filter>
</services>
<meta-data android:name="com.here.android.maps.appid"
android:value="I have the actual id posted in my manifest" />
<meta-data android:name="com.here.android.maps.apptoken"
android:value="I have actual token posted in my manifest/>
<meta-data android:name=".com.here.android.maps.license_key"
android:value="I have actual license key in my manifest"/>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</application>
</manifest>