If that fails, it is possible to get your external IP address by contacting an external service.
However, it is worth asking yourself whether the mobile address would be any use to you.
What do you want to do with it?
If you are connected by WiFi, that will be the external IP of your router.
If you are only connected by phone data, it will be the ip address of your phone connection.
var ip
function OnStart()
{
lay = app.CreateLayout( "linear", "VCenter,FillXY" );
txt = app.CreateText( "Checking" );
lay.AddChild( txt );
app.AddLayout( lay );
getIpAddress();
}
function getIpAddress()
{
app.HttpRequest( "GET",
"http://bot.whatismyipaddress.com",
"/",
"",
HandleReply,
"" );
}
function HandleReply( error, response )
{
if(error) txt.SetText("failed");
else txt.SetText(response);
}
var s = app.GetEnv( "PATH" );
app.ShowPopup(s);
It is not normally useful in most DroidScript apps.
If you need it, you will probably know that you need it.