Platform Features and Device Sensors - .NET MAUI Tutorial Step-by-Step

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

КОМЕНТАРІ • 68

  • @jfversluis
    @jfversluis  2 роки тому +1

    💡Looking for the next part in this course? Click here to find it, here you will learn more about CollectionView: ua-cam.com/video/invsT4ST1SI/v-deo.html
    Want to review the full playlist? You can do that here 👉ua-cam.com/video/mgW6xviirQk/v-deo.html

  • @theunspotgieter2610
    @theunspotgieter2610 2 роки тому +6

    Another great video. Thank you very much for the awesome job you're doing.
    The location "Bug" seams to be because of the GetLastKnownLocationAsync() call. It basically gets the cached location every time you tap. If I use another emulator where I set the location before I tap the button then it finds another monkey. If I comment out that line then it finds different monkeys as I change my location.

    • @jfversluis
      @jfversluis  2 роки тому

      Thank you Theuns! Your name sounds Dutch...?
      Good catch on that bug! That totally makes sense! I still have to record the last video so I'll add that!

    • @grishsahradyan757
      @grishsahradyan757 2 роки тому

      Which emulator you use?

    • @julianesteves41
      @julianesteves41 2 роки тому

      I just going to write it right now hahaha.

  • @vitalchance5768
    @vitalchance5768 Рік тому

    what would I do without you, man? Thanks!

    • @jfversluis
      @jfversluis  Рік тому

      Haha aw shucks! Thank you for watching my silly videos!

  • @stevehutch
    @stevehutch 10 місяців тому

    Great Video Gerald, however the ICommand attribute seems to have disappeared from the CommunityToolkit.Mvvm 8.2.2 , and I can't remember this concept being introduced in any of the previous videos in this crash course. Is there a video I've missed showing how to integrate the ICommand attribute and use commanding to implement navigation using MvvmCommunityToolkit 8.2.2.?

    • @jfversluis
      @jfversluis  10 місяців тому +1

      Yeah it was a bit unfortunate that they introduced breaking changes right after these videos. Sorry about that! The repository associated with the course is updated with the latest bits.
      I’m planning to make some more dedicated content about the MVVM stuff. Would that be useful?

    • @stevehutch
      @stevehutch 10 місяців тому

      @@jfversluis You have obviously put in a tremendous amount of work into these crash course .Net Maui videos, it seems a shame not for them to be kept up to date with the latest 'developments' by the Microsoft / MVVMCommunityToolkit team. I wonder if there is an easy way to keep these updated than having to redo the video.

    • @jfversluis
      @jfversluis  10 місяців тому

      @stevehutch appreciate it thank you! Yeah it would be cool to at least add some kind of annotation to the video later but alas. No such luck. Life of a UA-camr 😄

  • @MarownIOM
    @MarownIOM Рік тому

    My guess on the geo-location not refreshing is the line of code that checks for a cached geolocation. override that and it should get the new location.

  • @davefoley5071
    @davefoley5071 2 роки тому +1

    Yes the map works on Windows. Sometimes it is zoomed in. So if there are nothing of interest nearby, it looks blank and you have to zoom out.

    • @jfversluis
      @jfversluis  2 роки тому

      Ah that makes sense I guess! It’s just zoomed in very much then. I’ll have to try thanks 😄

  • @MariuszZaleski13
    @MariuszZaleski13 2 роки тому +1

    Thanks for explaining it Gerald. Any chance for functionality that would automatically notify application when location has changed? I assume that constant checking for location changes may drain battery quicker than subscribing to location changes instead. This functionality was available in Xamarin.Forms, not sure how to do it in MAUI

    • @jfversluis
      @jfversluis  2 роки тому +1

      I don't think that functionality was inside of the box for Xamarin.Forms. Surely it is possible, if it was through a plugin that make sure that it has been made compatible with .NET MAUI. If that hasn't happened yet, it probably will soon. Or, of course, you can implement it yourself with platform code!

    • @MariuszZaleski13
      @MariuszZaleski13 2 роки тому

      @@jfversluis Thank you. Yes, you're right. It was library written by James Montemagno. Thanks for reminding

    • @jfversluis
      @jfversluis  2 роки тому

      I think Shiny might have it too and I know they are working on .NET MAUI support

  • @davefoley5071
    @davefoley5071 2 роки тому

    I forced my location to Seattle, Wa. and the app returned the nearest monkey which was in Seattle. So the code works. I believe the default location for Windows desktop is San Jose, Ca. The would make the monkey in Phoenix the closest.

    • @jfversluis
      @jfversluis  2 роки тому

      Pfew! Weird it didn’t show me something else. Must’ve been something weird in the Android emulator then. Thanks for checking!

  • @Rahulsapkota
    @Rahulsapkota Рік тому +1

    how to create foreground service in Maui, which runs even after the app is closed.

  • @omarebrahim7225
    @omarebrahim7225 2 роки тому

    At 23:20 it shows as blank because the location is in the middle of nowhere. This caught me out. Change the map from Default to Satellite and you'll be able to see where it is.

  • @davefoley5071
    @davefoley5071 2 роки тому +1

    Another ver useful video on Maui.
    I have to download images from a Http(not s) website. I need to add User-Agent and Accept default request headers for each request. To use UriImageSource in Xaml to download the images, I need to add these request headers for these requests. Is it possible for me to setup an http client with these headers and use dependency injection to provide this http client for all UriImageSource requests?

    • @jfversluis
      @jfversluis  2 роки тому

      That is a very good question! For the HTTP part (try to get around that!) you will have to add something to your AndroidManifest and info.plist to allow iOS and Android to even do that. For the rest, I had a quick look at the source, it seems to use it's own HttpClient 😩 github.com/dotnet/maui/blob/cdf43dafaf2dd30ec8732adcb4df855465e9623f/src/Controls/src/Core/UriImageSource.cs#L116
      So either write your own image source for now and it would probably be worth to open an issue for this and see if we can change that somehow.

    • @davefoley5071
      @davefoley5071 2 роки тому

      @@jfversluis I have it all working in a Xamarin Forms app. I download and cache the images. I have been hoping since the UriImageSource and its caching became available that there would be a method of providing default request headers for the system requests. However recently icarrenomercado had suggested using : ImageHandler.Mapper.AppendToMapping(nameof(ImageView.Drawable), async (handler, view). I have been playing with this but havent been able to get it working yet.

    • @jfversluis
      @jfversluis  2 роки тому

      @@davefoley5071 it has been requested a couple times more. I guess it would be cool if you could configure an HttpClient that would be used throughout so you can configure your headers and such once and it will be picked up by our code as well
      If you have something that works or ideas open that issue and/or pr!

  • @CoffeeToCode11
    @CoffeeToCode11 2 роки тому

    Awesome content! Yes there is a bug with the emulator the workaround is open the google maps app, then setting points with the tool should work

    • @jfversluis
      @jfversluis  2 роки тому

      Ah cool! Thanks for letting me know!

  • @mikewatts7122
    @mikewatts7122 2 роки тому

    This is great awaiting for GA and I'm looking to replace a java android app with maui

    • @jfversluis
      @jfversluis  2 роки тому +1

      That sounds amazing Mike, good luck with that!

  • @samialfarra4275
    @samialfarra4275 2 роки тому

    thank you so much . Assemblyinfo.cs not generated in visual studio 2022 17.3 . can i create manually to write permission inside it ?

    • @jfversluis
      @jfversluis  2 роки тому

      You should be able to add it manually yes

  • @jonathanharmon3472
    @jonathanharmon3472 2 роки тому +2

    [ICommand] no longer works. I had to do some Google-Fu and found out that [ICommand] was renamed to [RelayCommand] in the CommunityToolkit.Mvvm package starting with 8.0.0 preview4 and carrying over to the main 8.0.0 release.

    • @jfversluis
      @jfversluis  2 роки тому +1

      Yeah it’s unfortunate they did a breaking change rename soon after 😢 the attached repository for the videos have the updates code though. Thanks for sharing!

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

    How can I know if GPS is enabled and if it is not enabled, send it to the cell phone settings.

  • @PunisherSamo
    @PunisherSamo Рік тому

    How to add multiple locations and open google maps with those multiple locations ?

  • @saroshwadia
    @saroshwadia 2 роки тому

    Not sure how I missed this great video! 🙂Is there a way in a MAUI app to Click a Button which would open the phones camera and take a picture and store that image in a DB or Blob Storage?

    • @jfversluis
      @jfversluis  2 роки тому

      Yep absolutely! Combine it with this (MediaPicker is now built in to .NET MAUI, it’s under a different namespace though) ua-cam.com/video/AYfGxhEHiec/v-deo.html
      And this: ua-cam.com/video/KPDGtLeNClQ/v-deo.html and this: ua-cam.com/video/5fJZQcukagk/v-deo.html
      I see I need to make a combined updated video 😄

    • @saroshwadia
      @saroshwadia 2 роки тому

      @@jfversluis Yes, a combined video would be perfect! Thx 👌

  • @scara1701
    @scara1701 2 роки тому

    Are all essentials features available yet in Maui, can we track development of this somewhere? await MediaPicker.CapturePhotoAsync() always returns null. Permissions are set correct.

    • @jfversluis
      @jfversluis  2 роки тому

      All features are implemented and should be working!

    • @scara1701
      @scara1701 2 роки тому

      @@jfversluis I gues the problem is between the keyboard and the chair then :D

    • @jfversluis
      @jfversluis  2 роки тому

      Are you seeing this on Windows by any chance? github.com/dotnet/maui/issues/5849

    • @shivendramishra88
      @shivendramishra88 2 роки тому

      @@jfversluis in mediapicker still getting null in android part

  • @_jimbarton
    @_jimbarton 2 роки тому

    Love it Gerald! Can you cover talking to an API on localhost please!? I can't find any documentation on this and it's proving impossible!

    • @jfversluis
      @jfversluis  2 роки тому

      Remember that if you’re running on an emulator that is no longer local host. It’s treated as a separate device so always use your IP address of the machine the API is running on

    • @_jimbarton
      @_jimbarton 2 роки тому +1

      ​@@jfversluis thanks for tip! I figured that part out and am now stuck with either a certificate error if i try on https or an ''unexpected end of stream'' error, and I've spent a full 3 days trying to get passed them. It seems using AndroidClientHandler might solve the problem but that's in a deprecated Xamarin library and so not included in MAUI...

  • @DynamicDaveJonker
    @DynamicDaveJonker 2 роки тому

    Hi Gerald, Great video again! Are there any plans for a package like Xamarin.Forms.Maps? So we can render Google or Apple Maps on our actual page?

    • @jfversluis
      @jfversluis  2 роки тому

      We're hoping to add Maps (back) in .NET 7. For the meantime this might be worth looking into: www.cayas.de/blog/dotnet-maui-custom-map-handler

    • @DynamicDaveJonker
      @DynamicDaveJonker 2 роки тому

      @@jfversluis Thanks / Dank je

    • @jfversluis
      @jfversluis  2 роки тому

      @@DynamicDaveJonker Heel graag gedaan!

  • @baseljuma158
    @baseljuma158 2 роки тому

    In the documentation they mentioned that in Android we should add the code in Platforms/Android/MainApplication.cs you add it to AssemblyInfo and it works

    • @jfversluis
      @jfversluis  2 роки тому +1

      You can add it anywhere basically :) the attribute says “assembly” to it works for the whole assembly

    • @baseljuma158
      @baseljuma158 2 роки тому

      @@jfversluis thank you for your reply... I have another question can we now use maui in production apps? Also I didn't find the push notifications in the documentation, how to add it to the app?

    • @jfversluis
      @jfversluis  2 роки тому +1

      @@baseljuma158 we’ve released it as GA. If you feel comfortable using it in production is up to you! There might be some third-party plugins that do not have support yet. So be sure to check out what you need first.
      Push notifications is definitely possible but I don’t think there is any content for it yet.

  • @robertkomarek8615
    @robertkomarek8615 2 роки тому

    Gerald, can u make a Speech to Text video for Maui? For XF u can use Azure Service or Google's API but u have to pay for Azure and Google's API is hard (impossible? ) to customize for XF. Compared to other frameworks it is very poor to be honest. Would be awesome! Best Rob

    • @vishnuvardhan103
      @vishnuvardhan103 2 роки тому

      @Gerald Versluis , Is possible to do STT for Maui android app's ? to support NLP ? @jfversluis

    • @jfversluis
      @jfversluis  2 роки тому +1

      Looks like this person made it work twitter.com/Bliitze/status/1595916163162116096

    • @vishnuvardhan103
      @vishnuvardhan103 2 роки тому

      @@jfversluis not happening ! any video source can help?

    • @jfversluis
      @jfversluis  2 роки тому

      vladislavantonyuk.azurewebsites.net/articles/Speech-recognition-with-.NET-MAUI

    • @vishnuvardhan103
      @vishnuvardhan103 2 роки тому

      Thank you @@jfversluis your videos are given creative freedom to build apps ! Hope many more you can make

  • @resler7ooo118
    @resler7ooo118 2 роки тому

    😄😄😄😄😄😄😄😄😄😃😃😃😃😃😃😃👉

  • @williamprogramer4168
    @williamprogramer4168 2 роки тому

    ⭐⭐⭐⭐⭐