android


Device specific bug with CompassOverlay?


I'm currently developing an app using OSMdroid 5.1 on a Samsung Galaxy Tab E.
My problem here is I can't get the compass to show up at all. I searched hours on the internet and in OSMdroid source code but I couldn't figure it out.
I decided to test it on my personal phone (Samsung Galaxy S4) and turns out it appears and work perfectly on this device.
Tablet is running on Android 5.1.1
Phone is running on Android 5.0.1
I am using Android Studio 2.1
The following is all the code that refers to CompassOverlay.
#Override
public void onResume() {
super.onResume();
compassOverlay.enableCompass();
myLocationOverlay.enableMyLocation();
//mMyLocationOverlay.enableFollowLocation();
}
#Override
public void onPause() {
super.onPause();
compassOverlay.disableCompass();
this.myLocationOverlay.disableMyLocation();
//this.myLocationOverlay.disableFollowLocation();
}
private void mapEndConfig() {
this.osmv.setBuiltInZoomControls(true);
this.osmv.setMultiTouchControls(true);
osmv.getController().setZoom(11);
double lon = -64.5996; //-74.15702819824206; //,45.6294
double lat = 45.6294; //40.64938745451832;
IGeoPoint point = new GeoPoint(lat, lon); // lat lon and not inverse
osmv.getController().setCenter(point);
myLocationOverlay = new MyLocationNewOverlay(this, osmv);
compassOverlay = new CompassOverlay(this, new InternalCompassOrientationProvider(this), this.osmv, mResourceProxy);
osmv.getOverlayManager().add(myLocationOverlay);
osmv.getOverlayManager().add(compassOverlay);
/*anotherOverlayItemArray = new ArrayList<OverlayItem>();
anotherOverlayItemArray.add(new CompassOverlay());
ItemizedIconOverlay<OverlayItem> anotherItemizedIconOverlay
= new ItemizedIconOverlay<OverlayItem>(
this, anotherOverlayItemArray, null);
this.mOsmv.getOverlays().add(anotherItemizedIconOverlay);*/
/*myLocationOverlay.runOnFirstFix(new Runnable() {
public void run() {
osmv.getController().animateTo(myLocationOverlay.getMyLocation());
}
});*/
}
Nobody seems to have encountered something like that with the compass before, does anyone have a solution?
Okay I found the problem. It's because the Samsung Galaxy Tab E does not have a magnetometer for the compass.
When OSMdroid does not detect it, instead of giving an error or warning, it simply does not show it.

Related Links

can we make the whole application zoomable in android ?
Getting issue to set the color on list view item
Android - Is it possible to have dynamically moving clickable objects in a view
Make ball bounce and eventually come to rest
fbShare in android
How to play an encrypted video file in Android
Allocate longitude and latitude of an object
Don't receive nested XML nodes from SOAP Web Service using ksoap2
Authentication in KSOAP2 request to .NET webservice in Android
Autoclick search button (android)
Issues with custom layout for spinner for Android
Using Ant to build project and run JUnit Test Android app but Ant Junit Test fails
Uploading the whole sqlite database to google app engine
How to Track App Usage in Android? How to detect when an activity is launched?
Is There a Way to Playback Raw Audio/Video Streams in Android API's?
Android Honeycomb notification popup too frequently

Categories

HOME
gridview
apache-jena
twig
error-handling
pclxl
seo
emscripten
tail
telegram-bot
tvos
nuget-package
character
modal-dialog
google-schemas
selenium-ide
shared-libraries
aws-sdk
html5-appcache
digital-signature
ember-cli
gpio
testcomplete
boost-asio
sql-server-2000
testbed
dsx-desktop
dynamic-jasper
least-squares
jpad
graphhopper
modernizr
bc
news
comparison-operators
visa
branching-and-merging
postgresql-8.4
show-hide
memory-mapping
vaadin-charts
dapper-simplecrud
jide
openal
pdf-conversion
libjpeg
flyout
mathcad
rxtx
testrail
chromium-os
redistributable
winusb
delta
omniauth-facebook
query-by-example
aurora
invoke-sqlcmd
aspen
concept-insights
spring-retry
state-restoration
boomerang
assertion
rubaxa-sortable
visual-sourcesafe-2005
airbrake
omnifaces
zend-currency
rapidsvn
angular-gettext
webfinger
entry-point
cbind
gii
cuba
koala
getopt
breakout
unit-of-work
beaker-testing
neos-server
swfobject
intersect
extreme-programming
qi4j
thttpd
lambdaj
mapping-by-code
jsr286
isa-swizzling
gobject-introspection
expression-blend-4
workflow-services
delimited-text
dsl-tools
product-management
blind

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App