Hi, My Java knowledge is very limited so it's quite an easy question
(probably) but how can I get the code below to work? I'm basically
trying to check that the device is connected to the internet to that I
can access and parse an RSS feed. This is also the 1st android app I
have written so I'm still finding my way around so any help/advice
would be appreciated.
I'm sure the variables should be assigned to something but I don't
know what. The classes don't appear to have public constructors so I
can't do "WifiInfo info = new WifiInfo()"
package com.Weather;
import android.net.wifi.WifiInfo;
import android.widget.Toast;
import android.telephony.TelephonyManager;
public class AirportWeather {
public AirportWeather() {
}
/**
* Check the device is connected to the internet
* @return int 1 = connected, 0 = not connected
*/
private static int checkInternetStatus()
{
WifiInfo info;
TelephonyManager data;
Toast.makeText(null, info.getNetworkId(), 200);
if(data.getDataState() == 2)
//mobile network is connected then return 1)
{
return 1;
}else if(info.getNetworkId() != 0)
{
return 1;
}
return 0;
}
}
Thanks
Steve
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---