Using WiFi API

Forums » Android - Examples > Using WiFi API
November 18, 2009 12:19:54 PM PST (3 years ago). Seen 116,443 times. 49 replies.
Photo Marko Gargenta
@MarkoGargenta
Marakana, Inc.
Member since Jan 19, 2007
Location: San Francisco
Forum Posts: 227
Android comes with a complete support for the WiFi connectivity. The main component is the system-provided WiFiManager. As usual, we obtain it via getSystemServices() call to the current context.

Once we have the WiFiManager, we can ask it for the current WIFi connection in form of WiFiInfo object. We can also ask for all the currently available networks via getConfiguredNetworks(). That gives us the list of WifiConfigurations.

In this example we are also registering a broadcast receiver to perform the scan for new networks.


WiFiDemo.java
Code:

package com.example;

import java.util.List;

import android.app.Activity;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.IntentFilter;
import android.net.wifi.WifiConfiguration;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

public class WiFiDemo extends Activity implements OnClickListener {
private static final String TAG = "WiFiDemo";
WifiManager wifi;
BroadcastReceiver receiver;

TextView textStatus;
Button buttonScan;

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

// Setup UI
textStatus = (TextView) findViewById(R.id.textStatus);
buttonScan = (Button) findViewById(R.id.buttonScan);
buttonScan.setOnClickListener(this);

// Setup WiFi
wifi = (WifiManager) getSystemService(Context.WIFI_SERVICE);

// Get WiFi status
WifiInfo info = wifi.getConnectionInfo();
textStatus.append("\n\nWiFi Status: " + info.toString());

// List available networks
List<WifiConfiguration> configs = wifi.getConfiguredNetworks();
for (WifiConfiguration config : configs) {
textStatus.append("\n\n" + config.toString());
}

// Register Broadcast Receiver
if (receiver == null)
receiver = new WiFiScanReceiver(this);

registerReceiver(receiver, new IntentFilter(
WifiManager.SCAN_RESULTS_AVAILABLE_ACTION));

Log.d(TAG, "onCreate()");
}

@Override
public void onStop() {
unregisterReceiver(receiver);
}

public void onClick(View view) {
Toast.makeText(this, "On Click Clicked. Toast to that!!!",
Toast.LENGTH_LONG).show();

if (view.getId() == R.id.buttonScan) {
Log.d(TAG, "onClick() wifi.startScan()");
wifi.startScan();
}
}

}


The WiFiScanReceiver is registered by WiFiDemo as a broadcast receiver to be invoked by the system when new WiFi scan results are available. WiFiScanReceiver gets the callback via onReceive(). It gets the new scan result from the intent that activated it and compares it to the best known signal provider. It then outputs the new best network via a Toast.

WiFiScanReceiver.java
Code:

package com.example;

import java.util.List;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.net.wifi.ScanResult;
import android.net.wifi.WifiManager;
import android.util.Log;
import android.widget.Toast;

public class WiFiScanReceiver extends BroadcastReceiver {
private static final String TAG = "WiFiScanReceiver";
WiFiDemo wifiDemo;

public WiFiScanReceiver(WiFiDemo wifiDemo) {
super();
this.wifiDemo = wifiDemo;
}

@Override
public void onReceive(Context c, Intent intent) {
List<ScanResult> results = wifiDemo.wifi.getScanResults();
ScanResult bestSignal = null;
for (ScanResult result : results) {
if (bestSignal == null
|| WifiManager.compareSignalLevel(bestSignal.level, result.level) < 0)
bestSignal = result;
}

String message = String.format("%s networks found. %s is the strongest.",
results.size(), bestSignal.SSID);
Toast.makeText(wifiDemo, message, Toast.LENGTH_LONG).show();

Log.d(TAG, "onReceive() message: " + message);
}

}


The layout file for this example is fairly simple. It has one TextView wrapped in a ScrollView for scrolling purposes.

/res/layout/main.xml
Code:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent">

<Button android:layout_width="wrap_content"
android:layout_height="wrap_content" android:id="@+id/buttonScan"
android:text="Scan"></Button>
<ScrollView android:id="@+id/ScrollView01"
android:layout_width="wrap_content" android:layout_height="wrap_content">
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content" android:id="@+id/textStatus"
android:text="WiFiDemo" />
</ScrollView>

