android-wifi

wifi search for the devices connected to the same network i.e other than acces point(for android)

旧时模样 提交于 2020-01-10 20:12:19
问题 i want to make a modification to my project and right now the project status is..... it is searches the available WiFi networks and shows the list with info of the network this works properly.Now i want to search and see the details of the devices connected to the network. Is there any way to find these devices ? Your comment will be useful for me, Thanks. 回答1: Would you like to discover a specific device ? Or you need the list of all connected devices? The second I don't think is possible.

android studio 1.5.1, marshmallow no internet access detected won't automatically reconnect

一世执手 提交于 2020-01-10 05:53:05
问题 I'm having this problem on some 2013 Nexus 7's. got some code to work (please see below). package acme.wifi; import android.content.*; import android.net.wifi.*; import android.os.Bundle; import android.support.design.widget.FloatingActionButton; import android.support.design.widget.Snackbar; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.view.View; import android.view.Menu; import android.view.MenuItem; import java.math.*; import

Get current location using wifi?

自闭症网瘾萝莉.ら 提交于 2020-01-07 09:33:07
问题 How can i get current location using WiFi? In my project using gps I can get current location ... How can I use network service in android? LocationManager mlocManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); LocationListener currentlocation = new CurrentLocation(); mlocManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, currentlocation); But I want current location WiFi? Can anyone help me for getting current location using WiFi? 回答1: Try to use NETWORK

How to get Data usage on android by both wifi and Mobile data?

懵懂的女人 提交于 2020-01-07 05:35:11
问题 I need to get a data usage on each application installed on a android mobile. Ex: I installed YouTube application on my mobile i need to get data usage of YouTube app by wifi and mobile data. Excepted result: YouTube - Wifi - 500MB. YouTube - Mobile Data - 100 KB I try to use TrafficStats API int mobileTx = TrafficStats.getMobileTxBytes(); int mobileRx = TrafficStats.getMobileRxBytes(); int wifiTx = TrafficStats.getTotalTxBytes() - mobileTx; int wifiRx = TrafficStats.getTotalRxBytes() -

Checking if wifi is connected returning false even though it is connected

折月煮酒 提交于 2020-01-05 08:23:25
问题 I am working on an android project and I am trying to check if an android device is connected to Wifi, however, my function is always returning false, even though my device is successfully connected to Wifi. In the constructor for the class I pass the context of the calling method, and within the constructor I create an instance of the ConnnectivityManager Below is the constructor public NetworkManagement(Context context) { this.context = context; connectivityManager = (ConnectivityManager

can we have wifi direct api working in 2.3 version

狂风中的少年 提交于 2020-01-04 13:37:40
问题 hi i am developing a app which will use proximity to pair other persons. I can either use Bluetooth or Wifi Direct. After some research i found out that Android ICS has API's for Wifi direct but if my application needs to work on older phones i need some API which can help me, please guide me. Does Google provide any API to be included to the sdk to be used for older android versions or I am wondering if it is possible ?? I am reluctant to use Bluetooth because of it's slow connectivity.

can we have wifi direct api working in 2.3 version

限于喜欢 提交于 2020-01-04 13:36:55
问题 hi i am developing a app which will use proximity to pair other persons. I can either use Bluetooth or Wifi Direct. After some research i found out that Android ICS has API's for Wifi direct but if my application needs to work on older phones i need some API which can help me, please guide me. Does Google provide any API to be included to the sdk to be used for older android versions or I am wondering if it is possible ?? I am reluctant to use Bluetooth because of it's slow connectivity.

How to turn off wifi hotspot programmatically in Android 8.0 (Oreo) (setWifiApEnabled is not support this version anymore)

最后都变了- 提交于 2020-01-04 07:10:49
问题 I reference the code to turn on hotspot in Android 8.0, it is work. But I have no idea about how to disable it @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

how can I check whether device can access Internet via active WiFi Connection?

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-04 04:29:28
问题 I am referring to a situation when device is connected to access point but for some reason is blocked from accessing internet using this AP. 回答1: for check wifi is enabled or not WifiManager wfManager = (WifiManager)getSystemService(Context.WIFI_SERVICE); if(wfManager.isWifiEnabled()) { //Code } else { //Code } for check internet connection.. public boolean isOnline() { ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo netInfo = cm

Android 8 Settings app crashes on emulator with clean AOSP build

你离开我真会死。 提交于 2020-01-03 16:58:44
问题 "Settings" app will crash immediately after open with clean Android 8 build (aosp_x86-eng) on emulator. logcat output is below: --------- beginning of main 1536 1550 E memtrack: Couldn't load memtrack module 1536 1550 W android.os.Debug: failed to get memory consumption info: -1 --------- beginning of system 1536 1548 I ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.android.settings/.Settings (has extras)} from uid 10013