.Net MAUI Get Device Location [Real-Time Geo Location]

Поділитися
Вставка
  • Опубліковано 20 гру 2024

КОМЕНТАРІ • 25

  • @CodingDroplets
    @CodingDroplets  4 місяці тому

    🌟 Source Code: www.patreon.com/posts/109830171
    🔗 MAUI Tutorial Series: ua-cam.com/play/PLzewa6pjbr3KKuUTp8ivXjcR4rvFvyoNw.html

  • @Machado9106
    @Machado9106 4 місяці тому +1

    nice class! thanks for share

    • @CodingDroplets
      @CodingDroplets  4 місяці тому +1

      You are most Welcome! Glad to hear that.

  • @saroshwadia
    @saroshwadia 4 місяці тому +1

    Great Video - clear and easy to follow - Have three questions though
    1] DeviceLocationMessage is not being referenced by anything - why?
    2] Geolocation_LocationChanged seems to fire only once in the Start()
    3] The Lat, Long values in MainPage.xaml seems to be updated only once and never refresh - maybe because of 2]?
    When will the Blazor Mapping video come out?
    Thx

    • @CodingDroplets
      @CodingDroplets  4 місяці тому

      Thanks for the great questions! Here are the answers:
      1. You can add the reference like this: `WeakReferenceMessenger.Default.Send(new DeviceLocationMessage(deviceLocation));`. When listening, use `WeakReferenceMessenger.Default.Register(this, (sender, deviceLocation) => OnLocationChanged(deviceLocation.Value));`. Sorry for not including this correction in the video, but it will still work the way I implemented it.
      2. The `LocationChanged` event triggers whenever the location changes. You'll see the values update if you're moving. I used an emulator in the video, so there were no value changes shown.
      3. Same as point 2 - values should update with location changes in a real-world scenario.
      The Blazor Mapping video is on the way. Stay tuned!

    • @saroshwadia
      @saroshwadia 2 місяці тому

      @@CodingDroplets It would be great if you could combine this and show a map in the same MAUI app that could track the location of the device in real time - similar to how google maps work while driving but here to track while walking 🙂 Thx

    • @ashfajardo9194
      @ashfajardo9194 Місяць тому

      ​@@CodingDroplets same as number 2 question it makes delay around 10 minutes to take new location

  • @cissemy
    @cissemy 3 місяці тому +1

    Hi
    Does it support the background geolocation?

    • @CodingDroplets
      @CodingDroplets  2 місяці тому

      Great question! In the video, I used a singleton service, but if you're asking about Android's background geolocation (tracking even when the app is closed), you'd typically need to implement a ForegroundService on Android for continuous location updates.

    • @cissemy
      @cissemy 2 місяці тому

      @@CodingDroplets
      Do you have any course about ForegroundService on Android for continuous location updates?

  • @bsksoftwaretechnology2071
    @bsksoftwaretechnology2071 4 місяці тому +1

    please put next video for live location tracker. thanks for your valuable time...

  • @ashfajardo-x1w
    @ashfajardo-x1w Місяць тому +1

    HI this is working but it delays around 2 mins. i think per distance?

    • @CodingDroplets
      @CodingDroplets  Місяць тому

      Can you check the GeolocationAccuracy and TimeSpan configured for GeolocationListeningRequest? In the video I've assigned TimeSpan.FromSeconds(1) to update every second.

  • @cissemy
    @cissemy 2 місяці тому +1

    How to replace button with toggle ?
    Thanks

    • @CodingDroplets
      @CodingDroplets  2 місяці тому

      To replace the button with a toggle in .NET MAUI, you can use a Switch control.

    • @cissemy
      @cissemy 2 місяці тому

      @@CodingDroplets
      How to bind the toggle with viewmodel to act like what the button is doing ? Any sample code

  • @ZeeshanAhmad-q8o
    @ZeeshanAhmad-q8o 4 місяці тому +1

    Please make one project in .NET MAUI like a book summary app.

    • @CodingDroplets
      @CodingDroplets  4 місяці тому

      Thanks for the suggestion! I'll definitely consider creating a tutorial on that.

  • @Reminstoncs
    @Reminstoncs 3 місяці тому +2

    HOW TO GET unique device id for android in .NET MAUI

    • @CodingDroplets
      @CodingDroplets  3 місяці тому

      You can check this out: github.com/dotnet/maui/issues/4670
      I haven't tested it myself, but it might help with getting the unique device ID in .NET MAUI

  • @lomnom.thepirate
    @lomnom.thepirate Місяць тому +1

    the ui dosent work

    • @CodingDroplets
      @CodingDroplets  Місяць тому

      Have you implemented the WeakReferenceMessenger (as shown in the video) to notify the UI?

    • @lomnom.thepirate
      @lomnom.thepirate Місяць тому

      yea i think so,ill check