Skip to main content
Version: 4.1.8

Xamarin/MAUI Integration

This section outlines the steps to integrate our library into a Xamarin or MAUI project.

Download Required Files​

Builds for iOS or Android are available for download. Depending on your license, select the appropriate version. If plate decoding is not required, you can opt for a lighter version of the builds.

Integrate the license​

  1. Add the license file to the /Resources/Raw folder.
  2. Update the .csproj file to ensure the resource is placed in the correct Android native directory (/res/raw):
<AndroidResource Include="Resources\Raw\icare_smartscan.lic">
<LogicalName>raw/icare_smartscan.lic</LogicalName>
</AndroidResource>

Integrate the framework​

Before proceeding, ensure you have converted the .aar framework into a .dll file, as explained in the Create DLL section.

For this guide, we assume the generated framework file is named SmartscanBinding.dll.

  1. Place SmartscanBinding.dll in the /dll folder at the root of the project.
  2. Add a reference to SmartscanBinding.dll in your .csproj file:
<Reference Include="SmartscanBinding.dll">
<HintPath>dll\SmartscanBinding.dll</HintPath>
</Reference>

Integrate the libraries​

  • Place the decoder libraries inside the /libs folder at the root of the project.
  • Declare them as Android native libraries in the .csproj file:
<AndroidNativeLibrary Include="libs\arm64-v8a\libicaredecoders.so" />
<AndroidNativeLibrary Include="libs\armeabi-v7a\libicaredecoders.so" />
<AndroidNativeLibrary Include="libs\x86\libicaredecoders.so" />
<AndroidNativeLibrary Include="libs\x86_64\libicaredecoders.so" />

<!-- Optional libraries depending on the selected build -->
<AndroidNativeLibrary Include="libs\arm64-v8a\libtensorflowlite_c.so" />
<AndroidNativeLibrary Include="libs\arm64-v8a\libtensorflowlite_gpu_delegate.so" />
<AndroidNativeLibrary Include="libs\armeabi-v7a\libtensorflowlite_c.so" />
<AndroidNativeLibrary Include="libs\armeabi-v7a\libtensorflowlite_gpu_delegate.so" />
<AndroidNativeLibrary Include="libs\x86\libtensorflowlite_c.so" />
<AndroidNativeLibrary Include="libs\x86\libtensorflowlite_gpu_delegate.so" />
<AndroidNativeLibrary Include="libs\x86_64\libtensorflowlite_c.so" />
<AndroidNativeLibrary Include="libs\x86_64\libtensorflowlite_gpu_delegate.so" />

Integration Overview​

After completing the steps above, your .csproj file should look like this:

<!-- Android-specific configurations -->
<ItemGroup Condition="$(TargetFramework.StartsWith(<Your Android Target>)) == true">
<!-- Include the license file -->
<AndroidResource Include="Resources\Raw\icare_smartscan.lic">
<LogicalName>raw/icare_smartscan.lic</LogicalName>
</AndroidResource>

<!-- Reference the Smartscan binding library -->
<Reference Include="SmartscanBinding.dll">
<HintPath>dll\SmartscanBinding.dll</HintPath>
</Reference>

<!-- Include required native libraries -->
<AndroidNativeLibrary Include="libs\arm64-v8a\libicaredecoders.so" />
<AndroidNativeLibrary Include="libs\armeabi-v7a\libicaredecoders.so" />
<AndroidNativeLibrary Include="libs\x86\libicaredecoders.so" />
<AndroidNativeLibrary Include="libs\x86_64\libicaredecoders.so" />
</ItemGroup>

Example Projects​

Minimal demonstration projects are available at: SmartID Scan Demos