Private communication over wifi but internet over 3G I have a raspberry pi which creates an WiFi hotspot and I want my android app to communicate with the pi over that connection. The big problem now is that the pi has no internet access so I would like to use the wifi connection only for my app and the phone should still be able to use 3G.

Is there any way to achieve this?
If I am understanding you correctly, you want to make the raspberry pi a wifi hotspot with no internet access and then have a phone connected to the raspberry pi's wifi. Then the raspberry pi would access the internet through the phone's  4g connection. Is that correct?

If not...

If you are attempting to have the two devices communicate over wifi and leave the phone with access to the internet over 4g, I suggest using Web.py. It is very simple python script to make a webpage on the pi's ip address. Then, any apps you make will read the page. It is nice because only the values that you return in the script are what shows up on the website. If you use a program to read the text/code from the page, it won't show masses of HTML! It just shows your returned data.

If you are attempting to have the pi communicate with the phone AND the internet, use the phone as a mobile hotspot and connect the pi to that hotspot. Then, the pi should connect to the phone through 192.168.1.1.

If I'm not answering your question please let me know!