I try to install carto to Android studio but I have a lot errors. I follow the instructions of the carto web site (https://carto.com/developers/mobile-sdk/guides/getting-started/#tab-java).
package com.example.vassilis.goldman_carto;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import com.carto.layers.CartoBaseMapStyle;
import com.carto.layers.CartoOnlineVectorTileLayer;
import com.carto.ui.MapView;
public class MainActivity extends AppCompatActivity {
// make sure you replace the String value with the one from carto.com mobile app registration !
final String LICENSE = "insert license key - hello stackoverflow";
private MapView mapView;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
// Register the license so that CARTO online services can be used
MapView.registerLicense(LICENSE);
// Get 'mapView' object from the application layout
mapView = (MapView) this.findViewById(R.id.mapView);
// Add basemap layer to mapView
CartoOnlineVectorTileLayer baseLayer = new CartoOnlineVectorTileLayer(CartoBaseMapStyle.CARTO_BASEMAP_STYLE_VOYAGER);
mapView.getLayers().add(baseLayer);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
error: method registerLicense in class MapView cannot be applied to given types; required: String,Context found: String reason: actual and formal argument lists differ in length