</LinearLayout>


For the AndroidManifest.xml file, just remember to add the permissions to use WiFi:
Code:
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />


The final application looks like this:


Source Code
/static/tutorials/WiFiDemo.zip

Edited 20 times. Last edit by Rajiv Hemraz on May 17, 2011 at 10:54:15 PM (about one year ago).
March 7, 2010 4:40:53 AM PST (3 years ago)
Photo Isaiah Williams
Student
Member since Mar 7, 2010
Forum Posts: 3
Hey Marko Great Tutorial the Only problem is that for some reason using your code as an example I am unable to view any of the network information,

No SSID BSSID Also Display Incorrect MAC ADDRESS Supplicant State states UNINITIALIZED
RSSI: -200

Could you please assist me in whats going wrong here.
Im Running it on Android FW 1.6

Thanks
Isaiah
March 7, 2010 4:42:11 AM PST (3 years ago)
Photo Isaiah Williams
Student
Member since Mar 7, 2010
Forum Posts: 3
Im Just looking for a more stripped down version of this to just show the Network Name Basically.
March 7, 2010 4:50:53 PM PST (3 years ago)
Photo Marko Gargenta
@MarkoGargenta
Marakana, Inc.
Member since Jan 19, 2007
Location: San Francisco
Forum Posts: 227
The WifiConfiguration object does hold that information. Now, I'm not sure why you are not seeing that in there. Note that this doesn't work on the emulator very well. If you are running on physical phone, try to get the WifiConfiguration from ScanResults, so it's refreshed.
March 7, 2010 9:24:56 PM PST (3 years ago)
Photo Isaiah Williams
Student
Member since Mar 7, 2010
Forum Posts: 3
I was running the code on HTC G1 Andorid version 1.6. Not on an emulator.
ill give your suggestion a shot and see what i get.

Thanks for the help and example.
Isaiah
March 8, 2010 5:34:59 PM PST (3 years ago)
Photo Gu Cong
ICT
Member since Mar 8, 2010
Forum Posts: 2
Hello Marko,this is very useful to me.And I have a question is , as far as i know, the minimum value of RSSI is -100. -200 is the RSSI you get from searching?
March 9, 2010 5:43:53 AM PST (3 years ago)
Photo Marko Gargenta
@MarkoGargenta
Marakana, Inc.
Member since Jan 19, 2007
Location: San Francisco
Forum Posts: 227
Yes, I'm getting -200 from RSSI when running on my G2. Emulator values should be ignored.
March 10, 2010 4:14:37 AM PST (3 years ago)
Photo Gu Cong
ICT
Member since Mar 8, 2010
Forum Posts: 2
Thanks a lot for your answer.Now I have the same problem as Isaiah's.I ran the code on the emulator with Android version 1.6 only to find nothing but

WIFI Status:SSID<none>,BSSID:<none>,MAC:<none>,Supplicant state:UNINITIALIZED,RSSI:-200,Link speed:
-1,Net ID:-1

My computer has connectd to Internet with wifi.Is there anything others need to be set in the Properties of Eclipse?Or it's only just as what you said,this doesn't work on the emulator very well?
April 5, 2010 4:52:51 AM PDT (3 years ago)
Photo Avi Cohen
avicohen33
Member since Apr 5, 2010
Forum Posts: 4
i tried to run the code on emulator of android 1.5. I saw you wrote that it may not work on emulator, does wifi work on emulator at all or i'm just waisting my time?


