Skip to content

.NET MAUI Blazor tutorial (PR 2)#24977

Merged
guardrex merged 6 commits into
mainfrom
guardrex/blazor-hybrid-pr2
Feb 14, 2022
Merged

.NET MAUI Blazor tutorial (PR 2)#24977
guardrex merged 6 commits into
mainfrom
guardrex/blazor-hybrid-pr2

Conversation

@guardrex
Copy link
Copy Markdown
Collaborator

@guardrex guardrex commented Feb 12, 2022

Addresses #24956

Internal Review Topic

  • Rather rough, rough, ROUGH 🐶 at the moment.

  • I currently have a local Android Emulator problem with my video card's hardware acceleration. I'll troubleshoot that Sunday morning and then confirm the Android section.

  • WRT the Android section ... I'm confused by the .NET MAUI version of the tutorial ending with a screen that looks like a custom component ... not the standard Blazor Counter component. I think the screenshot they have is incorrect. It's Step 13 at ...

    https://docs.microsoft.com/en-us/dotnet/maui/get-started/first-app#get-started-with-visual-studio-2022-171-preview

@guardrex guardrex changed the title .NET MAUI Blazor tutorial .NET MAUI Blazor tutorial (PR 2) Feb 12, 2022
@guardrex guardrex mentioned this pull request Feb 12, 2022
25 tasks
@guardrex guardrex self-assigned this Feb 12, 2022
Comment thread aspnetcore/blazor/hybrid/tutorials/maui.md Outdated
Comment thread aspnetcore/blazor/hybrid/tutorials/maui.md Outdated
Comment thread aspnetcore/blazor/hybrid/tutorials/maui.md Outdated
Comment thread aspnetcore/blazor/hybrid/tutorials/maui.md Outdated
Comment thread aspnetcore/blazor/hybrid/tutorials/maui.md Outdated
Comment thread aspnetcore/blazor/hybrid/tutorials/maui.md Outdated
Comment thread aspnetcore/blazor/hybrid/tutorials/maui.md Outdated
Comment thread aspnetcore/blazor/hybrid/tutorials/maui.md Outdated
Comment thread aspnetcore/blazor/hybrid/tutorials/maui.md Outdated
Comment thread aspnetcore/blazor/hybrid/tutorials/maui.md Outdated
Comment thread aspnetcore/blazor/hybrid/tutorials/maui.md Outdated
Comment thread aspnetcore/blazor/hybrid/tutorials/maui.md Outdated
Comment thread aspnetcore/blazor/hybrid/tutorials/maui.md Outdated
Comment thread aspnetcore/blazor/hybrid/tutorials/maui.md Outdated
Comment thread aspnetcore/blazor/hybrid/tutorials/maui.md Outdated
Comment thread aspnetcore/blazor/hybrid/tutorials/maui.md Outdated
Copy link
Copy Markdown
Member

@danroth27 danroth27 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great start! A few comments.

@guardrex
Copy link
Copy Markdown
Collaborator Author

guardrex commented Feb 13, 2022

UPDATE: @danroth27 ... Read this first, then my next comment.

In addition to the inline remarks ...

I mentioned yesterday that I had an Android emulator-video card hardware acceleration error that prevented me from running the app. This morning, I tried again on a lark. It still doesn't run, but the hardware accelration error went away. Perhaps, there was a background thing running/installing that prevented the emulator from working yesterday 😕. Now, the emulator runs but deploying the app breaks for some other reason.

On my 10-year old hardware 🙈, the Android emulator/emulated phone takes a very long time to get running. I mean like 15 minutes (or more). Along the way I noted that ...

  • There was some kind of "ADB" error, and I dismissed that.
  • There are a few warnings about the Pixel UI not responding and then I click the "Wait" option/button each time.
  • There's an Pixel setup step on the emulated phone that takes a while.
  • There's a Pixel system update that takes a while.

[Perhaps, a NOTE on the potentially long delay should be part of the tutorial.]

While waiting on all of that ... perhaps part of that "ADB" popup error ... the app threw the following twice ...

ADB0010: Mono.AndroidTools.InstallFailedException: Unexpected install output: cmd: Can't find service: package
at Mono.AndroidTools.Internal.AdbOutputParsing.CheckInstallSuccess(String output, String packageName) in /Users/builder/azdo/_work/1/s/xamarin-android/external/monodroid/tools/msbuild/external/androidtools/Mono.AndroidTools/Internal/AdbOutputParsing.cs:line 357
at System.Threading.Tasks.Task.Execute()

