protected override void OnCreate(Bundle bundle) { var a = CP1252.GetEncoding("utf-32"); base.OnCreate(bundle); //for the image barcode scanner MobileBarcodeScanner.Initialize(Application); //version control Context context = this.ApplicationContext; Values.Version = context.PackageManager.GetPackageInfo(context.PackageName, 0).VersionName; ApplicationInfo ai = PackageManager.GetApplicationInfo(context.PackageName, 0); ZipFile zf = new ZipFile(ai.SourceDir); ZipEntry ze = zf.GetEntry("classes.dex"); long time = ze.Time; System.DateTime dtDateTime = new DateTime(1970, 1, 1, 0, 0, 0, 0, System.DateTimeKind.Utc); dtDateTime = dtDateTime.AddSeconds(Math.Round(time / 1000D)).ToLocalTime(); zf.Close(); Values.Version = string.Format("{0}.{1}", Values.Version, dtDateTime.ToString("yyyyMMdd.Hmmss")); var intent = new Intent(this, typeof(LoginActivityClass)); intent.SetAction(Intent.ActionView); intent.AddCategory(Intent.CategoryLauncher); intent.PutExtra("Version", Values.Version); intent.PutExtra("PackageName", "Partnumber Info"); StartActivityForResult(intent, 0); }
protected override void OnCreate(Bundle bundle) { var a = CP1252.GetEncoding("utf-32"); base.OnCreate(bundle); //for the image barcode scanner //MobileBarcodeScanner.Initialize(Application); //version control // Context context = this.ApplicationContext; /* * LogonDetails.Version = context.PackageManager.GetPackageInfo(CallingPkg, 0).VersionName; * ApplicationInfo ai = PackageManager.GetApplicationInfo(CallingPkg, 0); * ZipFile zf = new ZipFile(ai.SourceDir); * ZipEntry ze = zf.GetEntry("classes.dex"); * long time = ze.Time; * System.DateTime dtDateTime = new DateTime(1970, 1, 1, 0, 0, 0, 0, System.DateTimeKind.Utc); * dtDateTime = dtDateTime.AddSeconds(Math.Round(time / 1000D)).ToLocalTime(); * zf.Close(); * LogonDetails.Version = string.Format("{0}.{1}", LogonDetails.Version, dtDateTime.ToString("yyyyMMdd.Hmmss")); */ CallingPkg = Intent.GetStringExtra("CallingPackage") ?? "com.espack.logon"; Context context = this.ApplicationContext; if (LogonDetails.User == null) { var intent = new Intent(this, typeof(LoginActivityClass)); intent.SetAction(Intent.ActionView); intent.AddCategory(Intent.CategoryLauncher); intent.PutExtra("Version", context.PackageManager.GetPackageInfo(CallingPkg, 0).VersionName); intent.PutExtra("PackageName", CallingPkg); StartActivityForResult(intent, 0); } }