android-wifi

Programmatically get connected Wifi password?

蹲街弑〆低调 提交于 2020-05-10 03:20:49
问题 My app needs to communicate with a Sony Wifi camera. The user specifies the camera Wifi SSID and password, the app connects, takes a picture and retrieves it to the android device. When the app is done taking pictures, I want it to restore the Wifi connection (if any) that existed before the app was started. E.g. the user may have been connected to to a coffee shop hotspot when she starts the wifi camera app, and so the the app should automatically reconnect to the hotspot when it's done. To

Internet check over android.net.NetworkCapabilities not working

别说谁变了你拦得住时间么 提交于 2020-04-29 09:28:47
问题 I have a question about android.net.NetworkCapabilities.NET_CAPABILITY_INTERNET . According to the JavaDocs this "indicates that this network should be able to reach the internet". Unfortunately this seems not to work properly - or I do something wrong here. I outputed the value of capabilities for three different Wi-Fi networks: A Wi-Fi with internet access. A Wi-Fi without internet access (I manually disabled the internet here). A public hotspot (the "Telekom" hotspot) In all three cases

Android (AOSP) 7: Build module before other / Patch module as part of build process / Modify system sources

坚强是说给别人听的谎言 提交于 2020-03-25 16:57:07
问题 Considering the AOSP 7 build with Android.mk files: How can I add built-time dependency between different LOCAL_MODULE , specifically build a target BEFORE an certain MODULE is built? I want to run a patch apply target, before the a system module is compiled. My goal is to patch the WifiStateMachine.java from within the built process, because it currently does not support to dynamically disable RSSI polling. 回答1: TL;DR: copy the Android.mk of the module you want to patch and add a patching

how to get the IP of the wifi hotspot in Android?

▼魔方 西西 提交于 2020-03-17 05:16:30
问题 As the title says... I'm trying to be able to get the IP of the wifi iface when it is configured as hotspot. Ideally, I would like to find something that works for all the phones. Of course, the WifiManager is useless when it comes to get info from the AP. Luckily, I've been able to get the IPs of all the interfaces by doing this: public String getLocalIpAddress() { try { for (Enumeration<NetworkInterface> en = NetworkInterface.getNetworkInterfaces(); en.hasMoreElements();) { NetworkInterface

how to get the IP of the wifi hotspot in Android?

本秂侑毒 提交于 2020-03-17 05:16:09
问题 As the title says... I'm trying to be able to get the IP of the wifi iface when it is configured as hotspot. Ideally, I would like to find something that works for all the phones. Of course, the WifiManager is useless when it comes to get info from the AP. Luckily, I've been able to get the IPs of all the interfaces by doing this: public String getLocalIpAddress() { try { for (Enumeration<NetworkInterface> en = NetworkInterface.getNetworkInterfaces(); en.hasMoreElements();) { NetworkInterface

How to get IP Address of Server (Socket) in Android?

廉价感情. 提交于 2020-02-25 07:39:34
问题 I'm creating a simple chat program that connects two android devices and they can send simple message I run the server with Socket on a port (1234 for example) The problem is from the client i do not know the server IP Address. (and i dont want to enter it manually) is there a way to find a server that is running on a specific port?or can i run the server on some specific static IP that i can give it to clients? if not is there another way to communicate with android devices that works on

How to get IP Address of Server (Socket) in Android?

笑着哭i 提交于 2020-02-25 07:39:05
问题 I'm creating a simple chat program that connects two android devices and they can send simple message I run the server with Socket on a port (1234 for example) The problem is from the client i do not know the server IP Address. (and i dont want to enter it manually) is there a way to find a server that is running on a specific port?or can i run the server on some specific static IP that i can give it to clients? if not is there another way to communicate with android devices that works on

Android: Back to App after setting wifi

蓝咒 提交于 2020-01-25 05:05:08
问题 In myActivity, This is my code to check if my phone connect to the Internet or not. if (!isConnected()) { // super.playingVideo.setVideoUrl(product.getVideoUrl()); String message = getResources().getString(R.string.wifi_prompt); super.showDialog(this, message, R.string.wifi_setting, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { if (dialog != null) { dialog.dismiss(); } currentProduct = product; isViewRequest = true; startActivity

Android Lollipop - WiFi Hotspot setWifiApEnabled() get InvocationTargetException

早过忘川 提交于 2020-01-22 12:42:06
问题 I'm using in the app setWifiApEnabled() from Hidden API (access by reflection). In some older phone it´s working (also with Samsung Galaxy S3, some phones with 4.4,...) but I tested it with Samsung Galaxy S5 and I get java.lang.reflect.InvocationTargetException at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) ... I'm using similar code like there Android 2.2 wifi hotspot API or How and what to set to Android WifiConfiguration.preSharedKey

ANDROID:- not able to get the available wifi list using ScanResult

一曲冷凌霜 提交于 2020-01-17 06:56:11
问题 I'm trying to list available wifi network by ScanResult. Can anyone tell me what's wrong in my code? I'm not getting the desired output. Here's My code: public class Activity_scanwifi extends AppCompatActivity { Switch aSwitch; TextView textView; WifiManager wifiManager; WifiInfo wifiInfo; String info; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.scanwifi); aSwitch=(Switch) findViewById(R.id.s); textView=(TextView)