wifimanager

Get Android DhcpInfo connected via Ethernet

风格不统一 提交于 2020-01-12 02:19:02
问题 How to get DhcpInfo() (gateway ip, netmask, dns, etc) of android device connected via Ethernet? I know how to get it if device connected via Wifi and using ACCESS_WIFI_STATE permission: WifiManager wifi = (WifiManager) context.getSystemService(Service.WIFI_SERVICE); DhcpInfo dhcp = wifi.getDhcpInfo(); But I still not found the way to get it if device connected via ethernet... Thanks 回答1: In your AndroidManifest.xml file <uses-permission android:name="android.permission.INTERNET" /> <uses

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.

How do I know the wifi connection worked?

纵饮孤独 提交于 2020-01-06 02:45:12
问题 Finally found an answer myself, see my answer below I currently start a wifi scan wifiReceiver = new WifiReceiver(); registerReceiver(wifiReceiver, new IntentFilter(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION)); wifiManager.startScan(); and in my broadcastreceiver connect to a wifi class WifiReceiver extends BroadcastReceiver{ @Override public void onReceive(Context context, Intent intent) { Log.e("DEBUG", "Wifi scanned"); SmartWifiChange(); //connect to certain wifi if stuff.

WiFi changed status affecting my app

放肆的年华 提交于 2020-01-03 04:47:09
问题 I'm using WiFiManager through my app, at some level in the starting of the app it displays all the available WiFi networks to the user and enables him to choose one of them and make a connection to it, I'm making this by registering the CONNECTIVITY_CHANGE receiver through my manifest.xml : <receiver android:name="com.automation.standards.WifiReceiver" > <intent-filter> <action android:name="android.net.conn.CONNECTIVITY_CHANGE" /> </intent-filter> </receiver> and then dealing with the

How to get Port number of wifiNetwork active currently in android

天大地大妈咪最大 提交于 2020-01-02 19:11:07
问题 I have an requirement where i need to supply IP address and Port number of currently Connected Wifi network. I am getting IP address using WifiInfo class having getIpAddress() method. But i am not able to get Port number.. Kindly provide an appropriate solution../ 回答1: Portnumber of Wlan? You are dooing right by using the WifiManager. There is no WLAN port that's why you can't get the portnumber. 来源: https://stackoverflow.com/questions/14749497/how-to-get-port-number-of-wifinetwork-active

How to create Custom WPA Hotspot with ssid and password in android?

我与影子孤独终老i 提交于 2020-01-01 09:05:10
问题 I am using the following code for creating the Wifi-hotspot configuration. I am able to create the Hotspot configuration and able to enable it. but i have give configuration for WPA-PSK, But it always taken as OPEN network. public boolean setHotSpot(String SSID,String passWord){ Method[] mMethods = mWifiManager.getClass().getDeclaredMethods(); for(Method mMethod: mMethods){ if(mMethod.getName().equals("setWifiApEnabled")) { WifiConfiguration netConfig = new WifiConfiguration(); netConfig.SSID

How to create Custom WPA Hotspot with ssid and password in android?

爱⌒轻易说出口 提交于 2020-01-01 09:05:10
问题 I am using the following code for creating the Wifi-hotspot configuration. I am able to create the Hotspot configuration and able to enable it. but i have give configuration for WPA-PSK, But it always taken as OPEN network. public boolean setHotSpot(String SSID,String passWord){ Method[] mMethods = mWifiManager.getClass().getDeclaredMethods(); for(Method mMethod: mMethods){ if(mMethod.getName().equals("setWifiApEnabled")) { WifiConfiguration netConfig = new WifiConfiguration(); netConfig.SSID

how to obtain the ip address of the connected wifi router in android programmatically?

感情迁移 提交于 2020-01-01 00:44:11
问题 I want to obtain the ip address of the the wifi router to which my android phone is connected? I know that we can get the mac/BSSId and SSID by using the android APIS but I don't find the way to find the way to find the ip address of it? I found the code for obtaining the ip address of phone owns wifi router WifiManager myWifiManager = (WifiManager) getSystemService(WIFI_SERVICE); WifiInfo myWifiInfo = myWifiManager.getConnectionInfo(); int ipAddress = myWifiInfo.getIpAddress(); System.out

How to create wifihotspot in Oreo programmatically?

二次信任 提交于 2019-12-31 04:14:09
问题 Hello Given link question is just showing how to turn on/off wifi hotspot but i want to add create wifi hotspot with SSID and password. I written code for creating wifihotspot(in both NONE and WPA2 PSK) in android and its working fine upto android 7 but in oreo it returning me false value.The summary of my code is- private WifiManager wifiManager; private Method method; private WifiConfiguration config; config.SSID = ssid; config.status = WifiConfiguration.Status.ENABLED; method = wifiManager

What interval should I use between each WiFi scan on Android?

早过忘川 提交于 2019-12-30 02:23:18
问题 I need to perform Wifi scans at regular intervals. I am encountering a problem when the time interval is set to 1-2 seconds. It seems like I am not getting any ScanResult . Is there a minimum amount of time to set so that the WifiManager is able to perform a successful WiFi scan? Here is the code. I am using a Service to do the Wifi scan: public class WifiScanning extends Service{ private static final String TAG = "WifiScanning"; private Timer timer; public int refreshRate, numberOfWifiScan,