The attached project wraps this Github project. The library files are in the /files folder of the attached B4A project. Copy them to your additional library folder. Also posting the Java code. You will also need to enable the Phone library in the B4A project. Move your device in different directions and see the compasses changing accordingly.
compassview
Author: Johan Schoeman
Version: 1
compassview
Author: Johan Schoeman
Version: 1
- CompassView
Fields:- ba As BA
- BringToFront
- DesignerCreateView (base As PanelWrapper, lw As LabelWrapper, props As Map)
- Initialize (EventName As String)
- Invalidate
- Invalidate2 (arg0 As Rect)
- Invalidate3 (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
- IsInitialized As Boolean
- RemoveView
- RequestFocus As Boolean
- SendToBack
- SetBackgroundImage (arg0 As Bitmap)
- SetColorAnimated (arg0 As Int, arg1 As Int, arg2 As Int)
- SetLayout (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
- SetLayoutAnimated (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int, arg4 As Int)
- SetVisibleAnimated (arg0 As Int, arg1 As Boolean)
- Background As Drawable
- Color As Int [write only]
- CompassBackgroundColor As Int [write only]
- CompassDegrees As Float [write only]
- CompassLineColor As Int [write only]
- CompassMarkerColor As Int [write only]
- CompassRangeDegrees As Float [write only]
- CompassShowMarker As Boolean [write only]
- CompassTextColor As Int [write only]
- CompassTextSize As Int [write only]
- Enabled As Boolean
- Height As Int
- Left As Int
- Tag As Object
- Top As Int
- Visible As Boolean
- Width As Int