GithubHelp home page GithubHelp logo

dotnet-presentations / dotnet-maui-workshop Goto Github PK

View Code? Open in Web Editor NEW
1.8K 1.8K 540.0 23.27 MB

A full day workshop (.NET MAUI Workshop in a Box) on how to build apps with .NET MAUI for iOS, Android, macOS, and Windows

Home Page: https://docs.microsoft.com/dotnet/maui

License: MIT License

C# 100.00%
dotnet dotnet-maui dotnetmaui

dotnet-maui-workshop's People

Contributors

amerina avatar aristotlejunior avatar bartvanhoey avatar c0herence avatar codemillmatt avatar csharpfritz avatar danielmartind avatar erhanalankus avatar itldg avatar jamesmontemagno avatar jamestsaitw avatar jfversluis avatar jmiller121 avatar jongalloway avatar keithnicholson avatar khalidabuhakmeh avatar kinfey avatar lemon73-computing avatar mikeruhl avatar mrultbdvox avatar pureween avatar vpkopylov avatar wbaldoumas avatar yairp03 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dotnet-maui-workshop's Issues

IsBusy in Part-2 not working

tried to double click the "Get Monkeys" twice (or even more continues click)
the GetMonkeysAsync() task run multiple times
(tested on Windows Machine and Android Pixel 3xa phone the same result)

Visual Studio Community 2022 (64-bit) - Preview Version 17.3.0 Preview 2.0

Trying to run on Android Using Preview1 and Preview2 gives a xamarin error

Only try to run the code on android gives this error

