I am developing an app for Android with Kotlin, and I want to share the information about the current wifi network my phone is connected to; in order to connect another device to it (the information are shared by Bluetooth).
At first, I wanted to get the SSID and Password by WifiManager but it looks like the password is only accessible with root privilege.
So is there a way to share the Wifi info without accessing the password? I'm sure it should be possible because when I configure my weather station with that app, I don't need to enter the password of my network, it does everything automatically (and my phone is not rooted) :
https://play.google.com/store/apps/details?id=com.netatmo.netatmo
Also when I configure my Google Home, it's the same process, the information of my network are shared to the device.
Thanks in advance
Related
As the question says, i was wondering if there is a safe, and non really complex way to send credentials from an APP to an ESP32, in this moment i made an app that connect via bluetooth and send the credentials via serial and it works, but this way has 2 issues, 1) its not safe (not encrypted/secured data), 2) you have to ask in the application the credentials (SSID and password of the wifi) and i think it should exist some way that avoids asking for data that is already known by the smartphone. Any guidance on this topic will be welcome, thanks in advance.
all apps which are used to configure devices like IoT hardware and smart devices, ask the user to enter the wifi credentials when configuring the device, which is then transferred via Bluetooth or wifi connection,(the device acts as an access point, mobile with app connects to that devices' AP). you can save credentials one time and automate the process of sending them afterward.
I have a client that configures and deploys handheld scanners to remote locations. We have to pre-configure them to work on a local WiFi network. For these scanners we must manually configure SSID, Encrypted Password, and Encryption Type. We also need to know the Network/DHCP info (Subnet Mask, Default Gateway).
Unfortunately, we are often working with people who are not very tech savvy to provide us with their Wifi Information and they often provide us with incorrect or incomplete info.
So I'm wondering, could we write an App (or even better if there's already something that exists, though admittedly a long shot) that would prompt the User to enter the SSID and password and then would verify that it's connecting to the Access point and getting an IP Address... and then send us all of the configuration information via email (or http post? Or save it to a local file that the user could send to us?) so we can be certain we have the correct info before we ship the scanners?
In google home app, the app can connect with GoogleHome without asking password for connecting.
Even though, the app doesn't have root permission to do that. How google home can connect with device?
Short answer: you cannot access the Wi-Fi password without root access. (with root it's just stored as plain text on disk)
What Google does (I'm guessing) is to get your Wi-Fi password from your Android Phone's backup. After all, after resetting your Android phone you just have to log in to your account and you magically have your Wi-Fi passwords back.
Note: They could also be using a private API, but as that would be a security risk, my best guess is the solution above.
Note2: This is very much in line with what Apple does in their WAC set up protocol. They've provided a proprietary flow to set up "Made for iOS" devices so you don't have to ask a user for her password.
I don't have an actual answer, but had too much background data for a comment.
From this Super User answer:
Chromecast acts as an access point when first turned on.
For the initial setup, you install an app on your Android, Windows or mac device, that will find it and connect to the chromecast's AP directly. Then the chromecast scans for nearby access points, allowing you to pick one and enter in its password.
Once this is done, it will connect to that access point instead of acting as its own access point.
So the overall flow is:
You install the app
The app sees the Chromecast's access point
The app connects to the Chromecast access point (named ChromecastXXX, with random alphanumeric chars)
The Chromecast scans for nearby access points
You select your WiFi network
You either enter your password, or the mysterious wifi share happens.
Chromecast uses your WiFi network
This is api to securely transfer wifi creds from one device to another.
https://developer.android.com/preview/features#wifi-suggest
I found it in Q's arsenal of secret 007 spy tools.
AFAIK (remember) I had to enter the wifi password on the google home app and wear os when I set up.
Basically your phone and home device are connected to the same Wifi. And your phone already is successfully connected to the Wifi. So the Wifi password is kind of auto fetched while Google Home device is connecting.
Below are some hints from the Google Home setup page -
Make sure to connect your mobile device/tablet to the same Wi-Fi
network that you intend to use to set up your Google Home device.
Choose the Wi-Fi network you want to connect to your Google Home. To
automatically fetch the password for this network on this device, tap
OK. The password will populate in the password field. Note: Android L
and above is required to auto fetch the password. Tap Continue. You
can also manually enter your password. Tap Continue.
https://support.google.com/googlehome/answer/7029485?co=GENIE.Platform%3DAndroid&hl=en
I want to incorporate a wifi manager into my app to keep the flow of the app simple. I have a list of available networks from WifiManager.getScanResults. I have allowed a user to connect to a network using this code. Where I pull the SSID from the ScanResult and the password from an input TextView.
I would like to make use of the users stored wifi passwords, as can be seen in the default Android wifi manager. Is it possible to e.g. automatically connect to a network, if a stored password is available? Maybe by firing a "connect to wifi network" intent, similar to a "start Android wifi manager" intent?
I understand Android would not give out the stored passwords directly for security reasons.
I would prefer to avoid sending the user to the default Android wifi manager, but maybe that is the best solution.
I can't see anything that does what I need in the WifiManager.
you can store store the password against SSID in local database.
and check if SSID is available and its password is already is stored in the database then connect to it .
Android would not give out the stored passwords directly for security reasons.
I need to connect to a specific Wifi selected from the list and I want to hard code the password in my app.
Is it possible in android devices that an app can connect to a specific Wifi network and provide the password?
Is there an API for this?
You should check out the docs from Google: http://developer.android.com/reference/android/net/wifi/package-summary.html