i'm trying to use the Huawei HMS map kit in my app, i'm new to maps overall (whether it be from google or huawei), i followed the tutorials in the documentation and in the code labs offered by huawei and put my code together but when i run the map activity nothing appears, all i get is a blank activity, i've written some log statements throughout my code and only one of them is logged which is put in the very top of the on create method. the app doesn't crash either.
here is my code, what could be wrong with it?
public class MapActivity extends AppCompatActivity implements OnMapReadyCallback {
private HuaweiMap hMap;
private MapView mMapView;
private static final String MAPVIEW_BUNDLE_KEY = "MapViewBundleKey";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_map);
Log.i("TAG", "onCreate");
//get mapview instance
mMapView = findViewById(R.id.mapView);
Bundle mapViewBundle = null;
if (savedInstanceState != null) {
mapViewBundle = savedInstanceState.getBundle(MAPVIEW_BUNDLE_KEY);
}
MapsInitializer.setApiKey(android.net.Uri.encode("my api key here"));
mMapView.onCreate(mapViewBundle);
//get map instance
mMapView.getMapAsync(this);
}
@Override
public void onMapReady(HuaweiMap map) {
//get map instance in a callback method
Log.d("TAG", "onMapReady: ");
hMap = map;
}
@Override
protected void onStart() {
super.onStart();
mMapView.onStart();
}
@Override
protected void onStop() {
super.onStop();
mMapView.onStop();
}
@Override
protected void onDestroy() {
super.onDestroy();
mMapView.onDestroy();
}
@Override
protected void onPause() {
mMapView.onPause();
super.onPause();
}
@Override
protected void onResume() {
super.onResume();
mMapView.onResume();
}
private static boolean hasPermissions(Context context, String... permissions) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && permissions != null) {
for (String permission : permissions) {
if (ActivityCompat.checkSelfPermission(context, permission) != PackageManager.PERMISSION_GRANTED) {
return false;
}
}
}
return true;
}
}
outside of the code i've made sure of my huawei app gallery connect configuration, api key and all, as well as the needed dependencies in the gradle
and i checked my minSDK and made sure it was 19 too. still..nothing is working
please help me
Thanks