5 Tech Skills CIOs are Going to Hire in 2020

We are almost at the final stretch of the decade, and when it’s 2020 finally, CIO trends would start pouring in from all quarters of the economic regions. If you are looking to change fields but are…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Update your app without server intervention

There are times when you want users to update your app the moment it is live on the playstore. If the same thing is done from the client side, as a snippet being embedded in the app, it would persist in that, subsequent releases, developer need not even think of informing update. Its a one time snippet to be written in the android code.

In the Main Activity of your android app, in onCreate() method, just add..

This would read the current version of the app which is being installed on the client side.

The function for the same is:

Now we have got the current installed version on the client device of android. Next step is to retrieve the current version which is live on playstore (this would always be the latest one).

Here I am scraping the playstore page to retrieve the app version available post release (For this I have used JSoup, add compile ‘org.jsoup:jsoup:1.7.3’ in build.gradle of app module). Now you got current version and the version on playstore. Check if both are same, if not, then prompt user with an update dialog. Code for that:

If you find this helpful, kindly upvote my answer here:

Keep watching this space for more useful tools and tips.

Add a comment

Related posts:

I get lost and behave like a silly bastard. This practical guide helps me navigate back to my discipline. Maybe it will help you?

The following is a brand of madness brought about by choice. That is, our conscious mind, driving a fraction of our decisions, compels us on occasion to usurp our subconscious mind by believing…

A rare take on retro

Step off the streets of modern day Des Moines into a retro wonderland of the mid-twentieth century, into a world of mid-century kitsch and tacky but charming avant-garde interior design. Funky Finds…