Ricoh Theta Android app connection issue using Android API 29

Using an Android device I connect to the Theta camera to shoot 360 photos. Till API level 28, our existing code works fine, but with the new API 29, wifi(hotspot) connection functions are deprecated and with the new NetworkSpecifier function, I can connect to the device; but I can’t not make any API request to the Theta camera.

Like GET request always fail, even in mobile web-browser.
Error Message:

Caused by: failed to connect to / (port 80) from /:: (port 0) after 10000ms: connect failed: ENETUNREACH (Network is unreachable)

Here is my code snap to connect to the Theta camera.

final WifiNetworkSpecifier specifier = new WifiNetworkSpecifier.Builder()
             //.setSsidPattern(new PatternMatcher(ssid, PatternMatcher.PATTERN_PREFIX))
final NetworkRequest request = new NetworkRequest.Builder()

final ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);

final ConnectivityManager.NetworkCallback networkCallback = new ConnectivityManager.NetworkCallback() {
            public void onAvailable(@NonNull network) {super.onAvailable(network);}
            public void onUnavailable() { super.onUnavailable();}
            public void onLost(@NonNull network) { super.onLost(network);}
//connectivityManager.registerNetworkCallback(request, networkCallback);
connectivityManager.requestNetwork(request, networkCallback);

As I said, i can connect to the Theta camera and my Android device wifi connection shows, ‘Connected via MyApp’. But the API’s to communicate with the device always fail. NOW, if I manually connect the device by going into my device wifi settings and select the Theta camera.

A post was merged into an existing topic: Android: Ricoh Theta connection issue using Android API 29