connecting ESP-8266 to Android

rupak426
Posts: 23
Joined: Fri Apr 15, 2016 2:16 am

connecting ESP-8266 to Android

Postby rupak426 » Sun Sep 18, 2016 9:26 pm

I am trying to conenct to esp8266 through android. I tried below code on android, but not able to connect to 8266.
Can anyone help me if I am missing some configuration related to 8266.

SSID = "\"" + networkInfo.name + "\"";
password = getPassword(networkInfo.name);
wifiConfiguration.preSharedKey = "\"" + password + "\"";
wifiConfiguration.allowedKeyManagement.set(WifiConfiguration‌​.KeyMgmt.WPA_PSK);
wifiConfiguration.allowedProtocols.set(WifiConfiguration.Pro‌​tocol.WPA);
netid = wifiManager.addNetwork(wifiConfiguration);
wifiManager.enableNetwork(netid, true)
wifiManager.reconnect();

thanks,

milesstone
Posts: 12
Joined: Mon Apr 26, 2021 4:50 pm

Re: connecting ESP-8266 to Android

Postby milesstone » Wed Jun 02, 2021 8:41 pm

you can try this -> Really simple TCP client I have doing my android server according this GBWhatsApp manual and all is work OK

User avatar
Openair
Posts: 1
Joined: Thu Jun 03, 2021 2:38 pm
Location: Zhopinsk
Contact:

Re: connecting ESP-8266 to Android

Postby Openair » Thu Jun 03, 2021 3:29 pm

Try like this:
WifiManager wifiManager = (WifiManager) context.getApplicationContext().getSystemService(Context.WIFI_SERVICE);
WifiInfo wifiInfo = null;
if (wifiManager != null)
wifiInfo = wifiManager.getConnectionInfo();
String ssid = null;
if (wifiInfo != null)
ssid = wifiInfo.getSSID(); /*you will get SSID <unknown ssid> if location turned off*/
any drawings to order, 3D modeling https://kompaswork.ru

Who is online

Users browsing this forum: No registered users and 1 guest