How to get the ip address open spherical camera devices and check if connected or not?

You can use a third-party library FGRoute which provides a method to get the gateway IP address.

As for checking if camera is connected, you can follow these steps:

  1. Connect to the camera's Wifi network
  2. Check FGRoute.getGatewayIP() for a valid IP address
  3. If IP address is valid then send a command to the camera and check it's response

If it fails at any stage then, ofcourse, the camera is not connected.