Android :: How To Scan Access Points And Select Strongest Signal?

May 13, 2010

I am currently trying to write a class in Android that will Scan for access points, calculate which access point has the best signal and then connect to that access point. So the application will be able to scan on the move and attach to new access points on the go. I have the scanning and calculation of the best signal working. But when it comes to attaching to the best access point I am having trouble. It appears that enableNetwork(netid, othersTrueFalse) is the only method for attaching to an Access point but this causes problems as from my Scan Results I am not able to get the id of the access point with the strongest signal.

This is my code:
---
public void doWifiScan(){ scanTask = new TimerTask() { public void run() { handler.post(new Runnable() { public void run() { sResults = wifiManager.scan(getBaseContext());
if(sResults!=null) Log.d("TIMER", "sResults count" + sResults.size());
ScanResult scan = wifiManager.calculateBestAP(sResults);
wifiManager.addNewAccessPoint(scan); } }); }};
t.schedule(scanTask, 3000, 30000); }
---

public ScanResult calculateBestAP(List<ScanResult> sResults){ ScanResult bestSignal = null;
for (ScanResult result : sResults) { if (bestSignal == null || WifiManager.compareSignalLevel(bestSignal.level, result.level) < 0) bestSignal = result;
} String message = String.format("%s networks found. %s is the strongest. %s is the bsid", sResults.size(), bestSignal.SSID, bestSignal.BSSID);
Log.d("sResult", message); return bestSignal; }
---
public void addNewAccessPoint(ScanResult scanResult){ WifiConfiguration wc = new WifiConfiguration();
wc.SSID = '"' + scanResult.SSID + '"';
//wc.preSharedKey = ""password""; wc.hiddenSSID = true;
wc.status = WifiConfiguration.Status.ENABLED;
wc.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.TKIP);
wc.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.CCMP);
wc.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WPA_PSK);
wc.allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.TKIP);
wc.allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.CCMP);
wc.allowedProtocols.set(WifiConfiguration.Protocol.RSN);
int res = mainWifi.addNetwork(wc);
Log.d("WifiPreference", "add Network returned " + res );
boolean b = mainWifi.enableNetwork(res, false);
Log.d("WifiPreference", "enableNetwork returned " + b );
}
---

When I try to use addNewAccessPoint(ScanResult scanResult) it just adds another AP to the list in the settings application with the same name as the one with the best signal, so I end up with loads of duplicates and not actually attaching to them. Can anyone point me in the direction of a better solution?

Android :: How to Scan Access Points and Select Strongest Signal?


Android :: Signal Strength Of Each WiFi Access Points?

Aug 9, 2010

I am building an application reading the signal strength of each available WiFi access point. I've written code like:

wifi = (WifiManager) getSystemService(Context.WIFI_SERVICE);
// Get WiFi status
WifiInfo info = wifi.getConnectionInfo();
textStatus.append(" WiFi Status: " + info.toString());
// List available networks
List<WifiConfiguration> configs = wifi.getConfiguredNetworks();

However, I have two problems:
In debugging, configs only contains one connection. However, I can see that there are several APs available in the system's wifi setting. i.e. configs is an incomplete list. I don't know how to get the signal strength in Wifi Configuration. I am using HTC Hero and Android 1.5.

View 2 Replies View Related

Android :: Connecting To Strongest WiFi Access Point

Sep 9, 2010

I have two WiFi access points in my house, due to thick walls. When I turn on my phone it searches and connects to the first access point it finds, which is not necessarily the one with the strongest signal. e.g. I have one access point on channel 10 (lounge) and another on channel 1 (bedroom). When I'm in the lounge it always connects to the A/P in the bedroom, unless I actively "forget" that network, even though the signal strength of the one in the bedroom is VERY weak. Is there a way to force it to pick the strongest A/P?

View 3 Replies View Related

Samsung Captivate :: Error Starting Wifi Scan - Or Unable To Scan For Wifi Access

Aug 16, 2010

phones worked good other then gps issue. recently after iv had the phone for 30 days it just stopped scanning for wifi access and wont turn on wifi at all.

View 3 Replies View Related

Android :: HTTP / Access Points

Aug 1, 2009

