-1

I am using Android Studio. I want to write code to connect router hardware. Does anybody can help? I have written code to connect router then I am facing error following. E/debug: failed to connect to /192.168.0.101 (port 60123): connect failed: ETIMEDOUT

Manibala Sinha
  • 127
  • 1
  • 3

1 Answers1

0

Your question is very generic. There are multiple approaches when you are talking to connect to a router.
If you want to perform operations as connecting to a router,listing all available networks available,creating your own network(hotspot) You should checkout the official documentation of android on WifiManager -https://developer.android.com/reference/android/net/wifi/WifiManager.html Or You can see this example -> how to get available wifi networks and display them in a list in android after you get the basic undestanding.
If you want to connect to other devices through router you should study sockets and TCP/IP protocols,Socket implementation on JAVA.
Hope this might help.
Peace

Community
  • 1
  • 1
Rohit Singh
  • 16,950
  • 7
  • 90
  • 88