首页 > 解决方案 > WiFi P2P Communication(Already Connected Devices)

问题描述

I try to make an app that send a message(String) to another app, I follow the official documentation : https://developer.android.com/guide/topics/connectivity/wifip2p but was too overwhelming because I'm a beginner.I found later a tutorial based on the official documentation but app doesn't work properly, the app crashed.Anyway , I don't want to carry the whole process for making a P2P connection, I just want to send that message for already connected device(manually) , I'm trying something like that but I don't know how:

If CONNECTED_DEVICES is equal to 1 sendMessage("Ana Are Mere"); Else If CONNECTED DEVICES is greater that 1 Toast : "Connect With Only A Device" Else Toast : "No Devices Connected"

It's not a very beautiful example, but that's my idea.

标签: javaandroidwifip2p

解决方案


推荐阅读