thanks
April 5, 2010 5:03:21 AM PDT (3 years ago)
Photo Marko Gargenta
@MarkoGargenta
Marakana, Inc.
Member since Jan 19, 2007
Location: San Francisco
Forum Posts: 227
You should really test this on a real device. On the emulator, network connection is all the same, regardless if it comes from netwrok or wifi, it's really your PCs network stack.
May 20, 2010 12:19:55 AM PDT (3 years ago)
Photo Praveen Thota
SISO
Member since May 20, 2010
Forum Posts: 1
If i want to test WIFI on Emulator not on real device, what are the code changes which needs to done.
May 20, 2010 8:01:18 AM PDT (3 years ago)
Photo Marko Gargenta
@MarkoGargenta
Marakana, Inc.
Member since Jan 19, 2007
Location: San Francisco
Forum Posts: 227
It is tricky to test on the emulator, as it's TCP stack is all the same, and just a passthrough to your PC. I'd recommend using real device when it comes to Sensors, WiFi, Location, and such.
May 20, 2010 8:39:08 AM PDT (3 years ago)
Photo Syed Agha
None
Member since May 20, 2010
Forum Posts: 6
i want to know that the application will return the list of the pre configured wifi networks stored in the mobile or will scan for new available wifi networks?
May 20, 2010 8:43:25 AM PDT (3 years ago)
Photo Syed Agha
None
Member since May 20, 2010
Forum Posts: 6
sorry if my last question sounds stupid , but i am new in android and i want to scan the wifi networks anywhere
May 20, 2010 3:19:09 PM PDT (3 years ago)
Photo Marko Gargenta
@MarkoGargenta
Marakana, Inc.
Member since Jan 19, 2007
Location: San Francisco
Forum Posts: 227
It will scan. You should look at the SDK documentation.
May 25, 2010 3:50:05 PM PDT (2 years ago)
Photo Syed Agha
None
Member since May 20, 2010
Forum Posts: 6
hallo markana. thx for the application. but the problem is , when i run it on device it says that networks found but it does't display their name fully. it display one or two networks that are preconfigured. can u please help me?
August 4, 2010 9:47:31 PM PDT (2 years ago)
Photo Vivek Asohan
Member since Aug 4, 2010
Forum Posts: 1
can i able to get signal strength value?
August 29, 2010 11:27:03 AM PDT (2 years ago)
Photo Son Nguyen Dai
Home
Member since Aug 29, 2010
Forum Posts: 2
Hi Marko Gargenta,

I'm a newbie on Android. Please tell me what APIs to build applications that make my Android device (Nexus one) to tether or can use it as a mobile hotspot.

If there is no API that support to do this task. Please tell me what technique/mechanism exits at this point to manage all connections (by my own program) from "Portable Wi-Fi Hotspot".
Where "Portable Wi-Fi Hotspot" is described in the link below:

http://techcrunch.com/2010/05/13/exclusive-google-to-add-tethering-wifi-hotspot-to-android-2-2-froyo/

Please help me.
Thank you.
Please forgive for my bad english !

Edited 2 times. Last edit by Son Nguyen Dai on Aug 29, 2010 at 11:32:56 AM (about one year ago).
October 24, 2010 10:32:53 PM PDT (2 years ago)
Photo Bala Krishnan
Android
Company
Member since Oct 24, 2010
Forum Posts: 2
HI

After connecting the device using WiFi ..how to transfer data between the two devices


Thanks
December 30, 2010 8:28:53 PM PST (2 years ago)
Photo Mohsin Raza
Touchstone Communications
Member since Dec 30, 2010
Forum Posts: 1
its really helpful for me as i am doing my final year degree project on android. i was wandering for this example.Thanks.........
January 6, 2011 5:51:26 AM PST (2 years ago)
Photo Xiang He
Wipro
Member since Jan 6, 2011
Forum Posts: 1
Hello!Marko Gargenta!
I have a question.
when I have found wifi access points, but how to connect the access points?
January 13, 2011 2:10:12 AM PST (2 years ago)
Photo Sumeet Panchal
TCS
Member since Jan 9, 2011
Forum Posts: 1
i need some help..........
i need a android program that scans for wifi and returns the ip address of the devices connected to it(means to wifi).
so if anybody can help and suggest me anything
thanks in advance........
March 19, 2011 3:40:56 AM PDT (2 years ago)
Photo Krishnan B
Mind Dots
Member since Mar 19, 2011
Forum Posts: 1
hi Marko,

i have a task to connect my andriod mobile and dlna enabled device,then transfer the data(image or audio,video) from mobile to that dlna device (like mobile as server).
can you guide me to do..
May 17, 2011 10:54:15 PM PDT (2 years ago)
Photo Rajiv Hemraz
Student
Member since May 17, 2011
Forum Posts: 1
Hi Marko,
I wanted to thank you for giving such a great tutorials about wifi in android.
I have a question....

