예제 #1
0
 public override void OnLocationAvailability(LocationAvailability locationAvailability)
 {
     if (locationAvailability != null)
     {
         bool flag = locationAvailability.IsLocationAvailable;
         LocationLog.Info(TAG, "onLocationAvailability isLocationAvailable:" + flag);
     }
 }
예제 #2
0
 public override void OnLocationResult(LocationResult locationResult)
 {
     if (locationResult != null)
     {
         IList <Android.Locations.Location> locations = locationResult.Locations;
         if (locations.Count != 0)
         {
             foreach (Android.Locations.Location location in locations)
             {
                 LocationLog.Info(TAG,
                                  "onLocationResult location[Longitude,Latitude,Accuracy]:" + location.Longitude
                                  + "," + location.Latitude + "," + location.Accuracy);
             }
         }
     }
 }
예제 #3
0
 public static void RequestActivityPermission(Context context)
 {
     if (Build.VERSION.SdkInt <= BuildVersionCodes.P)
     {
         if (ActivityCompat.CheckSelfPermission(context, "com.huawei.hms.permission.ACTIVITY_RECOGNITION") == Permission.Denied)
         {
             string[] permissions = { "com.huawei.hms.permission.ACTIVITY_RECOGNITION" };
             ActivityCompat.RequestPermissions((Activity)context, permissions, 1);
             LocationLog.Info(TAG, "requestActivityTransitionButtonHandler: apply permission");
         }
     }
     else
     {
         if (ActivityCompat.CheckSelfPermission(context, "android.permission.ACTIVITY_RECOGNITION") == Permission.Denied)
         {
             string[] permissions = { "android.permission.ACTIVITY_RECOGNITION" };
             ActivityCompat.RequestPermissions((Activity)context, permissions, 2);
             LocationLog.Info(TAG, "requestActivityTransitionButtonHandler: apply permission");
         }
     }
 }
예제 #4
0
 public void OnSuccess(Java.Lang.Object locObj)
 {
     LocationLog.Info(TAG, "removeLocatonUpdatesWithCallback onSuccess");
 }