android-wifi

Android Getting WiFi signal strength as it changes

主宰稳场 提交于 2019-12-21 21:35:55
问题 I want to get the Signal strength of the WiFi network I am connected to , as it changes . This is my broadcast receiver registerReceiver(new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { int info = Wifi.getConnectionInfo().getRssi(); textStatus.append("\n\n : " + Integer.toString(info)); } }, new IntentFilter(WifiManager.RSSI_CHANGED_ACTION)); I am getting it only once . How do i get it as it changes ? 回答1: Update : From tests in Android 4.4 and 5.0

duplicate SSID in scanning wifi result

旧时模样 提交于 2019-12-21 20:09:56
问题 i'm trying to make an app that can create a list of available wifi access point. here's part of the code i used: x = new BroadcastReceiver() { @Override public void onReceive(Context c, Intent intent) { results = wifi.getScanResults(); size = results.size(); if (results != null) { for (int i=0; i<size; i++){ ScanResult scanresult = wifi.getScanResults().get(i); String ssid = scanresult.SSID; int rssi = scanresult.level; String rssiString = String.valueOf(rssi); textStatus.append(ssid + "," +

How to get an IP address from Mac address programmatically on Android?

时光毁灭记忆、已成空白 提交于 2019-12-21 12:23:19
问题 Programmatically, I got Mac addresses of other Wifi enabled devices from my device on the same network. Same I need to apply here. Is there any apps or any other possibilities to get an IP addresses of each wifi enabled devices on the network by using those Mac addresses on Android? 回答1: If you're looking for an android app, you could try Network Discovery which work very well and can list all the devices on your local network with the corresponding IP and address. If you're looking for code

Get location details using WiFi

半城伤御伤魂 提交于 2019-12-21 06:09:20
问题 I am creating an small application in Android, which points the current location. I have used GPS-provider for that, but found out that I won't get the data using GPS-provider at some places. Can any one help me in getting this? 回答1: If you are connected to WIFI then simply use NETWORK PROVIDER for your location updates. they will be fast and enough accurate too. generally if location updates are not required so frequently then location updates are asked from both GPS and NETWORK together at

Extracting SSID password from supplicant config file in Android

社会主义新天地 提交于 2019-12-21 05:32:25
问题 I'm trying to write an Android SYSTEM app that extracts the Wifi password from the supplicant configuration file (/data/misc/wifi/wpa_supplicant.conf). Using adb with root permissions, I can read the file without any problem and see the password in plain text. However, when I try to open the file programatically I get EACCES (Permission denied) error. That happens even though my app is running as 'system' user (I define android:sharedUserId="android.uid.system" in the manifest), the app is

Simulate Slow Internet Connection on a REAL device? [duplicate]

送分小仙女□ 提交于 2019-12-21 03:53:25
问题 This question already has answers here : Simulate low bandwidth in android (11 answers) Closed 5 years ago . I need to test my application in conditions where even 2G Internet connectivity isn't at its full coverage (i.e. 2 bars instead of 4, 2G). I prefer conducting these tests over WiFi. Is there a way (programmatically or otherwise) to tell the Android OS on the real device to slow down or throttle Internet connection 56 Kbit/s? Note: I know how to do this on the emulator. I'm looking for

Facebook app type no internet connection message

夙愿已清 提交于 2019-12-21 02:52:05
问题 How can I show no internet connection message like in facebook app that appears below the tab view. 回答1: You can design this in your XML file and then set its visibility to invisible like this: <RelativeLayout android:id="@+id/relativelayout_connection" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignParentRight="true" android:alpha="0.8" android:background="@android:color/black" > <TextView android:id="@+id

How to find wifi and network data usage separately by particular application in android?

妖精的绣舞 提交于 2019-12-20 12:08:38
问题 recived = TrafficStats.getUidRxBytes(uid); send = TrafficStats.getUidTxBytes(uid); TrafficStats.getMobileRxBytes(); TrafficStats.getMobileTxBytes(); TrafficStats.getTotalRxBytes(); TrafficStats.getTotalTxBytes(); i have application id and i can get that application data usage but i cant get information in more detailed like data usage using wifi and network. i want to find both separately for all installed application in device. how can i find that.? i have already tried many things but didn

Jelly Bean Issue - wifiManager.getConnectionInfo().getSSID() - extra “”

落爺英雄遲暮 提交于 2019-12-20 10:23:59
问题 Hi all bug reporting for your information. link Problem details : The Code - wifiManager.getConnectionInfo().getSSID() The above code to returns the current SSID, it is returning the current SSID with extra quotations around it. For eg. the SSID internet is returned as "internet" . This is only seen on Jelly bean 4.2 using device Nexus 7. This bug is causing errors in our app as we compare the current SSID with the SSID that we are trying to connect too. The code wifiManager.getScanResults();

wifi getLinkSpeed() return a value always

自古美人都是妖i 提交于 2019-12-20 05:53:47
问题 I am developing an application that displays internet speed. like: https://play.google.com/store/apps/details?id=netspeed.pt https://play.google.com/store/apps/details?id=com.internet.speed.meter.lite&hl=en I have to gain WiFi speed at any moment, I used the runnable: WifiManager wm = (WifiManager)getSystemService(Context.WIFI_SERVICE); WifiInfo wifiInfo = wm.getConnectionInfo(); .... runnable = new Runnable() { @Override public void run() { int linkSpeed = wifiInfo.getLinkSpeed(); chatHead