Severity Code Description Project File Line Suppression State
Error XABLD7000: Xamarin.Tools.Zip.ZipException: Renaming temporary file failed: Permission denied
at Xamarin.Tools.Zip.ZipArchive.Close() in /Users/runner/work/1/s/LibZipSharp/Xamarin.Tools.Zip/ZipArchive.cs:line 939
at Xamarin.Android.Tasks.ZipArchiveEx.Flush()
at Xamarin.Android.Tasks.BuildApk.ExecuteWithAbi(String[] supportedAbis, String apkInputPath, String apkOutputPath, Boolean debug, Boolean compress, IDictionary`2 compressedAssembliesInfo, String assemblyStoreApkName)
at Xamarin.Android.Tasks.BuildApk.RunTask()
at Microsoft.Android.Build.Tasks.AndroidTask.Execute() in /Users/runner/work/1/s/xamarin-android/external/xamarin-android-tools/src/Microsoft.Android.Build.BaseTasks/AndroidTask.cs:line 17 0

Unkown exception when debugging Part 2

Before jumping into this section of the document, in the video we're asked to add a breakpoint and run the app. Once I do so, I'm starting to get this unknown exception.

I'm using VS Community 2022 -latest- and as seen in the below snapshot I'm deploying to Windows.

image

CommunityToolkit.Mvvm NuGet package reference is missing in the project available in the Finish folder (main branch)

Cloned the repository and opened the solution available in the Finish folder (main branch).

Ended up with errors when compiled, upon analysis found that the CommunityToolkit.Mvvm NuGet package reference is missing in the project file causing the issues.

In fact, it's not added as a reference in any of the projects available in other folders.

Notify to @jamesmontemagno @jfversluis

Community Module idea: MonkeyFinder MVP-VM decoupled application following best P&P

Refactor existing Monkey Finder application for decoupled architecture. The Model-View-Presenter, View-Model (MVPVM) pattern follows best practices as outlined by the Microsoft Application Architecture Guide for decoupled applications using inversion of control, aka dependency injection.

Decoupled applications promote reuse of views, view models, business logic and data access layers with other modules and/or applications as they are not tightly coupled to other components. Decoupled applications are more easily architected, updated, and maintained - if you understand the patterns.

Part 0 - Overview (understanding the patterns).
Part 1 - Wiring up a decoupled framework
Part 2 - MVPVM
Part 3 - Event Aggregation (communication between layers/components)
Part 4 - Navigation
Part 5 - Adding a new module (reuse of existing components)

change .Current to .Default in part 4

Change in step 3
builder.Services.AddSingleton(Geolocation.Current);
builder.Services.AddSingleton(Map.Current);

to

builder.Services.AddSingleton(Geolocation.Default);
builder.Services.AddSingleton(Map.Default);

Dark theme is not automatically updated

I've completed the workshop and implemented the AppThemes section, but the app doesn't pick up the change except when starting. Specifically, I can run the app -- it comes up in light theme styles. Then, change the device to Dark Theme -- but the app doesn't change. If I close the app and then re-open it, it picks up the theme change then and displays the dark theme styles. I've gone back through the section and compared to the "Finish" project but can't see anything I've done differently.

Auto-generated RelayCommandGenerator

Following Part 2 - MVVM in the README.md

Where [ICommand] was replaced by [RelayCommand] in the MonkeysViewModel.cs file. The current auto-generated code in Dependencies should be as follows:

// <auto-generated/> #pragma warning disable #nullable enable namespace MonkeyFinder.ViewModel { partial class MonkeysViewModel { /// <summary>The backing field for <see cref="GetMonkeysASyncCommand"/>.</summary> [global::System.CodeDom.Compiler.GeneratedCode("CommunityToolkit.Mvvm.SourceGenerators.RelayCommandGenerator", "8.0.0.0")] private global::CommunityToolkit.Mvvm.Input.AsyncRelayCommand? getMonkeysASyncCommand; /// <summary>Gets an <see cref="global::CommunityToolkit.Mvvm.Input.IAsyncRelayCommand"/> instance wrapping <see cref="GetMonkeysASync"/>.</summary> [global::System.CodeDom.Compiler.GeneratedCode("CommunityToolkit.Mvvm.SourceGenerators.RelayCommandGenerator", "8.0.0.0")] [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::CommunityToolkit.Mvvm.Input.IAsyncRelayCommand GetMonkeysASyncCommand => getMonkeysASyncCommand ??= new global::CommunityToolkit.Mvvm.Input.AsyncRelayCommand(new global::System.Func<global::System.Threading.Tasks.Task>(GetMonkeysASync)); } }

Translation in Hindi

Hindi is the 4th most spoken language in the world and I am willing to translate the documentation in hindi if you guys want.

Images aren't loaded in CollectionView for Android emulator

Images aren't loaded when debugging the application with Android Emulator - This starts from Part 1 of the workshop.

<CollectionView.ItemsSource>
            <x:Array Type="{x:Type model:Monkey}">
                <model:Monkey
                    Name="Baboon"
                    Image="https://raw.githubusercontent.com/jamesmontemagno/app-monkeys/master/baboon.jpg"
                    Location="Africa and Asia" />
                <model:Monkey
                    Name="Capuchin Monkey"
                    Image="https://raw.githubusercontent.com/jamesmontemagno/app-monkeys/master/capuchin.jpg"
                    Location="Central and South America" />
                <model:Monkey
                    Name="Red-shanked douc"
                    Image="https://raw.githubusercontent.com/jamesmontemagno/app-monkeys/master/douc.jpg"
                    Location="Vietnam" />
            </x:Array>
        </CollectionView.ItemsSource>

They load properly when using Windows Machine

Is there any workaround? For example some type of android permission? I can see several related tickets here and there, but no solution!

Info:

  • Windows 10
  • Visual Studio 17.5.3
  • .NET 7
  • Pixel 5 - API 33 (Android 13.0 - API 33)

Callout Part 0 in overall readme?

The overall โ€‹readmeโ€‹ย has folks going directly to part 1. Should we add a section that says "read part 0 if you're not familiar w/ .net maui projects"? Or is part 0 just something you want just want to kind of have around?

Community Module: Apizr

Hey there, as I told to @jamesmontemagno in DM, I'm thinking about creating a workshop series about Apizr on YouTube. I would start my sample app code base from this MonkeyFinder final one. I guess Community Modules folder could host that Apizr sample app code and materials, because it's clearly like a "going further with api".
Here is the potential content of the workshop video I'm thinking to rec:

GitHub module folder / YouTube video step
Part 1 - Getting started
Part 2 - Configuring logging
Part 3 - Handling exceptions
Part 4 - Checking connectivity
Part 5 - Caching data

Let me know if you think it could match or not the Community Modules thing.
Jeremy

UPDATE: I simplified the content as I want to stay close to the MAUI learning context. So it's now more like "how to do same with more resilience and less boilerplate"

No "Final" project

Recommend adding a "Final" project that shows everything you did all the way through, including the AppThemes.

If a user encounters a problem during workshop, it is possible to compare they're code (that has an issue) to the code found in the respective sections of the project. For example , when working on Platform Features and encountering an issue, it is possible to check the code in the next project (i.e., CollectionView) which already has the edits for the Platform Features in it and working. But this isn't possible with the AppThemes section since there is no Final that shows the AppThemes correctly working.

Monkey Detail Labels do not show on Windows Machine - shows on Android

VS Community 2022 17.3.0 Preview 1.0
Windows 10 Home 21H2 19044.1706

Open Part 4 - MonkeyFinder.sln then build and run as "Windows Machine". The following Detail View Labels do not show up on my system. When I run the same solution on Android Emulator, the labels appear correctly.

        <VerticalStackLayout Padding="10" Spacing="10">
            <Label Style="{StaticResource MediumLabel}" Text="{Binding Monkey.Details}" />
            <Label Style="{StaticResource MicroLabel}" Text="{Binding Monkey.Location, StringFormat='Location: {0}'}" />
            <Label Style="{StaticResource MicroLabel}" Text="{Binding Monkey.Population, StringFormat='Population: {0}'}" />
        </VerticalStackLayout>

image

If I temporarily cut the above lines, stop and rerun the code, then paste in the code using hot reload, I receive the following errors in DetailsPage.xaml Line 39,40,and 41:

image

If I stop and rerun the application, the hot reload errors no longer appear but the detail labels are still missing.

Part 0 Assets Folder Missing/Changed to Raw

In the Part 0 - Overview\README.md
It mentions code:

<!-- Assets -->
<MauiAsset Include="Resources\Assets\*" />

However in the actual code going into Part 1 it looks to be

<!-- Raw Assets (also remove the "Resources\Raw" prefix) -->
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />

An Assets folder doesn't exist.

Not running on WSA

For some reason when I use WSA to debug it doesn't load the app. After deploying just stops. However, if I create a new MAUI app it works just fine.

Debug output

Forwarding debugger port 8871
Detecting existing process

am start -a "android.intent.action.MAIN" -c "android.intent.category.LAUNCHER" -n "com.companyname.monkeyfinder/crc64c2e3c35ecaf1aecc.MainActivity"
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.companyname.monkeyfinder/crc64c2e3c35ecaf1aecc.MainActivity }
[me.monkeyfinde] Late-enabling -Xcheck:jni
[me.monkeyfinde] Unexpected CPU variant for X86 using defaults: x86_64
[CompatibilityChangeReporter] Compat change id reported: 171979766; UID 10058; state: ENABLED
[GraphicsEnvironment] ANGLE Developer option for 'com.companyname.monkeyfinder' set to: 'default'
[GraphicsEnvironment] ANGLE GameManagerService for com.companyname.monkeyfinder: false
[GraphicsEnvironment] Neither updatable production driver nor prerelease driver is supported.
[NetworkSecurityConfig] No Network Security Config specified, using platform default
[NetworkSecurityConfig] No Network Security Config specified, using platform default
[debug-app-helper] Checking if libmonodroid was unpacked to /data/app/~~8ZeASPFyFONwGXXWJjHNSw==/com.companyname.monkeyfinder-x7eEDkuiV4qI-piIs7aPvQ==/lib/x86_64/libmonodroid.so
[debug-app-helper] Native libs extracted to /data/app/~~8ZeASPFyFONwGXXWJjHNSw==/com.companyname.monkeyfinder-x7eEDkuiV4qI-piIs7aPvQ==/lib/x86_64, assuming application/android:extractNativeLibs == true
[debug-app-helper] Setting up for DSO lookup in app data directories
[debug-app-helper] Added filesystem DSO lookup location: /data/app/~~8ZeASPFyFONwGXXWJjHNSw==/com.companyname.monkeyfinder-x7eEDkuiV4qI-piIs7aPvQ==/lib/x86_64
[debug-app-helper] Using runtime path: /data/app/~~8ZeASPFyFONwGXXWJjHNSw==/com.companyname.monkeyfinder-x7eEDkuiV4qI-piIs7aPvQ==/lib/x86_64
[debug-app-helper] checking directory: /data/user/0/com.companyname.monkeyfinder/files/.__override__/lib
[debug-app-helper] directory does not exist: /data/user/0/com.companyname.monkeyfinder/files/.__override__/lib
[debug-app-helper] Checking whether Mono runtime exists at: /data/user/0/com.companyname.monkeyfinder/files/.override/libmonosgen-2.0.so
[debug-app-helper] Checking whether Mono runtime exists at: /data/app/~~8ZeASPFyFONwGXXWJjHNSw==/com.companyname.monkeyfinder-x7eEDkuiV4qI-piIs7aPvQ==/lib/x86_64/libmonosgen-2.0.so
[debug-app-helper] Mono runtime found at: /data/app/~~8ZeASPFyFONwGXXWJjHNSw==/com.companyname.monkeyfinder-x7eEDkuiV4qI-piIs7aPvQ==/lib/x86_64/libmonosgen-2.0.so
[me.monkeyfinde] Attempt to remove non-JNI local reference, dumping thread
[DOTNET] JNI_OnLoad: JNI_OnLoad in pal_jni.c
[monodroid] Creating public update directory: /data/user/0/com.companyname.monkeyfinder/files/.__override__
[me.monkeyfinde] Attempt to remove non-JNI local reference, dumping thread
[monodroid-debug] Trying to initialize the debugger with options: --debugger-agent=transport=dt_socket,loglevel=0,address=127.0.0.1:8871,server=y,embedding=1
[mono] debugger-agent: Unable to listen on 55

Running the app for the second time doesn't actually stop and although it looks like it's going to load after 2 min it hasn't showed up yet. Here it is what the device logs are displaying

image

Part 1 - input string was not in a correct format

Hello,

I'm watching the tutorial on YT but when I try to build the solution for Android I receive the following error on the string at line 1 in the MainPage.xaml:
[input string was not in a correct format]
image

I've compared the string with the video and I haven't found difference.
What could cause this problem?

Many thanks
Gaetano

Missing static resource key in App.xaml

BaseLabel key is missing in Parts 1-5, causing runtime exception.




should be same as Part 6 and finish:

<Style TargetType="Label" x:Key="BaseLabel">
    <Setter Property="FontFamily" Value="OpenSansRegular" />
    <Setter Property="TextColor" Value="#1F1F1F" />
</Style>

Part 1 Monkey Display Not Matching Example

Ran through the Part 1 Example. Ran the program in Windows and in Android.

The example shows the output should appear like this:
Ideal Monkeys

However Android showed up like this:
Android Monkeys
Monkey heading appeared, monkey text appeared but monkeys did not

Windows showed up like this:
Windows Monkeys
Monkey heading appeared, pictures of monkeys appeared, but text did not

CollectionView SelectedItems bound property not working

Firstly, thank you for the great WorkShop. As a beginner, I'm learning a lot.

I have a problem with my own app that I reproduced in the source code for Part 3 - Navigation. If you have a multi-selection CollectionView and bind to SelectedItems, the bound property is always null. I don't know if this is the way I'm doing it or if it is a bug in MAUI. As a beginner, I suspect me! I changed the start of the CollectionView to be:

        <CollectionView  x:Name="MonkeyCollectionView" 
            Grid.ColumnSpan="2"
            ItemsSource="{Binding Monkeys}"
            SelectionMode="Multiple"
            SelectedItems="{Binding SelectedMonkeys}"             
            SelectionChangedCommand="{Binding MonkeySelectionChangedCommand}"
            SelectionChangedCommandParameter="{Binding SelectedItems, Source={x:Reference MonkeyCollectionView}}">            

and added these to the MonkeysViewModel

[QueryProperty(nameof(SelectedMonkeys), nameof(SelectedMonkeys))]
   [ObservableProperty]
    List<Monkey> selectedMonkeys;
```

I have a MonkeySelectionChanged command so I can easily examine the property

```
[RelayCommand]
    void MonkeySelectionChanged(object monkeyParams)
    {
        List<Monkey> selectedMonkeyParams = ((IEnumerable)monkeyParams).Cast<Monkey>().ToList();
        Console.WriteLine("Selected Monkeys passed as a parameter ", selectedMonkeyParams);
        Console.WriteLine("Selected Monkeys via bound property", SelectedMonkeys);
    }
```

If I do the same with a single SelectedItem the property updates as it should.  It is the multi-select that does not work for me.

The reason this is important is that I need a way to remove selected items. Ideally, I just want to clear them all. In my real app, I show photos that have been taken and want to select and then delete the selected photos.  I can delete them from my SQLite store and reassign that to the CollectionView but the count of selected items remains as before I reassigned them after deletion.  Also, if I now select a new photo, the list of selected photos includes the photos I removed from my collection. 

Where can I find real MAUI Unit Test sample?

I can find a lot of suggestions for using additional .net x.0 platform like: https://github.com/jfversluis/MauixUnitTestSample.
But I have additional MAUI dll with platform specific implementation and this suggestion can not work, so I can create MAUI library as unit test and resharper could select platform dependent build but can not run it.
What is Microsoft recommendation for creation MAUI Unit tests?

Here is nothing about project configuration
https://learn.microsoft.com/en-us/dotnet/architecture/maui/unit-testing

Error DEP0700 on Windows 11

When deploying the solution, the error will occur as shown below:

"Severity Code Description Project File Line Suppression State Error DEP0700: Registration of the app failed. [0x80073CFD] Windows cannot deploy to path AppX of file system type exFAT. MonkeyFinder "

Any solutions to fix it? Thanks.

The dev system information:

.NET SDK (reflecting any global.json):
Version: 6.0.400-preview.22301.10
Commit: 25580ffe7a

Runtime Environment:
OS Name: Windows
OS Version: 10.0.22000
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\6.0.400-preview.22301.10\

Host (useful for support):
Version: 6.0.5
Commit: 70ae3df4a6

.NET SDKs installed:
6.0.400-preview.22301.10 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 5.0.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.5 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

The local function 'GoToDetailsAsync' is declared but never used

repro: https://github.com/jee-mj/MonkeyFinder

Code reference:

[RelayCommand]
async Task GoToDetailsAsync(Monkey monkey)
{
	if (monkey is null)
		return;

        await Shell.Current.GoToAsync($"{nameof(DetailsPage)}", true, new Dictionary<string, object>
        {
            {"Monkey", monkey}
        });
}
<TapGestureRecognizer CommandParameter="{Binding .}"
                      Command="{Binding Source={RelativeSource AncestorType={x:Type viewmodel:MonkeysViewModel}}, Path=GoToDetailsCommand}" />

Is it me or updates? ๐Ÿ™ˆ

Index out of range exception on Mac

If I click on Get Monkeys a second time I get an index out of range exception running on an IOS simulator or Mac catalyst. Using Visual Studio 2022 on Mac with the most recent sdk's.

Text is not being shown on desktop apps when OS DarkMode is enabled.

I just noticed the text inside the collection view from Part 2 code is not being shown on desktop apps when you have enabled the dark mode.

Steps to reproduce:

  • Enable Dark Mode on Windows or Mac OS.
  • Open the solution code for Chapter 2 (Part 2 - MVVM).
  • Click run on MacCatalyst or Windows.

Screenshot 2022-10-23 at 21 33 12

Quick Fix: Force the color using the TextColor property of the Label. Of course, this shouldn't be the right way.

Update: The same is happening to the ActivityIndicator, it's not visible because of the background/foreground color I guess.

Emulator error

Starting the Android Emulator I get an Error. Hyper-V is enabled and running
emulator error

Name property bug on Pixel device

I'm finding a very peculiar bug on the MainPage.xaml page particularly with the Name property in the CollectionView whereby Name="Baboon 1" doesn't display the 1. Also the Location="Africa and Asia" doesn't display correctly and it will only show [Africa and] and nothing else unless I insert a space after the word Asia.

This appears to be a bug in both the Pixel 2 Q 10.0 - API 29 and the Pixel 5 API 33 emulators.

The Location property is not a problem in the Pixel 5 but it has the same bug where the Name property doesn't display correctly i.e. Name="Baboon 1"

However, "Baboon 2", "Baboon 3", "Baboon 4" Name properties etc.. all display their name's correctly just not the very first one i.e. "Baboon 1".

That said, the following DOES work on both the Pixel 2 and Pixel 5 using the # to denote the number:

<CollectionView>
        <CollectionView.ItemsSource>
            <x:Array Type="{x:Type model:Monkey}">
                <model:Monkey
                    **Name="Baboon #1"**
                    Image="https://raw.githubusercontent.com/jamesmontemagno/app-monkeys/master/baboon.jpg"
                    Location="Africa and Asia"/>
                <model:Monkey
                    **Name="Baboon #2"**
                    Image="https://raw.githubusercontent.com/jamesmontemagno/app-monkeys/master/baboon.jpg"
                    Location="Africa and Asia"/>
                <model:Monkey
                    **Name="Baboon #3"**
                    Image="https://raw.githubusercontent.com/jamesmontemagno/app-monkeys/master/baboon.jpg"
                    Location="Africa and Asia" />
                <model: Monkey

Pixel 2 - API 29

Pixel 5 - API 33

Not sure if this is where this issue goes. Maybe someone else has experienced this as well?

Binding Natives Android Libraries MAUI .NET

Hello James, Lately I have been some problems trying to make a binding for 2 android libraries, ones I need to use in my project.
i'ved was trying multiples solutions, but any works for my project. This libraries are used for card reader application named CLIP. this libraries consists in an SDK for Android Studio developers

this link has the information for android studio pourpose.

the libraries are

        implementation 'com.payclip.sdk:payment-ui:2.3.0'
        implementation 'com.payclip.sdk:plus-reader:1.3.0'

my best approximation is described below

  1. downloades aar files
    image

  2. on visual s tudio 2019 i created a project for each one
    image
    image

  3. To each one I have added their respective dependencies.

  4. i changed the compilation action for the main library in to Library Project Zip, and the dependencies for EmbeddedReferenceJar. for each of the project.

  5. Compile for generate respectives DLL files.
    image
    image

  6. i created a new proyect for testing dll's but this not containt all clases. in this case :plus-reader is the ClassLibrary3.dll
    the first step is create an application clas that initialices the sdk and the card reader. whit the following comand

ClipApi.init(this, new ClipPlusApi());

ClipApi is included on the PrimerBinding.dll, that initialices the sdk,
CLipPlusApi() initialices the Card Reader. but the class inside the ClassLibrary3 is missing. like other clases

this are the classes inside AAR for plus-reader
image

this are the classes inside dll

image

If you could guide me on what I'm doing wrong, how I could fix my mistake, or what approach I could take to make a correct Binding of the libraries.

I clarify that if I have been able to solve the processes that I need to carry out, through another type of solution, I have created a native android studio application that communicates with my MAUI application. But I would like to know if I can find any solution when creating a binding

THX

Android issues in RC1

Emulator Pixel 5

  • Images are not displayed
  • CollectionView_SelectionChanged is not call on click
  • CollectionView.EmptyView still displayed after Monkeys binding is loaded

Same code works on Windows (11)

ViewModel as singleton

This is more of a question than issue but still; isn't registering a view model as a singleton considered a bad practice?

Issue with Part 2 on MacOS Maui RC3, VS 2022 RC2 (Cannot refresh monkey list)

MacOS building for Mac and iphone simulator.
MAUI RC3
VS for Mac 2022 RC2
Monterey 12.3.1
Intel mac mini
iphone Simulator 13.3.1 (977.2)

Completed Part 2, hit the "Get Monkeys" button and the list pulls from internet and propagates view correctly. Hitting "Get Monkeys" a second time, not good.

  • On Mac desktop build, the list clears and repopulates with just the first monkey (Baboon). White space below still allows scrolling but no other monkeys showing.

  • On iphone simulator, throws exception.

Reason: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index') (System.ArgumentOutOfRangeException)
at System.Collections.Generic.List1[[MonkeyFinder.Model.Monkey, MonkeyFinder, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].get_Item(Int32 index) at System.Collections.ObjectModel.Collection1[[MonkeyFinder.Model.Monkey, MonkeyFinder, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].System.Collections.IList.get_Item(Int32 index)
at Microsoft.Maui.Controls.Handlers.Items.ObservableItemsSource.ElementAt(Int32 index)
at Microsoft.Maui.Controls.Handlers.Items.ObservableItemsSource.get_Item(Int32 index)
at Microsoft.Maui.Controls.Handlers.Items.ObservableItemsSource.get_Item(NSIndexPath indexPath)
at Microsoft.Maui.Controls.Handlers.Items.ItemsViewController1[[Microsoft.Maui.Controls.ReorderableItemsView, Microsoft.Maui.Controls, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].GetSizeForItem(NSIndexPath indexPath) at Microsoft.Maui.Controls.Handlers.Items.ItemsViewDelegator2[[Microsoft.Maui.Controls.ReorderableItemsView, Microsoft.Maui.Controls, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[Microsoft.Maui.Controls.Handlers.Items.ReorderableItemsViewController`1[[Microsoft.Maui.Controls.ReorderableItemsView, Microsoft.Maui.Controls, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]], Microsoft.Maui.Controls, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].GetSizeForItem(UICollectionView collectionView, UICollectionViewLayout layout, NSIndexPath indexPath)
at UIKit.UICollectionView.InsertItems(NSIndexPath[] indexPaths)
at Microsoft.Maui.Controls.Handlers.Items.ObservableItemsSource.<>c__DisplayClass41_0.b__0()
at Microsoft.Maui.Controls.Handlers.Items.ObservableItemsSource.Update(Action update, NotifyCollectionChangedEventArgs args)
at Microsoft.Maui.Controls.Handlers.Items.ObservableItemsSource.Add(NotifyCollectionChangedEventArgs args)
at Microsoft.Maui.Controls.Handlers.Items.ObservableItemsSource.CollectionChanged(NotifyCollectionChangedEventArgs args)
at Microsoft.Maui.Controls.Handlers.Items.ObservableItemsSource.<>c__DisplayClass37_0.b__0()
at Foundation.NSAsyncActionDispatcher.Apply()

Part 2 Android No Pictures/List Scrolling Error

When running through Part 2 the Windows version ran fine.
However, on Android no monkey pictures appeared.
Part 2 Monkey List Android

Additionally, I get an odd error if I scroll to the very bottom of the list, then to the very top of the list.

System.InvalidOperationException
Message=An attempt was made to transition a task to a final state when it had already completed.

I opened up the Part 3 code to verify that this was in fact an issue with the code and not something I did following along with Part 2

[Question] How to handle the specific index view within a ListView

<ListView ItemsSource="{Binding Monkeys}">
    <ListView.ItemTemplate>
        <DataTemplate>
            <ViewCell>
                <Label 
                       Text="{Binding Name}"
                       FontAttributes="Bold" />
            </ViewCell>
        </DataTemplate>
    </ListView.ItemTemplate>
</ListView>

For this kind of ListView, the controls within the ListView are templated. So how to get reference of a specific control? The selected item type is a Monkey, what if I wanna replace the Label into another control from code behind? It annoys me when I wanna realize the rename function using data binding, just like following picture. Or is there a better way to realize this situation?
image

Part 3 - Navigate, ReadMe.md Possible Correction

In the above ReadMe file, point 4 states:

"Finally, under the Grid, but inside of the VerticalStackLayout we will add details about the monkey.

<VerticalStackLayout Grid.Row="2" Padding="10" Spacing="10">
    <Label Style="{StaticResource MediumLabel}" Text="{Binding Monkey.Details}" />
    <Label Style="{StaticResource SmallLabel}" Text="{Binding Monkey.Location, StringFormat='Location: {0}'}" />
    <Label Style="{StaticResource SmallLabel}" Text="{Binding Monkey.Population, StringFormat='Population: {0}'}" />
</VerticalStackLayout>

"

In the text before the code, should it state ScrollView instead of VerticalStackLayout? The part where code is being added looks like this:

        </Grid>
        <!--I believe code is going here-->
    </ScrollView>
</ContentPage>

Great material, by the way. I'm learning a lot.

Change all Uses of `Frame` to `Border`

Border is the new recommended way of doing things.

I played with converting this a little bit but you might reach out to Javier on the recommended replacements here

  • CornerRadius => Border.Clip
  • BorderColor => Stroke
  • HasShadow => Border.Shadow

Feedback: Re-order editing to enable hot-reload demos

In part 2, if we move the step to register services above the XAML modifications, XAML hot reload will allow students to immediately see the updates to the UI.

Otherwise, students need to wait because dependency injection for the new MonkeyViewModel and MonkeyService are not available

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.