wifimanager

Creating a custom wifi setup

守給你的承諾、 提交于 2020-04-30 11:42:05
问题 I was just wondering if it is possible to make a custom Wifi interface within an app, where the user can input his Wifi connection instead of starting an intent which leads to the android wifi settings. I was researching this but couldn't find any useful input regarding making a custom wifi setup within the app. startActivity( new Intent( Settings.ACTION_WIFI_SETTINGS ) ); This is not wanted... I want to crate my own wifi setup interface where the user can setup a wifi Profile and let the

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 - Still can't remove Wifi Network Programatically

偶尔善良 提交于 2020-02-05 05:27:25
问题 After reading several other questions/answers, I'm still having an issue using wifiManager.removeNetwork to work. According to: Android - Cant Remove Wifi Network Programatically- The method removeNetwork(int) in the type WifiManager is not applicable for the arguments (String) and How to forget a wireless network in android programmatically? ...my code should work: WifiManager wifiMAN = (WifiManager) getApplicationContext().getSystemService(Context.WIFI_SERVICE); for (WifiConfiguration

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)

Android 6.0.1 - Permission issue = wifiManager.getScanResults() returns 0

一个人想着一个人 提交于 2020-01-15 08:18:29
问题 The permissionsList.add() doesn't work but MainActivity.this.requestPermissions() works fine. The issue is that it brings a dialog box asking if the user allow the location permission. Why adding the permission does not work? Is there a way to avoid the dialog box? See my minimal code below: public class MainActivity extends AppCompatActivity { WifiManager wifiManager; WifiBroadcastReceiver broadcastReceiver; Context context; @Override protected void onCreate(Bundle savedInstanceState) {

Why can't I detect a wifi SSID with unicode characters on Android?

让人想犯罪 __ 提交于 2020-01-15 05:38:08
问题 I have a wifi AP with an SSID that's a string of unicode characters (ex: "ԱԲԳԴԵԶԷԸԹԺԻԼ") that I want my Android device to connect to. When my device (Nexus One) detects the hotspot, the SSID looks like this: "܍܍܍܍܍܍܍܍" and does not recognize it. Any idea how to fix this? 回答1: I've wrote an app "WiFi Connection Manager" to fix this problem. However, I don't understand any Armenian, so that the result may not be displayed correctly. You can still connect to the Access Point even if the names

Always getting -1 in adding new wifiConfiguration to the wifiiManager

空扰寡人 提交于 2020-01-13 11:24:07
问题 I am creating a list of in-range wifis and show it to the user. I want to the user can select each of the items in the list and insert the password in order to connect to the selected SSID. I wrote this method for wifi connection: private WifiConfiguration wifiConf; /* WifiConfiguration object */ private WifiManager wifiMgr; /* WifiManager object */ private WifiInfo wifiInfo; /* WifiInfo object */ public boolean connectToSelectedNetwork(String networkSSID, String networkPassword, String

Get Android DhcpInfo connected via Ethernet

时光总嘲笑我的痴心妄想 提交于 2020-01-12 02:19:16
问题 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