Connect android to two wireless networks simultaneously

前端 未结 4 1210
失恋的感觉
失恋的感觉 2021-02-04 05:34

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

4条回答
  •  南笙
    南笙 (楼主)
    2021-02-04 06:09

    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.

提交回复
热议问题