android-wifi

Adb over wireless without usb cable at all for not rooted phones [duplicate]

元气小坏坏 提交于 2019-11-28 04:04:01
This question already has an answer here: How can I connect to Android with ADB over TCP? 32 answers I want to debug Android APPs on my phone (LG nexus 4). I'm travelling and I forgot my USB cable. When I work at home I can do it just connecting the USB cable and executing the command 'adb tcpip 5555'. Then I can unplug the USB cable and connect via 'adb connect IP'. But now I cannot execute the first command because I don't have a cable. I don't understand why I have to do it every time, since I already execute the 'adb tcpip' command before. What I tried now: I installed a terminal

UDP broadcast packets not received in sleep mode

北慕城南 提交于 2019-11-28 02:11:37
问题 My Android application periodically sends and receives UDP broadcast messages on the WiFi LAN. When the display is on, everything works fine and all messages are sent and received correctly. When the display goes to sleep the application however stops receiving UDP broadcast messages (but still sends them). Acquiring the WiFiLock (as well as a Multicast Lock) does not seem to make any difference and my wifi sleep policy is set to WIFI_SLEEP_POLICY_NEVER. This is an issue on Android 2.3.3 and

How to get wifi hotspot state

ぐ巨炮叔叔 提交于 2019-11-28 01:02:56
问题 I am creating wifi hotspot in my phone and I want get its state change event when I switched on or off hotspot. 回答1: Please look at the following code. This will help you public class WifiApManager { private final WifiManager mWifiManager; public WifiApManager(Context context) { mWifiManager = (WifiManager)context.getSystemService(Context.WIFI_SERVICE); } /*the following method is for getting the wifi hotspot state*/ public WIFI_AP_STATE getWifiApState() { try { Method method = mWifiManager

Android: Programmatically Turn on WiFi hotspot

久未见 提交于 2019-11-28 00:48:52
问题 I am trying to turn on the portable Wifi hotspot ON, by referring this link: how to set advanced settings of android wifihotspot This is working well on Samsung Galaxy S3 Android v4.4.2.(no issues) But on other devices with the same or lower Android version, the application crashes and restarts the device. The code is as follows: package com.android.startwifi; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import android.app.Activity; import android

Android : Reconnect to Wi-Fi after entering coverage area while screen turned off

吃可爱长大的小学妹 提交于 2019-11-27 21:44:22
I have been struggling with automatically turning on Wi-Fi as soon as the device is within range of an access point without turning on the screen. It has been very frustrating to test and figure out a solution, especially since different devices have completely different results. Base Test Keep the screen turned off during this test. The application should hold a WifiLock. Walk out of WiFi coverage and stay there for a minute. Walk back into coverage. Result : The Wifi is not reconnected immediately and thus app does not reconnect to server. Depending on the device and settings, sometimes it

How to provide option to select wi-fi or GPRS for network connectivity in android app

£可爱£侵袭症+ 提交于 2019-11-27 21:33:46
In my app i want to provide the user with the option to choose wi-fi / GPRS for network connectivity to the web server. May be answers to the following ques solve my prob ... 1. How to check which is the current default network connectivity option enabled. 2. How to enable wi-fi/GPRS on user selection or (disable the wi-fi if user chooses GPRS - if only this option will be required for GPRS to work) or is there some other way around to do this ? Try this: ConnectivityManager connManager = (ConnectivityManager) getSystemService(CONNECTIVITY_SERVICE); NetworkInfo mWifi = connManager

WIFI_STATE_CHANGED_ACTION intent not received upon connection to WiFi access point?

风流意气都作罢 提交于 2019-11-27 21:24:42
问题 Part of my app's functionality is to scan and display a list of WiFi access points, and then connect to the one chosen by the user. I have this functionality working. Now, I also wish to be notified when the connection "goes through". This should be fairly simple, but I find myself stumbling. I have read through various posts here at SO, and they all mention registering for WifiManager.SUPPLICANT_CONNECTION_CHANGE_ACTION or WifiManager.WIFI_STATE_CHANGED_ACTION . However, neither of these

connect to android devices using wifi direct without prompt

孤街浪徒 提交于 2019-11-27 20:36:31
问题 i am trying to connect two android devices using WIFI direct and i was successful. But the problem is the second device has to accept the a connection prompt after the other device initiates the connection. It is undesirable for what i am trying to achieve. I saw a few post here in stack overflow itself saying that currently its not possible. But came across an app called SUPERBEAM which user WIFI direct but without the prompt. A search in google gave me the following link from xda forum

How to be notified when a peer is no longer available in the Wi-Fi Direct range?

。_饼干妹妹 提交于 2019-11-27 20:12:51
I am developing an Android application based on the use of Wifi Direct API. I have registered in my Activity a BroadcastReceiver in order to be notified about the following Wifi Direct events: WifiP2pManager.WIFI_P2P_STATE_CHANGED_ACTION WifiP2pManager.WIFI_P2P_PEERS_CHANGED_ACTION WifiP2pManager.WIFI_P2P_CONNECTION_CHANGED_ACTION WifiP2pManager.WIFI_P2P_THIS_DEVICE_CHANGED_ACTION I believed that any change in the list of peers (the inclusion or exclusion of a peer in the Wifi Direct range) could trigger the BroadcastReceiver . In my app, when a new peer is found, its name is correctly

Create Wifi Hotspot Configuration in android

穿精又带淫゛_ 提交于 2019-11-27 19:11:54
I am using android 4.1.1 ... I am making an application that allows the user to make his own network using Wifi Hotspot and then the clients can connect to it and share data. I have successfully created the Wifi hotspot in android but I cannot configure it for the purpose. Is there any way to configure Wifi Hotspot on android through coding ?? This answer maybe outdated! if(wifiManager.isWifiEnabled()) { wifiManager.setWifiEnabled(false); } WifiConfiguration netConfig = new WifiConfiguration(); netConfig.SSID = "MyAP"; netConfig.allowedAuthAlgorithms.set(WifiConfiguration.AuthAlgorithm.OPEN);