winsontan520 / Android-WVersionManager

[Deprecated] Library to check new update available in background by using own content
141 stars 57 forks source link

possible unhandled exception #5

Open androidloverbe opened 9 years ago

androidloverbe commented 9 years ago

Hi,

When the user clicks "update now" i see in your source code your code makes use of a "market:.//" url this requires the google play services package to be installed on the end user device your code never checks the availability of this package and might cause an exception.

Allright the chances this package is not installed is small but better safe then causing a crash no ?

nice library by the way

winsontan520 commented 9 years ago

You can handle this yourself if you are targeting user who does not have google play services. You can use versionManager.setUpdateUrl("http://your_app_url"); before calling checkVersion()

if(!isGooglePlayServicesAvailable()){
    versionManager.setUpdateUrl("http://your_app_url");
}
versionManager.checkVersion();

hope it can help