0

In my application I want to check the version number from the server and when this versionName > myVersionName show a dialog.

verionName is from the server comes as "version": "1.0.0.1" , and myVersionName is like 1.0.0.2.

I want that when 1.0.0.1 > 1.0.0.2 show a dialog.

But this verionNames are Strings. how can I check this in String?

Please help me

9
  • take a look here -> stackoverflow.com/questions/198431/… Commented May 2, 2018 at 11:48
  • String.compareTo() compares in lexicographical order which should work just fine with your version numbers. Note that it works with the current, simple version numbers, no guarantees it will work when versioning changes to like 10.0.0.1 or 1.0.0.1.1 Commented May 2, 2018 at 11:48
  • how can server versionName be smaller than the app'sversionname ? even if it is ...you have to update the server versionName ? just after the release ! Commented May 2, 2018 at 11:49
  • @Ben, can you send to me code my friend? because I am amateur and really need your help. please Commented May 2, 2018 at 11:50
  • 1
    @AxelH yep. It only works if the versions are lexicographically comparable. But if they are it's a fast solution. Definitely not something I would bet my code's well-being on. Commented May 2, 2018 at 11:54

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.