Make a call to the server (use retrofit or volley, for example). It must provide a JSON with at least this:
{
"status": 400,
"minVersionCode": 12,
"url": "http://www.google.es"
}
Status: -1: Force block. 200: Normal. 400: Check minVersionCode.
On response, call (WARNING! Import your app's BuildConfig):
handleResponse(context, BuildConfig.VERSION_CODE, jsonObject)
It will check versions and, if needed, close your app completely and open the provided URL.