I would like my android app to be only available online.
If user has no internet connection, I would like to prevent the user from using any content from it, and to show him a popup with a quick message and a browser link to the play store.
I have seen other questions with answer about checking connection status, but I am not sure
1) where in my app to put this code
2) how to prevent the user from reaching any content at all if he is offline
2) what is the best solution to display a popup with a short text message and a link to the playstore
Thanks for your help
For your first question, you could easily close the app on startup:
This wouldn’t give the user any indication that your app was restricted without WiFi but it’d do the job, you could easily add dialog before closing. This would need to be placed in onCreate() of your main launcher activity.
Secondly:
This will give a small popup and when clicked will take the user to the market.