Search code examples
locationmanagerhere-apinokiax

Is it possible to get a user's location on nokiax without having to include the HERE maps sdk?


I need to detect a user's coarse location (just the city and country) within the app. I have the normal android code using android.location.LocationManager class. But when I ported to NokiaX, the app does not report any location. The HERE sdk only talks about using the HERE maps (which I don't need)


Solution

  • I just tried this with following permissions:

    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
    <uses-permission android:name="android.permission.INTERNET"/>
    

    and with code:

    LocationManager locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
    locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, this);
    

    And it took less than 10 seconds to get first location in my balcony, and then it gets updates every second. Thus I don't see the problem in there.