wifip2p

Peer-to-Peer Communication HolePunching (Android)

淺唱寂寞╮ 提交于 2019-12-13 19:50:42
问题 I am working on an app that uses peer-to-peer communication between Android devices. It receives and delivers JSON data and the data never goes through the server ever. The server is only used to keep track of user IDs, login times, IP changes, and other stuff. This app will use sockets for communication. Requirements JSON data goes directly to an Android device from another Android device without going through server. The android devices can be connected to any kind network like 3G or Wi-Fi

WIFI P2P discovery list is not getting refreshed?

南楼画角 提交于 2019-12-12 06:31:42
问题 I am working on an application where i listed all the WIFI P2P nearby devices in a list. But the problem is that it is showing that device also which wifi is disable now. It is able to detect new devices and can list in listview but not able to remove the old ones. Thanks in advance. 回答1: In the BrodcastReceiver inside WifiP2pManager.WIFI_P2P_PEERS_CHANGED_ACTION matching action call requestpeers() method and dont call inside anyother match.....also use peers.clear() [that may be ur arraylist

How to use InputMethodService in wifi p2p service discovery?

风流意气都作罢 提交于 2019-12-12 01:56:17
问题 I am new to android, please tell me if inputMethodService can work with wifi p2p service discovery? I want one phone to act as a keyboard for another phone. Please tell me if it is possible and which resources to refer in order to begin with it. Thank you. 回答1: I think what you need to do is not worry about the input-method in the first device, but create an application where you input text as normal from what ever you are using for input on the android device and then make that application

Transfer data from one device to another - android

给你一囗甜甜゛ 提交于 2019-12-11 17:25:21
问题 so I have created two separate apps, one acts as a client & the other acts as a server. Both devices are connected using hotspot: Connection between the devices is successful. For transferring data from the server to the client, I am using the below code: public static String downloadDataFromSender(String apiUrl) throws IOException { InputStream is = null; try { URL url = new URL(apiUrl); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setReadTimeout(10000 /*

How to make own device client or sender

眉间皱痕 提交于 2019-12-11 15:02:48
问题 I am developing a sharing app where i am using wifip2p framework to connect two devices and one is sender and other is receiver. And the problem that i am facing is that who would be sender and who would be receiver get selected automatically. I am using below code to connect to devices. /** * @param device to connect */ @Override public void connect(WifiP2pDevice device) { WifiP2pConfig config = new WifiP2pConfig(); config.groupOwnerIntent = 0; config.deviceAddress = device.deviceAddress;

Change WiFi-Direct IP range? Force IPv6 in Android WiFi-Direct?

一笑奈何 提交于 2019-12-07 10:21:00
问题 I have two Android KitKat phones, both are running WiFi-Direct groups as Group Owners, let's call them GO1 and GO2 I managed to connect GO1 as a legacy client to GO2 without breaking any of the (previously set) wifi-direct groups. The problem is that, as you might know, the GO IP address is hardcoded in Android source, and is set to 192.168.49.1 Therefore, both of my devices, GO1 and GO2 have the same IP address (**)... each on his local network. My app is both client and server at the same

WiFi P2P network in Android Things

纵然是瞬间 提交于 2019-12-05 11:52:17
I would like to create a P2P WiFi network using Android Things (5.1) and a couple of Raspberry Pi 3 or alternatively using Bluetooth. I followed the guide in the Android Developer section https://developer.android.com/guide/topics/connectivity/wifip2p.html , so my MainActivity looks like: private class MainActtivity { private WifiP2pManager mManager; .... @Override public void onCreate(Bundle savedInstances) { mManager = (WifiP2pManager) getSystemService(Context.WIFI_P2P_SERVICE); .... } } However when I try to run the app, with WiFI enabled, the SystemServiceRegistry shows a message stating

Android O issues with WiFi Peer Discovery

前提是你 提交于 2019-12-04 05:21:20
I am developing an Android Application that employs WiFi (Direct) for service discovery and P2P peer discovery/connection. My development enviromment is as follows:- Android Studio 3.0 Beta 4 Build #AI-171.4304935, built on August 29, 2017 JRE: 1.8.0_152-release-915-b01 x86_64 JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o Mac OS X 10.11.6 My Gradle build:- apply plugin: 'com.android.application' apply plugin: 'realm-android' android { compileSdkVersion 26 buildToolsVersion "26.0.1" defaultConfig { applicationId "com.research.wifi_direct" minSdkVersion 19 targetSdkVersion 26 versionCode 1

How change the device name in WiFi direct p2p?

▼魔方 西西 提交于 2019-12-04 00:48:34
问题 Is it possibile to change the device name of WiFi direct through the code? I've tried to: private WifiP2pDevice wDevice; wDevice.deviceName = "newName"; But, obviously it doesn't work. Any idea?! 回答1: Following code use Reflection api of Java,It is less preferrable due to lack of efficiency but Android does not provide another way so, You can use it works with charm : try { Method m = wpm.getClass().getMethod( "setDeviceName", new Class[] { WifiP2pManager.Channel.class, String.class,

WiFi Direct device connection with other Android devices

扶醉桌前 提交于 2019-12-01 13:39:09
Can I connect a WiFi Direct enabled device to any other device which doesn't have WiFi Direct feature but supports WiFi hotspot connection? Does WiFi direct uses specialized hardware to be present on both devices? Will network discovery work in such cases? It is possible. Code taken from a talk I gave at Droidcon UK 2013. You need to call the createGroup(WifiP2pManager.Channel c, WifiP2pManager.ActionListener listener) method of the WifiP2pManager class. This will create a Wi-Fi Direct group that supports legacy Wi-Fi connections. Prior to the call, you need to register a broadcast receiver