Hi.
Did you add location permission into your app?, also in the native code you need to provide information about Geolocation(like AR Mode and the location provider in the case of Android).
What version of the SDK are you running?
Did you follow the examples of the SDK?
What version of Android/IOS did you encounter this issue?
Hi Joaquin, Im using Android SDK
yes im already added location permission and location provider
public LocationProvider(final Context context, LocationListener locationListener) { super(); this.locationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE); this.locationListener = locationListener; this.context = context; this.gpsProviderEnabled = this.locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER); this.networkProviderEnabled = this.locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER); }
public void onResume() { if (this.locationManager != null && this.locationListener != null) { // check which providers are available are available this.gpsProviderEnabled = this.locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER); this.networkProviderEnabled = this.locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER); /** is GPS provider enabled? */ if (this.gpsProviderEnabled) { final Location lastKnownGPSLocation = this.locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER); if ( lastKnownGPSLocation != null && lastKnownGPSLocation.getTime() > System.currentTimeMillis() - LOCATION_OUTDATED_WHEN_OLDER_MS ) { locationListener.onLocationChanged( lastKnownGPSLocation ); } if (locationManager.getProvider(LocationManager.GPS_PROVIDER)!=null) { this.locationManager.requestLocationUpdates( LocationManager.GPS_PROVIDER, LOCATION_UPDATE_MIN_TIME_GPS, LOCATION_UPDATE_DISTANCE_GPS, this.locationListener ); } } /** is Network / WiFi positioning provider available? */ if ( this.networkProviderEnabled ) { final Location lastKnownNWLocation = this.locationManager.getLastKnownLocation( LocationManager.NETWORK_PROVIDER ); if ( lastKnownNWLocation != null && lastKnownNWLocation.getTime() > System.currentTimeMillis() - LOCATION_OUTDATED_WHEN_OLDER_MS ) { locationListener.onLocationChanged( lastKnownNWLocation ); } if (locationManager.getProvider(LocationManager.NETWORK_PROVIDER)!=null) { this.locationManager.requestLocationUpdates( LocationManager.NETWORK_PROVIDER, LOCATION_UPDATE_MIN_TIME_NW, LOCATION_UPDATE_DISTANCE_NW, this.locationListener ); } } /** user didn't check a single positioning in the location settings, recommended: handle this event properly in your app, e.g. forward user directly to location-settings, new Intent( Settings.ACTION_LOCATION_SOURCE_SETTINGS ) */ if ( !this.gpsProviderEnabled || !this.networkProviderEnabled ) { Toast.makeText(this.context, "Please enable GPS and Network positioning in your Settings ", Toast.LENGTH_LONG).show(); } } }
Hi, did you follow the Wikitude Example and set up these callbacks?
@Override public void onResume() { super.onResume(); locationProvider.onResume(); /* * The SensorAccuracyChangeListener has to be registered to the Architect view after ArchitectView.onCreate. * There may be more than one SensorAccuracyChangeListener. */ architectView.registerSensorAccuracyChangeListener(sensorAccuracyChangeListener); } @Override public void onPause() { locationProvider.onPause(); super.onPause(); // The SensorAccuracyChangeListener has to be unregistered from the Architect view before ArchitectView.onDestroy. architectView.unregisterSensorAccuracyChangeListener(sensorAccuracyChangeListener); } /** * The ArchitectView has to be notified when the location of the device * changed in order to accurately display the Augmentations for Geo AR. * * The ArchitectView has two methods which can be used to pass the Location, * it should be chosen by whether an altitude is available or not. */ @Override public void onLocationChanged(Location location) { final float accuracy = location.hasAccuracy() ? location.getAccuracy() : 1000; if (location.hasAltitude()) { architectView.setLocation(location.getLatitude(), location.getLongitude(), location.getAltitude(), accuracy); } else { architectView.setLocation(location.getLatitude(), location.getLongitude(), accuracy); } }
Febri Dolar
So im trying to get user latitude and longitude into the webserver URL for POI data, here's the URL
i have tried that link and it works with no problem, but when i change the location parameter to user current location (latitude & longitude), i have tried this code
when i run the program, the marker won't show up.
my locationChanged code :
what did i do wrong here ?
Thanks