How to check if the phone is connected to the Internet

to check whether your phone is connected to the Internet, use the following code:
ConnectivityManager con=(ConnectivityManager)getSystemService(Activity.CONNECTIVITY_SERVICE);
boolean wifi=con.getNetworkInfo(ConnectivityManager.TYPE_WIFI).isConnectedOrConnecting();
boolean internet=con.getNetworkInfo(ConnectivityManager.TYPE_MOBILE).isConnectedOrConnecting();

these lines check for internet connection whether it is through WiFi or Mobile Internet.

you need to add the following permission to the AndroidManifest.xml file
<uses-permission android_name="android.permission.ACCESS_NETWORK_STATE" />

Another method is what our freind Kevin mentioned in the comments, is to check if a certain website is reachable or not like this:
public static boolean isOnline() {
try {
InetAddress.getByName("google.ca").isReachable(3);
return true;
} catch (UnknownHostException e){
return false;
} catch (IOException e){
return false;
}
}

we check if a site is reachable within a certain timeout or not.
Read More..

How to make PC to Phone Calls For Free

Do you want to save money in this economy? Are you sick of paying expensive telephone bills? Are you looking for a way to decrease the price for your phone bills? Do you want a free phone service?-A lot of telephone companies charge overwhelmingly expensive prices for telephone service. Fortunately, there ways you can call people without having to pay. Thus, the primary purpose of this article is to show you how to make free phone calls from pc to phone.

Instructions

Things Youll Need:

  • Internet Connection
  1. Step 1

    Step 1- Download Mediaring talk

    Mediaring talk is a quasi-freeware program that basically allows you to make free phone calls from pc to phone. All you need is internet connection, and you will be able to dial pc to phone calls. To download Mediaring talk, go to mediaringtalk.com.


    Next, sign up and create and account. Once you have created an account, you will be able to download the software. Thereafter, install the program to your computer.

  2. Step 2

    Step 2- Install Mediaring talk

    The installation process is pretty straightforward. All you have to do is execute the setup and install it your computer

  3. Step 3

    Step 3- Using Mediaring talk

    After installing the program, open it and login. After logging in, you will be able to make unlimited pc to phone calls. In addition to be able to make free pc to phone calls, you can also make pc to phone international calls for free. However, you can only make international pc to phone calls to limited countries.

Read More..

Blog Archive

Powered by Blogger.