using System; using ShareeBike.Droid.Model.Device; using ShareeBike.Model.Device; using Xamarin.Forms; [assembly: Dependency(typeof(AppInfo))] namespace ShareeBike.Droid.Model.Device { /// Holds information about the ShareeBike- app. public class AppInfo : IAppInfo { /// Holds the the version of the app. private static Version m_oVersion = null; /// Constructs a app info object. public AppInfo() { } /// Constructs a app info object for initialization. /// Version to initializ object with. internal AppInfo(string p_strVersionText) { if (m_oVersion != null) { // Set version only once. return; } if (!Version.TryParse(p_strVersionText, out Version l_oVersion)) { m_oVersion = new Version(0, 8); } m_oVersion = l_oVersion; } /// Get the version of the app. public Version Version => m_oVersion ?? new Version(0, 9); /// Gets the URL to the app store. /// The store URL. public string StoreUrl => $"https://play.google.com/store/apps/details?id={Android.App.Application.Context.PackageName}"; } }