android-wifi

Get WiFi Signal Strength of Connected Network

不想你离开。 提交于 2019-12-05 02:33:10
问题 I'm trying to display the signal strength of the connected WiFi network in my Android app. I've tried the following: //Receiver for information on the network info private BroadcastReceiver mNetworkReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { Log.d("INFO", "onReceive()"); List<ScanResult> scanResult = mWifi.getScanResults(); for(ScanResult scan : scanResult) { Log.d("INFO","Network strength: " + String.valueOf(scan.level) + " dBm " +

How to use adb tcpip without USB debugging enabled?

两盒软妹~` 提交于 2019-12-05 01:42:51
I've read quite a few posts already on adb and tcpip mode and I can create a wireless adb connection, but only when USB debugging is on. The way I'm using it is like so: USB debugging is enabled call adb tcpip on the computer (switches from usb to tcpip mode with default port 5555) call adb connect PHONE_IP and a connection is made The above works with or without the usb cable being connected, but only when the USB debugging option is ticked in Developer Options on the Android device. As soon as I untick the option, the tcp connection is lost and cannot be re-established until re-enabling the

Unable to access Internet via WiFi from a Background service

↘锁芯ラ 提交于 2019-12-05 00:47:32
问题 I'll get straight onto some facts/figures I discovered pls help me if you've faced/solved a similar problem. I send back data every 5 minutes to a server unless the user manually toggles it Off with the help of a wakeful broadcast receiver through a intent service . Plus I get wifi locks before doing (I've tried this already without locks; doesnt work either) Now on devices sending back data from regular data networks (2G/3G/4G) this works fine but on those connected to a wifi network somehow

compile and build “iw” for android 4.1 device?

佐手、 提交于 2019-12-05 00:00:44
问题 i need to install iw wireless packages on android 4.1 device. but i don't know how and what is the require version of the packages to install !! also is it need linux platform to do this or it is enough to build and install on adb shell for android rooting device. i see this link but when i do it from adb terminal i see that git and some shells not found ??? how to do it ? it seems no one has any idea ?? 回答1: While building iw version 3.11 (which has an Android.mk file already), I encountered

Peer to peer connection in android

天涯浪子 提交于 2019-12-04 21:51:07
Is there any way such that i can communicate with other android device in the same wifi network... for sharing files. Can I have list of all android device connected to same n/w? can any one refer me any api for doing that? or how can I make that thing happen?? this thing must be possible, Isn't it? I think this is possible in Android 4.0, using WiFiDirect but how that can be possible in lower level sdk's. Thank you you should take a look at this WifiP2pManager 来源: https://stackoverflow.com/questions/8741796/peer-to-peer-connection-in-android

Constantly check for wireless network change [duplicate]

心不动则不痛 提交于 2019-12-04 20:23:08
This question already has an answer here: How can I monitor the network connection status in Android? 1 answer I would like to constantly check whether the phone is connected to a specific wireless network. I thought of a service and the SSID of the network of course, but how? VendettaDroid You'll want <intent-filter> <action android:name="android.net.wifi.WIFI_STATE_CHANGED"/> <action android:name="android.net.wifi.STATE_CHANGE"/> </intent-filter> In your receiver tag. Or if you want more control over it, before registering BroadcastReceiver set these up: final IntentFilter filters = new

What's the meaning of Rssi in android WifiManager

 ̄綄美尐妖づ 提交于 2019-12-04 19:41:17
问题 I am trying to get the signal strength of the current wifi connection using getRssi() private void checkWifi(){ ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo Info = cm.getActiveNetworkInfo(); if (Info == null || !Info.isConnectedOrConnecting()) { Log.i("WIFI CONNECTION", "No connection"); } else { int netType = Info.getType(); int netSubtype = Info.getSubtype(); if (netType == ConnectivityManager.TYPE_WIFI) { wifiManager =

Broadcast receiver not working background on some devices

半城伤御伤魂 提交于 2019-12-04 19:34:42
I am trying to get WiFi connection changing event using Broadcast Receiver class. I have tested this on Samsung S7 edge and HTC 626Q and it works well (even when the app is closed), but this is not working on Huawei GR5 2017 if the app is closed. It works only when the app is running on screen. Both S7 and GR5 devices have Android 7 (Nougat) OS. Broadcast Receiver public class NetworkChangeReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { Toast.makeText(context,intent.getAction(),Toast.LENGTH_SHORT).show(); } } AndroidManifest file <?xml

Details of connected users to mobile hotspot

可紊 提交于 2019-12-04 18:10:53
If I've enabled Wi-Fi Hotspot in my android phone and 2 other android phones are connected to my Hotspot, then how can I distinguish between each phone? Does my phone distinguish between the different phones using IEMI numbers or something else? Adarsh Yadav 1) You can use BroadcastReciever "android.net.wifi.WIFI_HOTSPOT_CLIENTS_CHANGED" to detect client connection. In your AndroidManifest: <receiver android:name=".WiFiConnectionReciever" android:enabled="true" android:exported="true" > <intent-filter> <action android:name="android.net.wifi.WIFI_HOTSPOT_CLIENTS_CHANGED" /> </intent-filter> <

Change WiFi hotspot's SSID and password in Android Oreo 8.x

江枫思渺然 提交于 2019-12-04 15:35:58
问题 In my Android application I'm using the following code snippet: @RequiresApi(api = Build.VERSION_CODES.O) private void turnOnHotspot(){ WifiManager manager = (WifiManager) getApplicationContext().getSystemService(Context.WIFI_SERVICE); manager.startLocalOnlyHotspot(new WifiManager.LocalOnlyHotspotCallback(){ @Override public void onStarted(WifiManager.LocalOnlyHotspotReservation reservation) { super.onStarted(reservation); Log.d(TAG, "Wifi Hotspot is on now"); } @Override public void