I am just a beginner in the Android and was experimenting with HTTP.I have published the result of my experimentation through the following link http://kausikdas.webs.com/apps/blog/show/1489440-http-in-android. I am yet to get a device but working with the Simulator.I need feedbacks on the possible network problems I should handle. e.g.: 1. Do I need to discover the access points and dial one before connecting? 2. How can I know which services (Data/Data & Voice/Voice/No/Emergency etc.) current network is supporting? 3. Anything more to take care of?

View 3 Replies View Related

Android :: Network Connections / Access Points

Jul 16, 2010

I have some code that uses a network connection. I create a connection by calling openConnection() on a URL object. Is there any documentation that explains how this process works? Which access point is being used? When that access point becomes invalid, will it automatically switch to another accespoint? etc. I would like to use only WiFi access points and otherwise fail even tho 3G or GPRS could be available, is that possible?

View 7 Replies View Related

Android :: Detecting Ad Hoc WiFi Access Points

Feb 9, 2009

I am developing an application on the android platform. The app performs continues WiFi scan and sends information about the list of visible access points to server. However, I need to remove all the Ad Hoc points. The android.net.wifi.ScanResult api does not seem to have any information on "mode" of the network. Is there anyway I can distinguish a given point is Ad Hoc or Master?

View 3 Replies View Related

Android :: No Automatic WiFi Handover Between Access Points

Nov 16, 2010

I have a Samsung Galaxy S, running Froyo. I have an issue with WiFi handover, so I am posting here (in addition to the SGS section) in case this is an Android issue rather than an SGS-specific issue. I have two WiFi Access Points (APs) at home, both using the same SSID, but on different channels.

I expected the SGS to automatically move (handover) from one AP to another based on signal strengths that vary depending on where I am. However, this does not happen. It stays on the AP that it is connected to, even when moving to very poor signal levels. I need to manually trigger this (e.g by disconnecting from the AP). Any configuration or Android app. By the way, I also tried configuring the APs with different SSIDs, but this didn't work either.

View 1 Replies View Related

Android :: Info About Different Networks - Access Points Under SSID

Sep 17, 2010

If I use getScanResult() I will be able to get the information about different networks but for example if I am in a school where all access points are under network (SSID) "The school". Will getScanResult() filter out other access points than the one it's closest to and only return 1 BSSID for that network?

View 2 Replies View Related

HTC EVO 4G :: WiFi Access Points With Manual Connect Only Option?

Oct 27, 2010

I think this should be simple enough but I haven't found a solution. I would like to leave my WiFi radio on. This way, the phone will automatically connect to certain access points (that I have previously connected to). However, there are certain access points that I would only like the phone to connect to if I elect to manually connect to them. I can't seem to find this setting anywhere. The only two options I have on access points once connected is to Forget network and Change password. I want it to remember those but only connect when I manually tell it to.

View 6 Replies View Related

General :: WiFi Access Points Enable Sync

Aug 21, 2013

I moved from Galaxy S4 to Galaxy Note 2.

Everytime I take a new phone, during initial setup it gives me to restore my settings from Google which when I enable I get all my saved wifi-access points.

This time however by mistake I didn't allow Google to restore that data in my Note 2 so now I haven't got any saved WiFi passwords.

