maddevsio / mad-location-manager

Mad Location Manager is a library for GPS and Accelerometer data "fusion" with Kalman filter
MIT License
533 stars 154 forks source link

How i use Kalmanlocation inside my own service #36

Closed mindfulritik closed 5 years ago

mindfulritik commented 5 years ago

ServicesHelper.addLocationServiceInterface(SendLocation.this); when I call this function oncreate of Service class then I get

java.lang.ClassCastException: android.os.BinderProxy cannot be cast to mad.location.manager.lib.Services.KalmanLocationService$LocalBinder

Servicehelper lineno:67

MosCriogen commented 5 years ago

https://github.com/maddevsio/mad-location-manager/issues/29

the same - problem is in manifest

MosCriogen commented 5 years ago

find this string: android:process=":service" in manifest 's section with your service and copy to section with lib

MosCriogen commented 5 years ago

example: my own service with calman lib calls

<service
        android:name="com.orderssupportapp.TestLocationUpdates"
        android:icon="@mipmap/ic_launcher"
        android:enabled="true"
        android:exported="true"
        android:launchMode="singleInstance"
        android:process=":service">
    </service>

lib section:

   <service
        android:name="mad.location.manager.lib.Services.KalmanLocationService"

        android:process=":service"

        android:enabled="true"
        android:exported="false"
        android:stopWithTask="false" />
Lezh1k commented 5 years ago

@MosCriogen thank you

mindfulritik commented 5 years ago

thank you @MosCriogen, now my problem solved .