Is it possible to connect 2 android emulator found on 2 different computer using wifi... please if possible do reply me as soon as possible... very urgent....

Thanks...
June 21, 2011 1:21:34 PM PDT (one year ago)
Photo Olga Ryzhikova
Logical Design
Member since Jun 17, 2011
Forum Posts: 1
Thanks, Marko! You made my day! : ) For some reason, however, the following error occurs on attempt to quit the application (when I press the back button) on my android 2.2:

"Sorry! The application WiFiDemo (process com.example) has stopped unexpectedly. Please try again".

Any clues what can be the reason?
The other thing I still did not figure out, if the application is able to read the mac address of all available networks, or only of the one it is currently connected to? Here I have only one network and can not test...

Any help is greatly appreciated!

Have a good day!
Olga
September 11, 2011 6:16:10 PM PDT (one year ago)
Photo Hameed Ham
Johor , Skudai, Malaysia
UTM
Member since Sep 11, 2011
Forum Posts: 1
..
Edited one time. Last edit by Hameed Ham on Sep 12, 2011 at 11:53:37 PM (about one year ago).
September 18, 2011 8:17:01 AM PDT (one year ago)
Photo Spec Pro
Specpro
Member since Sep 18, 2011
Forum Posts: 2
Thanks for sharing the code Marko. The app is telling me that my_adhoc_network is the strongest but I don't see the info for that device in the list. Can your app show details of adhoc networks as well? Or only APs that were successfully connected to before? Thanks for your help in advance.
September 30, 2011 11:09:40 AM PDT (one year ago)
Photo Lily Lu
BCIT
Member since Aug 18, 2011
Forum Posts: 5
Thanks for the demo, Marko.
I downloaded your zip file, imported it into my workspace, uploaded onto the phone, and it would work well for 5-10 minutes. After that, I get this:

ERROR/AndroidRuntime(31721): android.app.SuperNotCalledException: Activity {com.example/com.example.WiFiDemo} did not call through to super.onStop()

I think you are missing "super.onStop();" in onStop.
@Olga: this is what you have to add.
Edited one time. Last edit by Lily Lu on Sep 30, 2011 at 11:12:31 AM (about one year ago).
October 7, 2011 2:28:19 PM PDT (one year ago)
Photo JOSE JUNIOR
ESTUDENT
Member since Oct 7, 2011
Forum Posts: 1
how do I connect to a wifi network available? is like sending a tutorial as I do, thank you
November 16, 2011 10:22:59 AM PST (one year ago)
Photo Tom Gaeta
Nessuna
Member since Nov 16, 2011
Forum Posts: 1
HI

I'm sorry for my bad english.
I'm see your android project, and In the main.xml file ,I found a "GRAPHICS LAYOUT".
How I can activate it??

thanks

tom
November 20, 2011 4:38:19 AM PST (one year ago)
Photo Osan Jhi
Personal
Member since Nov 20, 2011
Forum Posts: 2
hi,
i m new in android world. can you please let me know, how did u upload that in mobile? did u export the program as android application from emulator and install it in mobile? or else?
November 20, 2011 4:47:47 AM PST (one year ago)
Photo Osan Jhi
Personal
Member since Nov 20, 2011
Forum Posts: 2
hi Markan,
first of all so many thanks for the codes.
i m new in android world. can you please let me know, how did u upload that in mobile? did u export the program as android application from emulator and install it in mobile? or else?
when I am trying to run the code in my oc then I am getting this message.
"Failed to install *.apk on device 'eulator-5554': device not found"

and when I export from eclips as "android application" and trying to install in Virtural android environment, I am getting message "persing problem" at the installation time. can please help me out?

if its impossible to run without a real device, what needs the android OS version in that real device?
Thanks
January 27, 2012 5:06:04 AM PST (one year ago)
Photo Dilip Tilwani
Student
Member since Jan 27, 2012
Forum Posts: 1
How to get Wifi connection History ..??

Is there any way or have you any code related to this then please send me that code..

