AppliedAutonomy.Sdk.Mobile 1.0.0-alpha.3

This is a prerelease version of AppliedAutonomy.Sdk.Mobile.
dotnet add package AppliedAutonomy.Sdk.Mobile --version 1.0.0-alpha.3
                    
NuGet\Install-Package AppliedAutonomy.Sdk.Mobile -Version 1.0.0-alpha.3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AppliedAutonomy.Sdk.Mobile" Version="1.0.0-alpha.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AppliedAutonomy.Sdk.Mobile" Version="1.0.0-alpha.3" />
                    
Directory.Packages.props
<PackageReference Include="AppliedAutonomy.Sdk.Mobile" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add AppliedAutonomy.Sdk.Mobile --version 1.0.0-alpha.3
                    
#r "nuget: AppliedAutonomy.Sdk.Mobile, 1.0.0-alpha.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package AppliedAutonomy.Sdk.Mobile@1.0.0-alpha.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=AppliedAutonomy.Sdk.Mobile&version=1.0.0-alpha.3&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=AppliedAutonomy.Sdk.Mobile&version=1.0.0-alpha.3&prerelease
                    
Install as a Cake Tool

AppliedAutonomy.Sdk.Mobile

Intro

This is a Xamarin Android bindings library for the Applied Autonomy Android Mobile SDK. The Applied Autonomy SDK for Android provides easy access to some of the Applied Autonomy cloud services. The sdk also includes the Mobility Service which transmits mobility data to Applied Autonomy.

Minimum requirements

  • Android Sdk >= 19 (Android 4.4, KitKat)

Manifest

To allow the mobility sensor to work, make sure the following permissions are added to your AndroidManifest.xml

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.WAKE_LOCK" />

Reasons for the permissions:

  • INTERNET: To enable rest calls from the phone
  • FOREGROUND_SERVICE: Required to be always on to monitor your mobility. Background service executions are limited to a few minutes.
  • ACCESS_FINE_LOCATION: Required to know your precise location to build your mobility path.
  • ACCESS_BACKGROUND_LOCATION: Required to know your location in the background, even when the app is closed or not in use.
  • RECEIVE_BOOT_COMPLETED: Allows the service to restart automatically on reboot.
  • WAKE_LOCK: The monitor claims some cpu power to be able to check sensors. We need this permission to not be battery optimized on android 11+.

Use

Contact Applied Autonomy to obtain SDK url, key and other unique properties for connecting to the Applied Autonomy cloud service. Add the AppliedAutonomy.Sdk.Mobile NuGet to your Xamarin.Android project.

Namespaces

using Appliedautonomy.Mobile.Xamarin;
using Appliedautonomy.Mobile.Domain;

Instantiate SDK client

Client client = new Client(Application, SdkUrl, key, companyId, appId, null, licenseKey, false);
Console.WriteLine("Company: " + client.Company.Name);
Console.WriteLine("Mobility endpoint: " + client.MobilityEndpoint);
Console.WriteLine("Mobility key: " + client.MobilityKey);
Console.WriteLine("Installation ID: " + client.MobilityInstallationId);

Provision license

client.ProvisionLicense();
Console.WriteLine("License key: " + client.License?.LicenseKey);

Start the Mobility service

client.StartMobility(notificationChannelId, notificationId, Class);

Stop the Mobility service

client.StopMobility();

Check if the Mobility service is running

Console.WriteLine("Running " + client.MobilityRunning);
Product Compatible and additional computed target framework versions.
.NET net6.0-android was computed.  net7.0-android was computed.  net8.0-android was computed.  net9.0-android was computed.  net10.0-android was computed. 
MonoAndroid monoandroid is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0-alpha.3 219 3/17/2022
1.0.0-alpha.2 194 2/16/2022
1.0.0-alpha.1 188 2/16/2022

Initial release (prerelease 3). Introduces Android SDK12 and license support.