I want to make my android connects two networks at the same time, the first one a wifi network to get internet connection and the other one ad-hoc network ( a network between mo
Create Two Threads. Use these threads to do the network connection. Threads can run simultaneously. So network connection also will process simultaneously. If you need to provide more priority for one connection set the thread priority high for that thread. Also set less thread priority for another thread.
I have one local device connection and one server connection. Initially both done in AsyncTask(If server connection is going on then i can't connect local device). But i need more preference for local device and also need to do both the communication simultaneously. so i tried this. It was working fine to me.
It seems to be possible now. Check this out: http://developer.android.com/training/connect-devices-wirelessly/wifi-direct.html
What you are asking for can not currently be done. You can only be connected to one network at the time. However, there is a standard called WiFi direct that will allow you to do what you are asking for, but it isn't yet implemented in Android. I recently talked with an Android engineer at Google about this, and they are working on it, so it appears you will be able to what you are asking for in the near future, but not right now.
PC:
This CAN be done with microsoft's virtual wifi switcher. You can connect to two our more wireless networks at once.
PC/Android/iPod/iPhone - Double/Triple connection:
You can connect your pc to your android phone or iPod Touch/iPhone(Jailbroken) with wifi teathering for android and usb teathering for both android an iPodTouch/iPhone.
Android/iPhone: •Connect to cellular network and WiFi.
Virtual WiFi research.microsoft.com/en-us/downloads/994abd5f-53d1-4dba-a9d8-8ba1dcccead7/