android-wifi

Is using WakeLock overkill while using WifiLock on Android?

本秂侑毒 提交于 2019-12-19 19:56:38
问题 My audio streaming app is working correctly with only WifiLock. But some devices report that when they turn off the screen, connection is cut and audio streaming is topped. (They say this does not happen on 3G) So, I thought maybe I can also use a Partial WakeLock. I am not sure if this fixes the issue but I think it is an option. At the same time, adding a WakeLock while a basic WifiLock is working may deplete the battery faster and may not fix the issue. What do you think about adding a

how to check if wifi is really connected in Android

拥有回忆 提交于 2019-12-19 10:22:44
问题 I'd like my android device to connect to a wifi hotspot. I created a new wificonfiguration and add it into the wifimanager , this wificonfiguration has NetworkId .Then I invoke the function wifi.enableNetwork(NetworkId, true). After that, I think the supplicant will go through obtaining ip address, authentication, and at last physically connect to the hotspot. So is there a way to identify if the wifi is physically connected or not? I would prefer a handler-like method. 回答1: You can try this:

WiFi state is not enabling

南楼画角 提交于 2019-12-19 06:05:50
问题 I am trying to create a widget for enabling and disabling the wifi. if(myWifiManager.isWifiEnabled()){ System.out.println("Toggle Wifi Enabled going to disable"); myWifiManager.setWifiEnabled(false); } else{ System.out.println("Wifi Disabled going to enable "); myWifiManager.setWifiEnabled(true); System.out.println("WI: "+myWifiManager.isWifiEnabled()); } This is the code i am using the disabling part is working fine but the enabling part is not working fine. Soon after enabling the wifi i am

Change WiFi MAC Address [closed]

大兔子大兔子 提交于 2019-12-19 04:01:06
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . I'm one of the developers working on the Serval Project and we're looking at using the Huawei Ideos U1850 as the default platform for our Android development activities. We've purchased a few phones from one of our local resellers here in Australia. We have noticed that a number of the devices that we've sourced

Android Q, programmatically connect to different WiFi AP for internet

醉酒当歌 提交于 2019-12-19 02:49:06
问题 As in Android Q, several WiFi APIs are restricted. I am trying to use alternate APIs to connect to different Wifi AP for internet. Below is my code : WifiNetworkSpecifier.Builder builder = new WifiNetworkSpecifier.Builder(); builder.setSsid("wifi-ap-ssid"); builder.setWpa2Passphrase("wifi-ap-password"); WifiNetworkSpecifier wifiNetworkSpecifier = builder.build(); NetworkRequest.Builder networkRequestBuilder1 = new NetworkRequest.Builder(); networkRequestBuilder1.addTransportType

Android's proxy confusing documentation resources

北慕城南 提交于 2019-12-18 13:25:45
问题 It seems to me that there is a lot of confusing resources regarding the proxy topic on Android. First of all, it seems that all the methods of the Proxy class are declared deprecated and it's suggested to: "Use standard java vm proxy values to find the host, port and exclusion list. This call ignores the exclusion list." The official java vm proxy values can be accessed in the following way: System.getProperty("http.proxyHost") System.getProperty("http.proxyPort") System.getProperty("http

BroadcastReceiver declared in manifest is not receiving the Broadcast

僤鯓⒐⒋嵵緔 提交于 2019-12-18 13:01:21
问题 I've tried to register a Wifi BroadcastReceiver to get the wifi state when it changes. But so far I have no luck receiving the broadcast. <application android:icon="@drawable/ic_launcher" android:label="@string/app_name" > <receiver android:name=".WifiReceiver" > <intent-filter> <action android:name="android.net.wifi.WifiManager.WIFI_STATE_CHANGED_ACTION" /> <action android:name="android.intent.action.PHONE_STATE" /> </intent-filter> </receiver> //activity declaration here... </application>

Multiplexed hotspot in Android

。_饼干妹妹 提交于 2019-12-18 12:32:40
问题 Is it possible to write an app in Android using the wifi API which will act like a hotspot (so granting network access to wifi clients) while still allowing the local wifi device to connect to another wifi network ? The one I've tested are disabling local Wifi connection in order to create a hotspot. 回答1: I post here after a few months so people that would like to implement this on an Android device might be helped. There is a way to have one wireless chip working in hybrid mode, with both

Changing Android hotspot settings

别来无恙 提交于 2019-12-18 12:02:24
问题 With the release of API level 26, my app's core functionality broke, this being, changing the users' hotspot setting within the application. To get and set this configuration I am using the following functions from the WifiManager hidden api: getWifiApConfiguration and setWifiApConfiguration . Method getWifiApConfiguration = wifiManager.getClass().getMethod("getWifiApConfiguration"); getWifiApConfiguration.invoke(wifiManager); This is working with devices prior to Android O, but in this

Connect two android phones with wi-fi (without laptop or access point) and send file

爷,独闯天下 提交于 2019-12-18 10:37:29
问题 Is it possible to connect two android phones by wi-fi, without using a bluetooth/GSM/CDMA/IR? Also, there is no any laptop or wi-fi access points or wi-fi routers. I think, that it is possible to create some SSID on both phones, do a static configure of IP addresses. Will android connect to another's android wi-fi? If they will be connected, how can I send a file from one phone to second? Is there a ftp-client and server? or Can I ssh to other phone? Or telnel/netcat? Maybe http ? 回答1: This