i have create custom WiFi setting UI in android application but i am struggle to get security name like (WPA/WPA2/PSK) i.e when user click on the WiFi list item so it display network information like Status , signal strength etc. all information accessed except Security.
i have tried WIFi configuration , manager but i am not able to get exact security name please help me how to get this thing
i am attach screen shot for more understanding.
Related
I am trying to read the Preferred network type setting from the device. But nowhere android API's are available.
Use case:
Trying to read the Preferred network type and connected network type so that if the device has LTE enabled and the user is forcefully switched back to the lower network(3G,2G); then there should be a notification sent to the user.
I have checked the system setting code, But it's deprecated.
Settings.Secure.getString(getApplicationContext().getContentResolver(),
Settings.System.NETWORK_PREFERENCE);
Is there any alternate way to read the system secured settings(By reflection?).
And Also is it possible to write back the setting with the user permission?
Help is much appreciated.
I think the right code is:
Settings.Global.getString(context.getContentResolver(),Settings.Global.NETWORK_PREFERENCE)
Is there a way to get my current Wifi-Direct device name without listening to WIFI_P2P_THIS_DEVICE_CHANGED_ACTION ? If wifi is already enabled I guess I cannot receive that intent.
I'm developing an app to create a WiFi direct group and share devices locations between peers. When I open a group I need to initialize a data structure, a map in the form of ( deviceName, lastLocation) with my location. A group is created by the user when pressing a button.
You will get WIFI_P2P_THIS_DEVICE_CHANGED_ACTION when you register for the WifiP2pBroadcastReceiver, it doesn't matter if wifi is already on.
Quote
I was under the impression that wifiManager.getConfiguredNetworks() returns the PNL of the current device, however when I click on - forget network, wifiManager.getConfiguredNetworks() still keeps that network but just removes the connection details(like security, password etc.)
Is there anyway knowing which SSID(or BSSID) is actually in PNL? (i.e my device can automatically connect to it)
I found out that this problem appeared only on specifics networks, while in others clicking on forget network actually removes the network from wifiManager.getConfiguredNetworks().
I also found out that the only things different are allowedKeyManagement.cardinality and LinkProperties (which is hidden on Android), so I used an if statement on the WifiConfiguration(=configuredNetwork):
if(configuredNetwork.allowedKeyManagement.cardinality()==1)
wifiManager.removeNetwork(configuredNetwork.networkId);
wifiManager.saveConfiguration();
break;
And for some reason it worked. If anyone have an idea whats cardinality stands for or have a better way of doing this please share.
So I've research this subject and I didn't get much information, even though I did read a few threads here like Check SIM PIN with SDK Android and Ask user for SIM Card PIN but neither of them really answer the question - the app I'm trying to write is based on USSD and will run on devices with SIMCards.
I also read the thread Use system PIN dialog in Android application, but I'm not trying to overwrite the OS, I'm just trying to write a simple app that can check an entered String against the SIMCard PIN. On this last thread, a user (a.ch.) said that trying to access or even check the SIMCard PIN number is not allowed by the OS (at least without modifications, I suppose). Can you guys confirm or give me a link that mentions this prohibition?
Also, is it possible to, using only USSD, check the PIN? For example, I only know the MMI code to change PIN:
**04*Current PIN * New PIN * New PIN#.
And this actually returns fail or sucess messages, and if I make Current PIN = New PIN, I can actually identify if the PIN I introduced is correct or not, but I see this on a text message. Does the smartphone return this info in a attribute that I can check? How can I access the return code?
I need all the help I can get :)
since we can set wireless access point in android device from device settings,
then through android application i want to retrieve already set access point information like name,ip address,port number etc.Any idea/sample code/links how to do this?