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

  Рет қаралды 12,730

Gerald Versluis

Gerald Versluis

Күн бұрын

Пікірлер: 68
@theunspotgieter2610
@theunspotgieter2610 2 жыл бұрын
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.
@davefoley5071
@davefoley5071 2 жыл бұрын
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 😄
@MarownIOM
@MarownIOM 10 ай бұрын
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 жыл бұрын
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!
@vitalchance5768
@vitalchance5768 Жыл бұрын
what would I do without you, man? Thanks!
@jfversluis
@jfversluis Жыл бұрын
Haha aw shucks! Thank you for watching my silly videos!
@JoanJim
@JoanJim 14 күн бұрын
How can I know if GPS is enabled and if it is not enabled, send it to the cell phone settings.
@CoffeeToCode11
@CoffeeToCode11 Жыл бұрын
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 Жыл бұрын
Ah cool! Thanks for letting me know!
@stevehutch
@stevehutch 7 ай бұрын
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 7 ай бұрын
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 7 ай бұрын
@@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 7 ай бұрын
@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 KZbinr 😄
@Rahulsapkota
@Rahulsapkota Жыл бұрын
how to create foreground service in Maui, which runs even after the app is closed.
@mikewatts7122
@mikewatts7122 2 жыл бұрын
This is great awaiting for GA and I'm looking to replace a java android app with maui
@jfversluis
@jfversluis 2 жыл бұрын
That sounds amazing Mike, good luck with that!
@_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 жыл бұрын
​@@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...
@MariuszZaleski13
@MariuszZaleski13 2 жыл бұрын
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 жыл бұрын
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
@PunisherSamo
@PunisherSamo Жыл бұрын
How to add multiple locations and open google maps with those multiple locations ?
@samialfarra4275
@samialfarra4275 Жыл бұрын
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 Жыл бұрын
You should be able to add it manually yes
@davefoley5071
@davefoley5071 2 жыл бұрын
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!
@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) kzbin.info/www/bejne/d4rJeKueeq2cm8U And this: kzbin.info/www/bejne/gYGneKeCmrN2orM and this: kzbin.info/www/bejne/a5eti4SZqtCUnc0 I see I need to make a combined updated video 😄
@saroshwadia
@saroshwadia 2 жыл бұрын
@@jfversluis Yes, a combined video would be perfect! Thx 👌
@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!
@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.
@jfversluis
@jfversluis 2 жыл бұрын
Thanks for sharing!
@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 жыл бұрын
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 жыл бұрын
@@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.
@jonathanharmon3472
@jonathanharmon3472 Жыл бұрын
[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 Жыл бұрын
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!
@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 Жыл бұрын
@Gerald Versluis , Is possible to do STT for Maui android app's ? to support NLP ? @jfversluis
@jfversluis
@jfversluis Жыл бұрын
Looks like this person made it work twitter.com/Bliitze/status/1595916163162116096
@vishnuvardhan103
@vishnuvardhan103 Жыл бұрын
@@jfversluis not happening ! any video source can help?
@jfversluis
@jfversluis Жыл бұрын
vladislavantonyuk.azurewebsites.net/articles/Speech-recognition-with-.NET-MAUI
@vishnuvardhan103
@vishnuvardhan103 Жыл бұрын
Thank you @@jfversluis your videos are given creative freedom to build apps ! Hope many more you can make
@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
@williamprogramer4168
@williamprogramer4168 2 жыл бұрын
⭐⭐⭐⭐⭐
@jfversluis
@jfversluis 2 жыл бұрын
Out of 5 I hope? 😬
@resler7ooo118
@resler7ooo118 2 жыл бұрын
😄😄😄😄😄😄😄😄😄😃😃😃😃😃😃😃👉
@jfversluis
@jfversluis 2 жыл бұрын
🐒
@jfversluis
@jfversluis 2 жыл бұрын
💡Looking for the next part in this course? Click here to find it, here you will learn more about CollectionView: kzbin.info/www/bejne/n5_ZpIdqiLlkias Want to review the full playlist? You can do that here 👉kzbin.info/www/bejne/o5i6Z6usns6lh80
Новый уровень твоей сосиски
00:33
Кушать Хочу
Рет қаралды 4 МЛН
Modus males sekolah
00:14
fitrop
Рет қаралды 25 МЛН
How Strong is Tin Foil? 💪
00:26
Preston
Рет қаралды 71 МЛН
Project Structure/Single Project - .NET MAUI Tutorial Step-by-Step
18:07
Navigation with .NET MAUI Shell - .NET MAUI Tutorial Step-by-Step
24:41
Setup Your .NET MAUI Dev Environment - .NET MAUI Tutorial Step-By-Step
29:09
.NET MAUI's Navigation for Beginners - Push, Pop, & Pass Objects
21:36
James Montemagno
Рет қаралды 66 М.
.NET MAUI Maps: A First Look - Pins, Polygons and more!
16:35
Gerald Versluis
Рет қаралды 19 М.
Showing Popups in .NET MAUI with .NET MAUI Community Toolkit
11:04
Gerald Versluis
Рет қаралды 33 М.
Start Your New .NET MAUI App with These Amazing Templates!
15:06
Gerald Versluis
Рет қаралды 25 М.
Track Users Location in the Background with Android and Xamarin.Forms
41:14
Новый уровень твоей сосиски
00:33
Кушать Хочу
Рет қаралды 4 МЛН