Communication Between Two Apps Using Emulator As Server And Client
Solution 1:
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
Solution 2:
You can use this step if you connect your emulator with socket:
- run the first emulator as server
- telnet localhot 5554 from terminal
- redir add tcp:5000:6000
- run the second emulator as client
- 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.
Solution 3:
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
Solution 4:
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
Post a Comment for "Communication Between Two Apps Using Emulator As Server And Client"