skmaps - SKobbler location accuracy in android -
i implementing custom turn-by-turn navigation using skmaps. getting gps location using gpsprovider(skcurrentpositionprovider --> gpsprovider enabled).
the location provider gives accurate location when device connected in wifi. if switch network 3g (turn off wifi), location provider produces wrong location results.
how overcome issue? please provide suggestions overcome issue.
private void setgpsproviders() { currentpositionprovider = new skcurrentpositionprovider(activity); currentpositionprovider.setcurrentpositionlistener(activity); if (sknavigationutils.hasgpsmodule(activity)) { currentpositionprovider.requestlocationupdates(true, false, true); //usegpsprovider, usenetworkprovider, usepassiveprovider } else if (sknavigationutils.hasnetworkmodule(activity)) { currentpositionprovider.requestlocationupdates(false, true, true); } }
all right, mobile network gives low accuracy of coordinates (from few hundred meters several kilometers), while accuracy wifi has several tens of meters. make sure have turned on gps in phone. can done in code:
//import android.location.locationmanager; public static boolean isgpsenabled (context context) { locationmanager manager = (locationmanager) context.getsystemservice (context.location_service); return manager.isproviderenabled (locationmanager.gps_provider); }
Comments
Post a Comment