mtrinder / Xamarin.Plugins

Cross platform xamarin and windows plugins for PCLs
MIT License
12 stars 5 forks source link

Missing version# in android #1

Open Knordy opened 8 years ago

Knordy commented 8 years ago

In iOS you are creating a string by combining the version# and the build# (String.Format("{0}.{1}", version, build)), but in Android you're only returning the build# (VersionName).

So iOS and Android are displaying different app version #'s when using CrossVersion.Current.Version.

Is it possible to add the version# to Android (VersionCode), and perhaps let use choose which format we like to use? For example: CrossVersion.Current.Version CrossVersion.Current.VersionAndBuild CrossVersion.Current.Build

alexshikov commented 8 years ago

I would use this too.

MagnusJohansson commented 8 years ago

I was just about to fork this repo and add the versionCode property to the returning string. Then, I re-read the official Android versioning guidelines and realized that you should not be using the versionCode property in the GUI. (I bet that the majority of people using this plugin does). The versionCode is an internal thing. I have now re-considered and stopped displaying the versionCode.
If one do needs the versionCode for any purpose, it's Android specific anyway and could easily be obtained from Application.Context.PackageManager.GetPackageInfo( Application.Context.PackageName, PackageInfoFlags.MetaData).VersionCode;

Just my 2c and YMMV.

alexshikov commented 8 years ago

I disagree about versionCode should not be used in UI. I want to show this number for internal testing purposes. This property exists and I highly believe it should be available through the plugin. I can decide weather to show it or not.

I like @Knordy idea to provide few properties.

Knordy commented 8 years ago

We ended up creating our own Version code, also because it needed to do more than this plugin could.

hiraldesai commented 8 years ago

@mtrinder you have an opinion on this? I think it would be useful to make the android version string match iOS version string.

magtimmermans commented 7 years ago

Same here! Please add version code!

jorgen-k commented 6 years ago

+1, make it optional so you can satisfy "both sides" as in Knordy's example