Thank you..
January 30, 2012 10:54:43 AM PST (one year ago)
Photo Amit Rana
Aaa
Member since Jan 30, 2012
Forum Posts: 1
I want to make same in to java any available jar or library is there or code that you can suggest . i make a desktop application with wifi to find, join & create wifi server..
plz.. help..
February 2, 2012 3:20:53 PM PST (one year ago)
Photo Sail Nathan
Home
Member since Feb 2, 2012
Location: Harrow
Forum Posts: 1
Hi Markan,

I think to develop android based mobile application to my BSc project. The project abstract is below,

This is android based mobile tracking system to track student for a college. A mobile phone finds another mobile user in a building using wireless technology. This is a main concept to develop the application. This application based on Android operating system. An android application allows tracing a person in a building with wireless technology. For example my friend has a mobile phone with wireless compatibility as well as I have a same mobile phone. I need to find my friend where is he now? For that I use android application in my mobile to track my friend. For example we say building has four floors, each floor has wireless router (hotspot), and each wireless router has rang of IP addresses. Each IP range of each router has saved with floors number in source mobile phone database, according that the source mobile synchronies with another phone through wireless router. Suppose my friend move to one floor to another, his mobile phone will try to connect nearest wireless router, if connection takes place successful the source mobile will check each router about any mobile devices connect with routers. If result will successful the source mobile phone will check IP range of connect phone with mobile database that are belongs to which floor. Suppose my friend is in floor 2 then his mobile phone will connect floor 2 wireless router. The router has particular IP range according the IP range the source mobile check that IP ranges which are belongs to which floor then it retrieve the floor number on source mobile phone screen.

Please tag piece of android code and help me to finish my project successful.
February 14, 2012 12:51:49 AM PST (one year ago)
Photo Salik Satti
biginner in android
comsats wah
Member since Feb 14, 2012
Forum Posts: 2
hii...
m a biginner in android world. i m doing my bacelor project of location tracking of a mobile in a connect ad hoc network using non-GPS method such as throuh AOL,TOA, or RSSI. and i m using the RSSI to find the distance of a mobile its not accurate though but still i think it works for my level at least.
through using this WIfi API i hav found the connected network infor. but how can i find the RSSI of a mobile which is connected to my mobile using my mobile as AP (through tethering and portable hotsots featue). i m using the samsung glaxy gio gt-s5660.

please if anyone can help me............
February 27, 2012 3:48:36 AM PST (one year ago)
Photo Sandeep Sharma
IMP
Member since Feb 27, 2012
Forum Posts: 1
hii.. I am new in android .I want to just calculate the signal to noise ratio of link of wifi , I have no idea ,how to calculate the snr ratio .I have only to things one is : RSSI and another one is Link Speed .with using that thing ..how we calculate the snr ratio of a particular link of wifi in android ...

Please reply me as soon as possible ....

February 27, 2012 11:00:30 PM PST (one year ago)
Photo Salik Satti
biginner in android
comsats wah
Member since Feb 14, 2012
Forum Posts: 2
hii........
great tutorial......
but i think there is a WifiInfo using which we can find the rssi and also ssid .....
this work for only AP directly connected ,...... is there any way through which i can find the rssi of a mobile connected in a adhoc network and at a multihop distance..... what should i do for this .............. is there any protocol or algorithem i should use or something else......
thanx if any one could guide me ......... i'll be thankfull...........
March 9, 2012 3:01:39 PM PST (one year ago)
Photo Dai Anh Tai
Home
Member since Mar 9, 2012
Forum Posts: 3
Hello .
Can you upload full sourcecode android wifi chat .
Thank you
March 10, 2012 12:32:02 PM PST (one year ago)
Photo Mohammed Raes
Annonymous
Member since Mar 10, 2012
Forum Posts: 1
Hello Marko.
I have a question.I am developing an app for car pooling.My app uses sql server for db which is located on my laptop stored on localhost.Now when i run my app on my emulator it works fine .But i would like to attempt running it on my device.But the issue since each time a db acces occurs my app acceses via a jsp file stored on localhost. So in short i need to know the alteration required in the code for this .Specifically i need to be able to connect to an adhoc n/w setup on my laptop and use it to access the db .I f required i will post my code for the db access.Please mention if code is required .Please asap as this is a project i have a deadline on .Thank you.
March 30, 2012 12:47:13 AM PDT (one year ago)
Photo Shubham Patni
S F
Member since Sep 12, 2011
Forum Posts: 3
How to get broadcast in application if I start and stop wifi from setting screen.

