I am building an android app that needs to communicate over a WiFi network that will not have any internet access. The problem is that even when the WiFi is connected androi
you'd need to disable mobile data in the Settings (not certain, if this can be done programmatically, which might be a possible option) - or take out the USIM;
else the common behavior is, that it will always fall back to the best available connection (while a connection with internet gateway might be preferred, because it is used by most application).
also see this answer.