How to work with Android’s in-app update API?

Step 1: Add dependency (build.gradle (app)): dependencies { implementation ‘com.google.android.play:core:1.7.3′ … } Step 2: Check for update availability and start if it’s available private AppUpdateManager mAppUpdateManager; private static final int RC_APP_UPDATE = 11; In onStart() method: mAppUpdateManager = AppUpdateManagerFactory.create(this); mAppUpdateManager.registerListener(installStateUpdatedListener); mAppUpdateManager.getAppUpdateInfo().addOnSuccessListener(appUpdateInfo -> { if (appUpdateInfo.updateAvailability() == UpdateAvailability.UPDATE_AVAILABLE && appUpdateInfo.isUpdateTypeAllowed(AppUpdateType.FLEXIBLE /*AppUpdateType.IMMEDIATE*/)){ try { mAppUpdateManager.startUpdateFlowForResult( appUpdateInfo, AppUpdateType.FLEXIBLE … Read more

Checking my app version programmatically in Android market

Google Play does not provide any official APIs for retrieving metadata. You could however, check the unofficial API at http://code.google.com/p/android-market-api/. Specifically, take a look at the Wiki page HowToSearchApps. The response to the query contains version information: { “app”: [ { “rating”: “4.642857142857143”, “title”: “Ruboto IRB”, “ratingsCount”: 14, “creator”: “Jan Berkel”, “appType”: “APPLICATION”, “id”: “9089465703133677000”, … Read more

How can I execute something just once per application start?

SharedPreferences seems like ugly solution to me. It’s much more neat when you use application constructor for such purposes. All you need is to use your own Application class, not default one. public class MyApp extends Application { public MyApp() { // this method fires only once per application start. // getApplicationContext returns null here … Read more

Running Microsoft Access as a Scheduled Task

To the best of my knowledge the shortest path for a Windows Scheduled Task to “do something useful in Access VBA” is: Create a Public Function (not Sub) in the database. For example: Option Compare Database Option Explicit Public Function WriteToTable1() Dim cdb As DAO.Database Set cdb = CurrentDb cdb.Execute “INSERT INTO Table1 (textCol) VALUES … Read more

How does one auto update a windows application the way Google Chrome does? [closed]

To replicate this update behavior you need two things: An updater application which checks for updates regularly. If an update is found it should install it automatically. Most commercial setup authoring tools include good updater applications. You can try writing an updater yourself, but it’s not as easy as it sounds. Per-user installations for each … Read more

How to disable Google Chrome auto update? [closed]

Have spent a long time trying to disable updates (literally hours, reading forums and testing various (some exotic) solutions), and this was driving me crazy. But there what seems an infallible solution (see further down). Even using the official Google page with the templates did NOTHING: https://support.google.com/installer/answer/146164?hl=en I followed scrupulously the instructions of that page, … Read more