mirror of
https://github.com/Nioux/AideDeJeu.git
synced 2026-02-07 17:13:32 +00:00
Version dynamique
This commit is contained in:
parent
53d047f67d
commit
05551ec754
5 changed files with 52 additions and 12 deletions
|
|
@ -69,6 +69,7 @@
|
|||
<Compile Include="MainActivity.cs" />
|
||||
<Compile Include="Resources\Resource.Designer.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Version.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidAsset Include="Assets\LinLibertine_R.ttf" />
|
||||
|
|
|
|||
28
AideDeJeu/AideDeJeu.Android/Version.cs
Normal file
28
AideDeJeu/AideDeJeu.Android/Version.cs
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
using AideDeJeu.Tools;
|
||||
using Android.Content.PM;
|
||||
|
||||
[assembly: Xamarin.Forms.Dependency(typeof(AideDeJeu.Droid.Version_Android))]
|
||||
namespace AideDeJeu.Droid
|
||||
{
|
||||
public class Version_Android : IAppVersion
|
||||
{
|
||||
public string GetVersion()
|
||||
{
|
||||
var context = global::Android.App.Application.Context;
|
||||
|
||||
PackageManager manager = context.PackageManager;
|
||||
PackageInfo info = manager.GetPackageInfo(context.PackageName, 0);
|
||||
|
||||
return info.VersionName;
|
||||
}
|
||||
|
||||
public int GetBuild()
|
||||
{
|
||||
var context = global::Android.App.Application.Context;
|
||||
PackageManager manager = context.PackageManager;
|
||||
PackageInfo info = manager.GetPackageInfo(context.PackageName, 0);
|
||||
|
||||
return info.VersionCode;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue