java - 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.
解决方案
推荐阅读
- python - 如何使用 Python Bokeh 库制作事件图?
- html - 通过包含其子节点的文本查找类名
- c# - 通过十六进制代码设置颜色
- regex - 当有更多字符时,正则表达式仅匹配最后 3 个字符
- mysql - Mysql ispmanager 不工作 - #2002 来自访问
- xml - 在 XSLT 中基于 XPath 改变 SVG 的值
- java - 为什么 java 中的 synchronize 关键字在没有 join() 的情况下不起作用
- java - VTK:使用 Java Wrappers 编译 - 缺少 vtk.jar
- python - Django 3,模型文本字段在保存字符串时返回字节字符串
- google-app-engine - 将 Google Cloud SQL 连接到无服务器 VPC 访问问题