wxr
2024-12-02 ea0b1e8e5f43c5fd0a7d479e25ede3b8cbea464a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
//using System;
//using System.Threading.Tasks;
//using Xamarin.Essentials;
 
//namespace HDL_ON_Android
//{
//    public static class LocationUtils
//    {
//        public static async Task<Location> GetCurrentLocationAsync()
//        {
//            try
//            {
//                var request = new GeolocationRequest(GeolocationAccuracy.Medium);
//                var location = await Geolocation.GetLocationAsync(request);
//                return location;
//            }
//            catch (Exception ex)
//            {
//                // 处理异常
//                Console.WriteLine($"获取位置信息失败: {ex.Message}");
//                return null;
//            }
//        }
//    }
//}