android-wifi

Re: Connect to a wifi network programmatically

不打扰是莪最后的温柔 提交于 2019-12-11 03:56:19
问题 I wish to create an application, that detects the available wifi connections in the vicinity, and then connects to them. What I have done till now, is that I created a ListView that lists the available wifi connections, and then I created a LongItemClick dialog box, that shows the SSID and the BSSID of the network, and asks for the password. Now, I wish to connect to one of the networks, independent of what kind of network it is, it might be WEP, WPA or Open too. I am unable to get an

File transfer over Wi-Fi in Android

别来无恙 提交于 2019-12-11 03:32:31
问题 I want to make an Android app which can transfer a file from one phone to another via Wi-Fi. In Android 4.0 it can be done through Wi-Fi direct but how it would be possible for lower versions that do not support Wi-Fi direct? 回答1: You can do this by opening a network connection. This will work over Wifi or any connection the device has. Let's say device A wants to send to device B a file. B opens a listening port A opens the file as an input stream A connects to B's listening port A sends the

how to check WiFi connection is automatic or established manually in android?

社会主义新天地 提交于 2019-12-11 01:54:01
问题 I am doing a small android application, which will show established WiFi connection is automatic or Manuel. Is it possible to take WiFi access point which is set by user in default "setting" application? Thanks, Vani 回答1: see this [ www.developer.android.com/reference/android/net/wifi/package-summary.html] or WifiManager wifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE); if (wifiManager != null) { WifiInfo info = wifiManager.getConnectionInfo(); if (info != null) { String

Get IMEI code or/and Mac Address of a Device

半城伤御伤魂 提交于 2019-12-11 01:32:47
问题 I'm implementing an way to unique identify the device. The architect send me the following specs: devices with Wifi + 3G: IMEI Code devices Wifi only - MacAddress Both needs also the Manufacturer + Model for complete the id. My questions are: How do I get the IMEI from the device? How can I get the Manufacturer and Model from the device? (I see theres some constants on Build class for it, but don't know where to use them) Theres devices with 3G only? How can I know if the device is wifi only,

Android Customize Wifi Scan

不打扰是莪最后的温柔 提交于 2019-12-10 18:13:01
问题 I am interested in scanning only a particular set of frequencies for a particular time interval (this is different from scanning interval in android api). Is there any high level api or user to kernel space communication interfaces, mechanisms (sysfs,iotctl,mmap etc.) (in a rooted device) that can allow me to specify the set of frequencies to be scanned for a particular interval of time. If I understand correctly the device supplicant carries this information? Would very much appreciate if

Prevent WiFi from power off

為{幸葍}努か 提交于 2019-12-10 17:48:59
问题 Backround: Android 2.x running on a Tablet. Is there any way to prevent the WiFi from power off when there are no connection incoming or outgoing? I need the WiFi to stay alive for incoming connection from a server. For now I am doing keep alive calls but that's not that nice. I've googled that already and found out that it is something about powersaving. Is there anyway to come around this? Thanks in advance for any Help on this! 回答1: Try to go to Settings -> Wireless -> Wifi Settings ->

Android Marshmallow: How to avoid Wi-Fi drop if No Internet access

纵饮孤独 提交于 2019-12-10 16:43:33
问题 I have a Nexus 5x running MarshMallow 6.0 that is associated to the Wi-Fi of a device that has no Internet access. Android keeps dropping the connection and won't even automatically reconnect after a few tries because it detects that there is no Internet access. How can I force Android to keep the connection with this Wi-Fi even if there is no Internet access? The device is not rooted, but I can change "things" programmatically in the application that actually picks up this Wi-Fi spot. Edit

Callback on device connecting to Wifi Hotspot

空扰寡人 提交于 2019-12-10 15:04:57
问题 I am creating WiFi AP programmatically in my application. Do i get any broadcast when new devices connect to my AP. I know we can get the list of the connected devices from the /proc/net/arp but i need a callback when there is a new connection. Any help is appreciated. 回答1: If you don't need to use the AP to connect to the internet but just to communicate in a LAN, you can create a P2P group with WifiP2pManager instance createGroup and listen to WifiP2pManager.WIFI_P2P_CONNECTION_CHANGED

wifi connection changed action in android

混江龙づ霸主 提交于 2019-12-10 14:44:15
问题 i want to start my application when wifi will be turn on so that i try get action for wifi state changed function but it showing 01-27 15:52:10.470: ERROR/AndroidRuntime(11584): java.lang.RuntimeException: Unable to instantiate receiver com.example.WiFiScanReceiver: java.lang.InstantiationException: com.example.WiFiScanReceiver this is my manifest file <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example" android

how to set advanced settings of android wifihotspot

六眼飞鱼酱① 提交于 2019-12-10 14:33:55
问题 I'm turning portable wifi hotspot ON by following code: private void createWifiAccessPoint() { WifiManager wifiManager = (WifiManager)getBaseContext().getSystemService(Context.WIFI_SERVICE); if(wifiManager.isWifiEnabled()) { wifiManager.setWifiEnabled(false); } Method[] wmMethods = wifiManager.getClass().getDeclaredMethods(); //Get all declared methods in WifiManager class boolean methodFound=false; for(Method method: wmMethods){ if(method.getName().equals("setWifiApEnabled")){ methodFound