I had backup of all user and system data from S4 via titanium backup and I tried to restore WiFi access points in Note2 which wont work (maybe compatibility or something, I don't know)

how can i re-enable or force a re-sync that Google to restore my WiFi access points to my mobile or what can i do to get all my saved WiFi profiles back.

View 5 Replies View Related

General :: Block Settings - But Allow Adding Access Points?

Nov 13, 2013

I use an AppLocker on my daughter's phone. It works great, but there is one problem it causes.I need to keep her and others out of the settings so it's blocked. But I need to be able to allow her to add access points so she's not eating away our data plan.

Is there an App Locker that will allow this? Or is there an alternative Wifi manager that I could install and allow that would work even when settings is blocked?

View 1 Replies View Related

Motorola Droid :: Roaming Between Multiple WiFi Access Points With Same SSID?

Nov 7, 2009

Just got my hands on a Droid and now I'm working out some kinks. My iPhone and laptop have no problem roaming aggressively between multiple access points we have at work that share the same SSID. I can't seem to get the Droid to do the same thing. I've tried downloading some wifi scanners, but they don't quite cut it. Is there a setting I'm missing? The expected behavior would be for the Droid to happily associate with any AP that shares a "remembered" SSID. Right now, it requires manually going into settings and associating with each and every AP in order for it to hop automatically as I move around the building.

View 4 Replies View Related

Android :: Select WiFi Access Point?

Nov 13, 2010

I am developing one android application which select wifi access point from list of wifi. I used following code..

CODE:..............

My problem is i am not able select wifi access point..Every time it shows previous configured wifi details.

View 1 Replies View Related

Android :: Connectivity On Android / No Access Points For 3G Or GPRS

May 5, 2010

I have a couple of questions about connectivity on Android, if anyone has any insight it would be great. What is the default when an application wants to wirelessly connect? Is it WLan? And if WLan is switched off or there is no access points around is it 3G or GPRS? Is a device always ip connected? Or when its disabled from WLan or 3G does it's lose its IP address?

Is an application, for example the browser only ever connected to one IP address? Or can it be connected to multiple addresses for each radio such as GPRS or WiFi (WLan)? Can an application decide which connection to open a socket to? For example can I create an application and decide whether to connect the socket to the WLan or GPRS? Or does the OS decide? Finally how do native applications handle connectivity? In the same manner?

View 3 Replies View Related

Android :: Code For Displaying Signal Strength Of Wifi Access Point

Nov 28, 2009

I need to develop an application which scans the wifi access points and also gives their signal strength.I wrote the code for scanning the access points but I dont know what packages to use for measuring the displaying strength.Can anyone please tell me how to display the signal strength, also give me the code for that.

View 2 Replies View Related

HTC Desire :: HSPA Signal But No Internet Access

Sep 2, 2010

I have a HTC Desire on o2 pay as you go. At home I have a E signal, sometimes 3G and everything works fine. In certain areas I get a H signal which works great. Here's were my problem lies - At my workplace I get a H signal but can't gain access to the android market, browse the Internet or use Facebook etc. Has anyone else experienced the same problem or have any ideas on how to fix this?

View 5 Replies View Related

Samsung Moment :: Signal Strength Apply To Data Signal Or Just Voice Signal?

Nov 4, 2009

I want to reach out to others here before I take my Moment back to Best Buy to exchange it for another Moment.

My signal strength fluctuates wildly just sitting in the same spot. With the Hero I got a constant 5 of 6 bars, but the Moment will vary between 0 and 5 of 6 bars. But it's more complicated than that.

It seems that whenever the EVDO data kicks in, it causes the signal strength to drop to 0 or 1 bar. Once the data is idle, the EVDO indicator turns grey and then changes from EV(^v) to EV(D). At that point the single strength will return to 3 or 4 bars.

At times, though not as consistently or often, the EVDO connection will fall back to 1xRTT and will switch between them every few minutes. This will occur even when the signal strength bars are in the 3 to 4 range.

So, the my questions are...

Does the signal strength apply to the data signal or just the voice signal?

Is there any legitimate reason for the signal strength to vary wildly like I've described, even when sitting in the same recliner where the Hero had a constant 5 bar connection and data service that never wavered?

Is anyone else having signal strength and/or data service issues?

Should I exchange the Moment for another Moment or will I likely experience the same issue?

View 8 Replies View Related

Android :: Implement Select All With Multiple Select ListView In Android

Nov 2, 2010

I'm trying to implement a Select All menu item for a ListView in a ListViewActivity. The relevant parts of my ListViewActivity: public class MyListViewActivity extends ListActivity browsed around stackoverflow.com and the google; the above is something that should work. But it isn't. setSelection(i) appears to be the method I want to call on ListView but it's not working as advertised. What am I doing wrong? Is this even possible on Android in code?

View 2 Replies View Related

HTC Incredible :: Select Multiple Picture Files And Move Them To Another Folder (like "Select All" With Windows)?

May 9, 2010

New to Android and starting to work on file mgmt. I set up some subfolders on my SD card for pictures. I have been moving pictures from one folder to another, but I can only move one at a time. Is there a way to select multiple picture files and move them to another folder (like "Select All" with Windows)? This is the sequence I've been following: Use the Edit Icon in the Astro taskbar, select Move, then going to the directory folder I want to move them, and hit Paste. Moving one file at a time is taking for ever.

View 2 Replies View Related

Android : Scan / Pic To Pdf App?

Jun 16, 2010

Can't find this via a search, but am looking for opinions on any apps that will use the camera to get and image, and then create a pdf. I am not looking to do this on pictures, but rather on pages of text. I guess I can always just email a photo, but would rather it be a pdf.

I looked in the market, and found a few, all cost $, so I am writing to see if anyone will post their experience with any of these prior to me shelling out the bucks.

View 3 Replies View Related

Android :: How Do You Display Many Points On Map?

Jun 29, 2009

I understand the notion of overlays and all, but what if I want to display thousands of points on a map?The map becomes unresponsive after a few hundred OverlayItems are added.What's the best approach for doing this?

View 4 Replies View Related

Android :: Catching Points With GPS - Geo Fix

May 5, 2009

I am trying to write a code about catch lat. and long. points with the GPS, actually I am using the shell with the commands "geo fix" because the DDMS doesn't work in linux apparently, I am using this scripts:

getBestProvider(criteria, true); getLastKnownLocation(provider); requestLocationUpdates(provider, 2000, 10, locationListener);

The questions is: the program is working right now in the emulator, but what about if I move the program to the real cellphone? Is the same? I need think in something else?

View 2 Replies View Related

Android :: Get Distance Between Two Geo Points

Apr 29, 2010

I want to make a apps that check what's the nearest place from where the user is. I can easily get the location of the user and I have a list of places with latitude and longitude. What would be the best way to know the nearest place of the list against the current position. I could not find anything in the google APIs. I am worried I need to resort to my calculate and have to do math to calculate it.

View 2 Replies View Related

HTC EVO 4G :: Phone Signal - 3G Signal Horrible Same Location

Sep 25, 2010

I can get a few minutes of 4G signal at my home per day, but when it drops out and 3G takes over, the signal will flatline and boot me offline. My 3G speeds are usually around 56-150Kbps or less, and my 4G speeds are around 2.5 Mbps What would cause this ? According to WiMax location sites online, my nearest 4G tower is .52 mile away. I would think that if I actually get 4G signal, then 3G would be constant. Turning off 4G doesn't help either. Is there some setting that I could have turned off that would cause this ? Running stock EVO on 2.2 all the latest updates

View 8 Replies View Related

Android :: Neighboring Cell Signal Strengths Better Than Those For Current Cell Signal Strength?

Jan 6, 2010

I'm writing an android application that collects cell signal strengths. I am having trouble getting the "current" cell signal strength, but I don't have any problem getting the "neighboring" cell signal strengths. To get the current cell signal strength, I created a PhoneStateListener and implemented the onSignalStrengthChanged callback. It works, but not very well. It seems like the signal strength hardly ever changes, and resolution jumps to only a few numbers. I would accept the answer that the resolution of the signal strength hardware is coarse, but when I use the TelephonyManager's getNeighboringCellInfo() method, it works much better. The signal strength readings from neighboring cells change frequently, and they have much better resolution.So, how can I get the current cell signal strength in the same way that I am getting the neighboring cell strengths? It seems odd to me that the functionality of the neighboring cells is better than the current cell. Am I missing something here?I would also like to directly call a method from the telephony manager to get current cell strength, as opposed to a listener, if possible. If anyone knows how, please let me know.

View 2 Replies View Related

Android :: Adding Labels To Points On Map?

Jan 6, 2010

I'm trying to add a label to each of the points on a map that I've created. Setting the "title" and "snippet" values of the OverlayItem don't seem to automatically cause these labels to appear however. I would've thought this would be a pretty simple and common requirement. Am I missing something? Can someone tell me if there's a function that does this?

View 3 Replies View Related

Android :: Displaying Route Between Two Points On Map

Dec 6, 2009

I'm trying to develop an application which display the locations of contacts on a map (a Msn-like but for geo-localisation). I search to display a route between my own location and a contact location I want to join but I find yet no solution to do this. In the Android API and Maps add-on API I just find classes to display and listen Location, Distance, GeoPoint, etc., but no possibility to display a route between two points. Is it possible or not provided by the API?

View 7 Replies View Related

Android :: Support For More Touch Points?

May 23, 2010

Has anyone checked to see if 3 or more points will show up on an Incredible? I'm trying to see if there's hardware/driver/android support for more touch points. Why more touch points? I dunno. It could be cool for something. I read that the physical screen supports 10 but my first tests printing MotionEvent.getPointerCount() only give me 2.

View 2 Replies View Related

Android :: Want To Generate QR Scan Image

Aug 29, 2010

I wish to generate a QR image so people can scan to visit my Android market. However, I need to specify a search param like: market://search?q=MyStringHere

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved