Perhaps there is no service listening on the port you are connecting to?
Just to check if there is a networking problem, you can open a terminal, cd to a non-private directory (be careful, the content of all files of the directory where this command is started will be served on a network, so choose with care) and enter:
python -m SimpleHTTPServer 8000
This will serve the current directory over HTTP on port 8000 on all your network interfaces.
Now on your Android open a browser and enter the address http://192.x.x.x:8000 and check if your browser displays the files from the directory where you entered the python command above.
- If yes: your network settings are correct and the problem may be
within your app or there is no service listening on the needed port on your Ubuntu machine
(see my question above).
- If no (no files are displayed): there
may be a firewall active (on your router or on your Ubuntu machine).
Some routers don't allow that WiFi stations communicate with each
other or with the LAN IPs by default (check the configuration of your router, OpenWRT for example has an option for this)