Click here to Skip to main content
       

Mobile

 
QuestionConnect commercial printer with android [modified] Pinmemberkaushik24026-Apr-12 20:19 
AnswerRe: Connect commercial printer with android Pinmembernathadale14-Apr-12 18:32 
QuestionWindows Mobile Phone question PinmemberBamaco25-Apr-12 9:10 
QuestionProblem binding to ItemSource in WP7 Pinmembernitin_ion1-Apr-12 22:48 
AnswerRe: Problem binding to ItemSource in WP7 Pinmemberyukie_all2-Apr-12 15:40 
AnswerRe: Problem binding to ItemSource in WP7 Pinmembernitin_ion2-Apr-12 22:40 
Questionmillennial ads is not working in windows phone 7 XNA Games Pinmemberashishguptajhansi28-Mar-12 2:14 
QuestionGetting the Signal Strength of wifi access points in Android Pinmemberprajnavantha26-Mar-12 3:10 
I am trying to get the signal strength info from the all the available wifi access points but it doesnt work... Its always returning some null exception it seems. I tried to run it in mobile also but its not working. I have pointed out the line which is creating error by placing a comment in bold.
 

package a.c;
 

import java.util.ArrayList;
 
import java.util.List;
 

 
import a.c.WifiActivity.WifiReceiver;
 
import android.app.Activity;
 
import android.content.BroadcastReceiver;
 
import android.content.Context;
 
import android.content.Intent;
 
import android.content.IntentFilter;
 
import android.net.wifi.ScanResult;
 
import android.net.wifi.WifiManager;
 
import android.os.Bundle;
 
import android.widget.TextView;
 
import android.widget.Toast;
 

 
public class WifiActivity extends Activity {
 
private WifiManager mainWifi;
 
private WifiReceiver receiverWifi;
 

 
TextView sig;
 
/** Called when the activity is first created. */
 
@Override
 
public void onCreate(Bundle savedInstanceState) {
 
super.onCreate(savedInstanceState);
 
setContentView(R.layout.main);
 
mainWifi = (WifiManager) getSystemService(Context.WIFI_SERVICE);
 
receiverWifi = new WifiReceiver();
 
registerReceiver(receiverWifi, new IntentFilter(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION));
 

 
}
 
class WifiReceiver extends BroadcastReceiver {
 
public void onReceive(Context c, Intent intent) {
 
List wifiList = mainWifi.getScanResults();
 
for (int i = 0; i < wifiList.size(); i++) {
 
ScanResult scanResult = wifiList.get(i);
 
[b]// I have to put a try catch block here otherwise it returns an exception.[/b]
 
try{
 
sig.append(scanResult.level+";");
 
}
 
catch(exception e){}
}
}

 
}
}
 

 
Can anyone help me with the code. I dont know what to do to get the signal strength info from the access points.There are access points nearby but im not able get the strength.If anyone could provide the code or any help then i would be thankful. Note: I have added the required permission to access wifistate in the manifest also so its not a problem there.
AnswerRe: Getting the Signal Strength of wifi access points in Android PinmemberRichard Andrew x6426-Mar-12 10:55 
GeneralRe: Getting the Signal Strength of wifi access points in Android Pinmemberprajnavantha26-Mar-12 21:20 
QuestionWhiteboard for Windows Phone 7 Pinmembernitin_ion23-Mar-12 0:21 
AnswerRe: Whiteboard for Windows Phone 7 PinmemberRichard Andrew x6426-Mar-12 10:52 
QuestionBuild IOS Application using Flash Builder & Flex SDK Pinmemberpathblocker20-Mar-12 14:17 
Questiondevelop applications for iPhone without Mac PinmemberNadji DINGAMNODJI20-Mar-12 13:36 
AnswerRe: develop applications for iPhone without Mac Pinmemberpathblocker20-Mar-12 14:09 
AnswerRe: develop applications for iPhone without Mac PinmemberKashyap Goradiya27-Mar-12 19:44 
Questionjava applet source code of donkey kong Pinmemberbuisiwemad@gmail.com15-Mar-12 22:41 
AnswerRe: java applet source code of donkey kong PinmvpRichard MacCutchan15-Mar-12 23:50 
QuestionAccess the HTML document in a webbrowser control in CE5/6 with compact framework Pinmemberrwal90115-Mar-12 10:29 
SuggestionHow to start Mobile Application Pinmembershanmugarajaa12-Mar-12 19:59 
GeneralRe: How to start Mobile Application Pinmemberparths12-Mar-12 20:59 
GeneralRe: How to start Mobile Application Pinmembershanmugarajaa12-Mar-12 21:13 
GeneralRe: How to start Mobile Application PinmvpRichard MacCutchan12-Mar-12 23:29 
GeneralRe: How to start Mobile Application Pinmemberparths13-Mar-12 6:03 
GeneralRe: How to start Mobile Application PinmemberRobCroll13-Mar-12 14:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web03 | 2.8.140827.1 | Last Updated 27 Aug 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid