Files
xamarin-neo4j/Xamarin.Neo4j/Xamarin.Neo4j/Xamarin.Neo4j.Android/Services/VersionService.cs
Gerwin Kuijntjes 14d755f8bb Enable compiled XAML bindings and fix MAUI deprecation warnings
Add x:DataType to all pages and controls for compiled bindings, migrate
from deprecated Application.Current.MainPage to Windows[0].Page API,
suppress expected analyzer warnings (XC0023, CS0618, CA1422), and add
Newtonsoft.Json dependency.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 09:32:26 +02:00

33 lines
932 B
C#

//
// VersionService.cs
//
// © Xamarin.Neo4j.Android
//
using Android.OS;
using Xamarin.Neo4j.Services.Interfaces;
namespace Xamarin.Neo4j.Android.Services
{
public class VersionService : IVersionService
{
public string GetVersion()
{
var context = global::Android.App.Application.Context;
var info = context.PackageManager.GetPackageInfo(context.PackageName, 0);
return info.VersionName;
}
public string GetBuild()
{
var context = global::Android.App.Application.Context;
var info = context.PackageManager.GetPackageInfo(context.PackageName, 0);
#pragma warning disable CS0618, CA1416, CA1422
return Build.VERSION.SdkInt >= BuildVersionCodes.P
? info.LongVersionCode.ToString()
: info.VersionCode.ToString();
#pragma warning restore CS0618, CA1416, CA1422
}
}
}