mirror of
https://github.com/awatertrevi/xamarin-neo4j.git
synced 2026-09-22 09:05:29 +00:00
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>
33 lines
932 B
C#
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
|
|
}
|
|
}
|
|
}
|