April 16, 2012 2:36:47 AM PDT (one year ago)
Photo Dai Anh Tai
Home
Member since Mar 9, 2012
Forum Posts: 3
Mr Marko Gargenta just died, hu hu...
May 4, 2012 12:59:32 AM PDT (one year ago)
Photo Nikola Mitrovic
Free
Member since May 4, 2012
Forum Posts: 2
Hello Marko, great tutorial, but i would like to ask if you could post code about WiFi chat i really need it, or just some part of it... Post it here or send me to nikkolica@gmail.com

thanks in advance
May 4, 2012 1:18:46 AM PDT (one year ago)
Photo Nikola Mitrovic
Free
Member since May 4, 2012
Forum Posts: 2
Hey, i saw your comment, so i wanted to ask if you have found anything usefull about Android WiFi chat?

greetings
June 9, 2012 12:29:08 AM PDT (49 weeks ago)
Photo Dai Anh Tai
Home
Member since Mar 9, 2012
Forum Posts: 3
Hey.
Can you sell for me full sourcecode android wifi chat ?
my email : daianhtai2007@gmail.com
Thanks.
June 20, 2012 7:07:02 AM PDT (48 weeks ago)
Photo James Wakefort
Infotech
Member since Jun 20, 2012
Forum Posts: 1
How do i create a .txt file of the scan results(details such as ssid, etc)??
Plzzz help me out!!

P.S: Thanks a ton for the valuable code...
August 1, 2012 3:17:33 PM PDT (42 weeks ago)
Photo Steve Jardine
CDM Data
Member since Aug 1, 2012
Forum Posts: 1
I have an Android tablet that is connecting to an AP sucessfully. I am seeing:
WIFI Status:SSID ap_name,BSSID:ap_bssid,MAC:<none>,Supplicant state:COMPLETED,RSSI:-200,Link speed:-1,Net ID:0.

I do have a valid MAC ID, and signal value on the tablet from the linux side. Any idea why the RSSI would stay at -200, and the MAC ID is not there?

On the about:phone status app I get a signal strength of 0 dBm and 0 asu and unavailable for the MAC address. Ideas??
April 2, 2013 7:50:45 AM PDT (7 weeks ago)
Photo Ishant Gaurav
Student
Member since Apr 2, 2013
Forum Posts: 1
Hey
this code is not working for . Everytime i run it directly gives me the error "Your application has stopped working ". Can u please help me why it is shwoing so . Plz reply as soon as possible its urgent
April 28, 2013 9:41:38 PM PDT (3 weeks ago)
Photo Iwan Flamenggo
Poltek
Member since Apr 28, 2013
Forum Posts: 1
how to connect to the strongest wifi based scanning.??
May 6, 2013 12:04:16 AM PDT (2 weeks ago)
Photo Kevin Rake
OX Mobile Spy-Spy appliaction on Mobile Phone
OX
Member since May 5, 2013
Forum Posts: 1
How to Find A Lost Phone?

Have you ever lost your mobile phone which contains important contacts, important meeting records or other information? Or your cell phone was stolen? Have you imaged that you can retrieve your cell phone? This spy mobile phone tracking program embedded GPS location system can trace the exact place where your phone lost, learn who picked up and call history to find thief clues.

Even have you ever fell your mobile phone into water without care and without backup contacts and messages, and have not enough time to save contacts, so it is important to backup information on mobile phone in case of lost or damage.

Spy mobile phone software is a free download and trial version program, which can assist users to offer clues and then find a lost phone. Just get access to the email you set before, you will see the call history logs, contacts book, sms, and gps location with exact latitude, faithful and practical.

You can try this function is very powerful OX Mobile Spy software

http://download.cnet.com/OX-Mobile-Spy/3000-2162_4-75909600.html