Android Question running cmd using shellasync

I'm trying to get my real Public IP even if I use Proxy. After some research I found this command:

nslookup myip.opendns.com resolver1.opendns.com

This is run perfectly on cmd. I mean even if I use proxy it returns my real public IP. I tried to use shellasync to run it on B4A by below code but that is not running perfectly.
B4X:
Sub myip
    Dim p As Phone
    Wait For (p.ShellAsync("nslookup", Array As String("myip.opendns.com","resolver1.opendns.com"))) Complete (Success As Boolean, ExitValue As Int, StdOut As String, StdErr As String)
    If Success Then
        Log(ExitValue)
        Log(StdErr)
        Log(StdOut)
    End If
End Sub

I have faced these logs

1
nslookup: can't resolve 'myip.opendns.com'
Server: 208.67.222.222
Address 1: 208.67.222.222


why can't it resolve?
 
Have you ran it from the device command line?
Yes, I’m using Android emulator (bluestack) on my desktop. When I ran the code in desktop command prompt it is ok but when I use emulator to run Phone.shellasync I got that message.
Pay attention it works without error on logs or any other crash but it doesn’t return the answer which is returned by command prompt
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…