Communication between two apps using emulator as server and client

前端 未结 4 845
情歌与酒
情歌与酒 2020-12-09 13:27

I have a problem. I want to make an emulator on my computer as a server. Then I want to communicate to another application installed on another emulator on the

相关标签:
4条回答
  • 2020-12-09 14:01

    For 2 apps on the same virtual (or real) device to work together, besides the regular Intent object, you might have a look at bound Services and AIDL : http://developer.android.com/guide/components/aidl.html

    0 讨论(0)
  • 2020-12-09 14:02

    If you want network connection between the two, you can do it, but each emulator is running behind its own virtual router. The 'Using The Emulator' documentation will help:

    http://developer.android.com/guide/developing/devices/emulator.html#connecting

    0 讨论(0)
  • 2020-12-09 14:03

    Finally i solve my problem using socket programming with help of this Blog.I use server and client code and then use ADB to start one emulator as server.Thank you all for your help and support

    0 讨论(0)
  • 2020-12-09 14:16

    You can use this step if you connect your emulator with socket:

    1. run the first emulator as server
    2. telnet localhot 5554 from terminal
    3. redir add tcp:5000:6000
    4. run the second emulator as client
    5. input the ip from server and port

    NB : tcp:5000:6000 is the port from server and client, 5000 is from client and 6000 as server port.

    0 讨论(0)
提交回复
热议问题