After the Pixel phone was fully running in the emulator, that error ☝️ went away (on the third run), but then the deployment still breaks with ...

Capture

I'm not sure what to do about the broken deployment process.

@guardrex
Copy link
Copy Markdown
Collaborator Author

🎉 Ah, ha!

So ... again ... tinkering ...

I left the Android emulator running with the Pixel 5 phone fully loaded (Home screen) ...

pixel5-fully-running

Then, I shutdown VS. I re-opened VS. I selected the Pixel 5 profile and hit the start button again. Bingo! ...

pixel5-running-app

... running well.

Soooo ... there are long delays, various strange bugs and warnings along the way, the requirement here to wait until the emulator is fully loaded/setup/running before re-starting VS. Do you want the tutorial to discuss any of this because I think you know what's going to happen if we put this up without saying anything. Devs will sharpen their 🔪 for ME! 😨

@guardrex
Copy link
Copy Markdown
Collaborator Author

guardrex commented Feb 13, 2022

... and btw ... I did remove the Windows running image on the last commit.

I have the Pixel 5 images now ... the stable "Home" screen and an image of the running MauiApp1 ...

pixel5-fully-running pixel5-running-app

These aren't in the tutorial. Do you want that one (or perhaps both images if we discuss the dev waiting until the phone is fully running) added at the end of the Android section? If so, do you want me to return the running app Windows image to the end of the Windows section?

I think if we get further into the weeds that the sequence would be something like ...

  1. Run the emulator without pressing the VS start button (because if not, that's possibly/probably going to fail).
  2. State that the emulation of the Pixel 5 should be fully running and show the image of the Home screen.
  3. Then, say to use VS's start button to run the app. With any luck 🤞, it won't throw errors/warnings and just run (after quite a delay tho of up to several minutes). Show the image of the Pixel 5 with the running app.

@guardrex
Copy link
Copy Markdown
Collaborator Author

guardrex commented Feb 13, 2022

UPDATE: WRT the upcoming WinForms Blazor tutorial PR. Yes! I now have a basic tutorial written (locally). However ...

  • We should merge this MAUI one first to provide the ToC entries for the WinForms tutorial.
  • It's super WIP in its current state. I need to walk it again from scratch. I'll do that in a few hours. We are on-target 🎯 for the WinForms PR and review by EOD Sunday.

@danroth27
Copy link
Copy Markdown
Member

Regarding the Android emulator issues you're seeing, that's typically due to not having hardware acceleration setup: https://docs.microsoft.com/xamarin/android/get-started/installation/android-emulator/hardware-acceleration. I'm surprised the .NET MAUI docs don't currently say anything about this. @maddymontaquila Do you know how .NET MAUI devs are supposed to figure out that they need to setup hardware acceleration to get the Android emulator to be usable? I assume this is still a manual process for the user, correct?

@guardrex
Copy link
Copy Markdown
Collaborator Author

guardrex commented Feb 14, 2022

I'll see about the hardware acceleration situation here in the morning.

I made the recommended updates. We could circle back around on adding hardware acceleration to this tomorrow (on a new PR).

I'd like to get this in tonight so that I'm unblocked on loading the WinForms one. If you weren't going to look at that tonight tho, then there's no rush on anything ... this PR or the next one. I'll just proceed with the WPF one in the morning and load the WinForms tutorial tomorrow afternoon/evening.

Comment thread aspnetcore/blazor/hybrid/tutorials/maui.md
@danroth27
Copy link
Copy Markdown
Member

Do you want that one (or perhaps both images if we discuss the dev waiting until the phone is fully running) added at the end of the Android section?

Yeah, we should show the app running in the Android section at the end of the Android section. The screen shot you have above is fine.

Comment thread aspnetcore/blazor/hybrid/tutorials/maui.md Outdated
Comment thread aspnetcore/blazor/hybrid/tutorials/maui.md Outdated
Copy link
Copy Markdown
Member

@danroth27 danroth27 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of additional minor nits. Otherwise, looks good.

@guardrex guardrex merged commit 6f15198 into main Feb 14, 2022
@guardrex guardrex deleted the guardrex/blazor-hybrid-pr2 branch February 14, 2022 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants