[android-developers] Strange delays when doing wifi scans
Hi list, I have a simple app that just initiates a wifi scan every two seconds and then logs the results. I am observing some strange behaviour, and was wondering if anyone could shed some light. When I start scanning, if the phone (Nexus One running latest Froyo OTA release) is just sitting on my desk (screen on or off, it doesn't matter), I receive the wifi scan results about 800ms after initiating the scan, fairly consistently. At most, it takes a second and a half to receive the results. However, if I get up and start to walk around the building that I'm in, the time between initiating the scan and receiving the result begins to vary greatly. What is interesting is that I start to see a pattern where it will take about 40 seconds to receive results, then I will get three or four results two seconds apart, then it takes 40 seconds to receive the next set of results, then I get three or four results two seconds apart, etc. I've tried obtaining a wifilock, both the FULL and SCAN ones, and that doesn't help. Same with a partial wakelock. I've also tried setting up a thread that pings the supplicant every second and reports when it is unreachable, and it appears to always be responsive (ie., I never see the report). I thought that maybe the problem was that I am unable to receive the result of scans when I am switching between base stations (which might happen when I move around), but if I manually switch between two different networks, it does not cause a delay in my scans (ie., I can still get the results with only a one second delay while it's associating with the new network). Anyway, for my application, it would be incredibly useful to get wifi results at a fairly consistent rate, and so I was hoping that someone on this list might have some suggestions as to how I can achieve this. Thanks in advance. Cheers, Jordan -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Accelerometer not working when screen turns off
Holy crap, this again?!? I just discovered this because we ordered four Nexus Ones to do some demos of our research on the Discovery Channel. All of a sudden what was working perfectly on the G1 stopped working altogether on the Nexus One. If you read the archives of this list, you'll see that I've harped about this a lot in the past, and was delighted when it was changed in Cupcake. Now they've gone and broke it again. And I just spent hundreds shipping these things to Canada. Argggh. So Google, are you going to remain silent on this issue again, or will you let us know at the very least why this decision was made. You've pissed off a lot of developers. Not to mention that your Nexus One phone won't be featured on the Discovery Channel bit that is being filmed tomorrow. Tough luck. Cheers, Jordan On Apr 26, 8:25 pm, mike enervat...@gmail.com wrote: I'll third that on wanting to know what's up. Some insight as to whether this is a hardware issue on some platforms would be pretty nice too... the same thing happens on the iPhone but getting any insight from them is impossible. Mike On 04/24/2010 09:14 AM, Jonathan wrote: Thanks Lance. I saw that... it is one of the highest ranked issues out there and the comments are being abused quite a bit, but there does not seem to be any response from Google about whether or not they plan to correct this going forward, or if they feel it is something that even needs to be corrected. I've been trying everything I can think of to find some kind of workaround, but so far have failed to do so. It would be great to get a response from one of the Google engineers on this and I think it would hopefully at least put the issue to rest, even if the response is that they do not plan to change this going forward. I hope that is not the answer, but at least we would know. The odd thing is that thesensorsappear to behave somewhat differently depending on the actual device. For example, there are different behaviors between the Droid and the Nexus One, despite the fact that they are both using Android 2.1. So possibly some of the issues are related to the variations in the hardwaresensors themselves, but that is just more speculation. Dianne, if you are out there, I think there are a lot of people that would like to get a response on this one. Thank you!! On Apr 24, 10:14 am, Lance Naneklna...@gmail.com wrote: http://code.google.com/p/android/issues/detail?id=3708 On Apr 13, 6:32 am, Jonathanjharrisweinb...@gmail.com wrote: As I understand it, there seems to have been a change in the OS that prevents the accelerometer from running when the screen turns off and the phone CPU goes into its power saving state. Can this be confirmed? I have gotten around this by using a wake lock, but this is a much less than ideal solution as it drains a lot of battery. If the accelerometer was disabled in low power mode to save the battery, it may very well have the opposite effect in many cases, such as mine. A partial wake lock seems to be required to keep it running, which is obviously much worse than if just the accelerometer were running without the need for the wake lock. Are there any other workarounds anyone knows of to getting accelerometer values while the phone is in low power mode? Also, are there any plans to change this in future versions of the OS? If there are no plans to change this, I would definitely like to petition for this to be changed. Thoughts? Ideas? Workarounds? Thank you!! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Accelerometer power tied to display backlight power
Known but not resolved. Even in the bug report that is mentioned in the thread that you quoted, the only response has been things might have changed in cupcake. Of course determining what has changed, or if this specific problem has been fixed requires wiping the phone and installing cupcake*, whereas it seems like someone in the know could say we fixed this, or this is still the behaviour and we could stop discussing this. Jordan * If I haven't heard anything more about this by the end of the week, I will probably end up wiping and upgrading to cupcake. On Apr 17, 2:13 pm, Carter ccjerni...@gmail.com wrote: This is a known issue. See this thread:http://groups.google.com/group/android-developers/browse_thread/threa... On Apr 17, 4:18 am, David Burström david.burst...@gmail.com wrote: Hi Jordan, I can only agree with your findings. Regardless of which lock is being used, the service stops sending callbacks as soon as the screen turns off or the power button is pressed. :David On Mar 16, 3:01 pm, Jordan Frank jordan.w.fr...@gmail.com wrote: A partial wakelock doesn't help because, as I have already explained, as soon as the display goes off, the accelerometers go off. I can keep the CPU awake, and my program continues to run when the display is off. However, as soon as the display goes off, the accelerometers go silent. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Screen lock turns of the accelerometer.
Best I can do is say that quite a few people have been trying to do this, and haven't found a way to. Beyond that, don't hold your breath waiting for a response from someone at google. Jordan On Apr 16, 8:11 pm, Mark maxi...@gmail.com wrote: What I'm looking for: ** A way to read the accelerometer even when the screen is locked. ** Currently it seems that locking the screen automatically turns off the accelerometer. I looked around for quite a while and didnt find any solution for that. Is that intentional? It would be really helpful to know if this is how it is or if I just didnt find the solution for that so far. thank you for any help on that (and as I said, even doesnt work right now/on purpose/.. is a very helpful answer for me :) ) best regards, mark --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Accelerometer power tied to display backlight power
Good news! I upgraded my device to cupcake, and it appears that I can now receive onSensorChanged events when the screen is off, provided that I hold a Partial Wake Lock. However, the sampling frequency seems to be far more sporadic. I think that it has to do with the fact that cupcake now flips the orientation of all applications, and when it does the redrawing, it suspends the application (and thus the sensor listeners). I'm experimenting with turning this auto-orientation behaviour off (Anyone know how to do this on an application-by-application basis, rather than turning it off in the device settings?). Anyway, things look good for those of us who wanted sensor data without having to leave the screen on. Jordan On Apr 20, 10:55 am, Jordan Frank jordan.w.fr...@gmail.com wrote: Known but not resolved. Even in the bug report that is mentioned in the thread that you quoted, the only response has been things might have changed in cupcake. Of course determining what has changed, or if this specific problem has been fixed requires wiping the phone and installing cupcake*, whereas it seems like someone in the know could say we fixed this, or this is still the behaviour and we could stop discussing this. Jordan * If I haven't heard anything more about this by the end of the week, I will probably end up wiping and upgrading to cupcake. On Apr 17, 2:13 pm, Carter ccjerni...@gmail.com wrote: This is a known issue. See this thread:http://groups.google.com/group/android-developers/browse_thread/threa... On Apr 17, 4:18 am, David Burström david.burst...@gmail.com wrote: Hi Jordan, I can only agree with your findings. Regardless of which lock is being used, the service stops sending callbacks as soon as the screen turns off or the power button is pressed. :David On Mar 16, 3:01 pm, Jordan Frank jordan.w.fr...@gmail.com wrote: A partial wakelock doesn't help because, as I have already explained, as soon as the display goes off, the accelerometers go off. I can keep the CPU awake, and my program continues to run when the display is off. However, as soon as the display goes off, the accelerometers go silent. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Screen lock turns of the accelerometer.
Fixed in cupcake! Described further: http://groups.google.com/group/android-developers/msg/a616773b12c2d9e5 Jordan On Apr 20, 12:01 pm, dilit dmit.lit...@gmail.com wrote: Have you implemented the accel. listener as a Service (vs Activity)? Service should run in the background without the need to be in focus... There is not much documentation on Screen Lock I could find. Dmitriy On Apr 16, 7:11 pm, Mark maxi...@gmail.com wrote: What I'm looking for: ** A way to read the accelerometer even when thescreenis locked. ** Currently it seems that locking thescreenautomatically turns off the accelerometer. I looked around for quite a while and didnt find any solution for that. Is that intentional? It would be really helpful to know if this is how it is or if I just didnt find the solution for that so far. thank you for any help on that (and as I said, even doesnt work right now/on purpose/.. is a very helpful answer for me :) ) best regards, mark --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Sensors don't work on partial wake lock
I'm having the same problem, and have asked a few times on the mailing lists for more information, but have never seen any response from anyone in the know. That issue that romario13 posted concludes by saying that the sensor code has changed significantly in the cupcake branch. That's pretty useless, and I wish that the poster would have said something like the functionality has changed in cupcake. now when the display is off, if a partial wakelock is held, the sensors will continue to function, or something that would indicate what has changed. Since the poster didn't say anything like that, has anyone tried cupcake, and can they comment on what has changed? Unfortunately, one can't just try out cupcake in the emulator and see what happens, they actually have to upgrade their phone. This is really not something that I want to do, which is why it would be nice if someone in the know could just comment on this. Cheers, Jordan On Mar 27, 4:48 am, romario13 romari...@gmail.com wrote: Hi, Have you a news or workarounds about this issue? I have ADP 1.1 and can to confirm this sensor behavior when screen is off. There is a closed issuehttp://code.google.com/p/android/issues/detail?id=1685 But i cannot understand: what is fixed? Statement onSensorChanged() receives correct data or not called when sceen is off? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Accelerometer power tied to display backlight power
A partial wakelock doesn't help because, as I have already explained, as soon as the display goes off, the accelerometers go off. I can keep the CPU awake, and my program continues to run when the display is off. However, as soon as the display goes off, the accelerometers go silent. So this is why I think that the solution lies in one of the lower layers, I'm just not sure where to start digging. Cheers, Jordan On Mar 15, 12:35 pm, Marco Nelissen marc...@android.com wrote: That's why you'd use a *partial* wakelock. On Sun, Mar 15, 2009 at 6:57 AM, Jordan Frank jordan.w.fr...@gmail.com wrote: My fault for not explaining myself better. I want to still be able to collect accelerometer data while the display is off. I'm well aware of the fact that I can keep the display on, but if I want to, for instance, create a pedometer application that counts footsteps while in the user's pocket, then the last thing I want is to keep the display to be on the whole time. Cheers, Jordan On Mar 14, 3:20 pm, Stoyan Damov stoyan.da...@gmail.com wrote: http://developer.android.com/reference/android/os/PowerManager.WakeLo... On Sat, Mar 14, 2009 at 8:23 PM, Jordan Frank jordan.w.fr...@gmail.com wrote: Hi, Although I haven't received confirmation from anyone at Google, I can confidently state that when the power to the display goes off, one can no longer obtain data from the accelerometers. I can easily think of a number of examples of where one would like to continue collecting accelerometer data even when the display is of. Supposing that I wanted to fix this, can anyone suggest where should I start looking? Would this be in the SDK, the kernel, or in some proprietary firmware that I can't touch? Thanks, Jordan Frank --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Accelerometer power tied to display backlight power
My fault for not explaining myself better. I want to still be able to collect accelerometer data while the display is off. I'm well aware of the fact that I can keep the display on, but if I want to, for instance, create a pedometer application that counts footsteps while in the user's pocket, then the last thing I want is to keep the display to be on the whole time. Cheers, Jordan On Mar 14, 3:20 pm, Stoyan Damov stoyan.da...@gmail.com wrote: http://developer.android.com/reference/android/os/PowerManager.WakeLo... On Sat, Mar 14, 2009 at 8:23 PM, Jordan Frank jordan.w.fr...@gmail.com wrote: Hi, Although I haven't received confirmation from anyone at Google, I can confidently state that when the power to the display goes off, one can no longer obtain data from the accelerometers. I can easily think of a number of examples of where one would like to continue collecting accelerometer data even when the display is of. Supposing that I wanted to fix this, can anyone suggest where should I start looking? Would this be in the SDK, the kernel, or in some proprietary firmware that I can't touch? Thanks, Jordan Frank --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Accelerometer power tied to display backlight power
Hi, Although I haven't received confirmation from anyone at Google, I can confidently state that when the power to the display goes off, one can no longer obtain data from the accelerometers. I can easily think of a number of examples of where one would like to continue collecting accelerometer data even when the display is of. Supposing that I wanted to fix this, can anyone suggest where should I start looking? Would this be in the SDK, the kernel, or in some proprietary firmware that I can't touch? Thanks, Jordan Frank --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: develop application without a data plan?
My advice, is to do a search on Google for the phrase activate android adp1 without a sim card. You will find lots of information on how to do this. The first three results all give step by step instructions. Note that this advice also applies to other questions that you might have. Cheers, Jordan On Feb 20, 2:45 am, jonathan topcod...@gmail.com wrote: I just got my g1, I only need to develop an offline application, however, It wouldn't go further without signing into google account which requires a data plan. Please advise. thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Accelerometer frequency
I've done some experiments with the accelerometers, and so I figured that I would share the results. As for precision, the values are floats. I don't know how else to quantify the precision without looking at the specs for the actual sensors being used. Qualitatively, the noise in these sensors is very low. I've worked with accelerometers in other devices, and the G1 sensors have the least amount of noise of all the sensors that I've used. For my experiments, I'm not interested in large forces, more the kind that occur during natural human motion. The sensor readings tend to lie in the (-3g,3g) range. In the documentation, it says that there are 6 sensor values: x,y,z,raw_x,raw_y,raw_z. The documentation states that the x,y,z values may be smoothed, while the raw ones are the raw sensor readings. However, on the G1, the raw readings are identical to the smoothed readings. One thing that I'm suspicious of is that the low noise in the readings is actually due to the G1 doing some smoothing of the data, and the raw values aren't in fact the raw values, but are also smoothed. I'm not sure how to figure out if this is what is really happening. I first tried SENSOR_DELAY_FASTEST. I collected data over a 15 minute period. The average frequency was 21.0025, with standard deviation of 8.0061. I then tried SENSOR_DELAY_GAME, and found that the frequency was more consistent. I went for a 2 minute walk and the average frequency was 40.2894 with a standard deviation of only 3.3162. I hope that someone finds this useful. Cheers, Jordan Frank On Feb 18, 2:08 am, gjs garyjamessi...@gmail.com wrote: Hi, Try logging the data received with timestamps ( in memory ) for android.hardware.SensorListener.onSensorChanged(int sensor, float[] values) and you'll soon work out the Frequency, I have found accelerometer updates being received at approximately 30~40ms intervals on a G1 eg: 1227266554492 2 [0] = 0.16344418 [1] = -9.629586 [2] = -1.3620348 [3] = 0.16344418 [4] = -9.629586 [5] = -1.3620348 1227266554495 1 [0] = 7.3883734 [1] = -82.0 [2] = 1.0 [3] = 7.3883734 [4] = -82.0 [5] = 1.0 1227266554525 8 [0] = 8.3125 [1] = 12.875 [2] = -71.5625 [3] = 8.3125 [4] = 12.875 [5] = -71.5625 1227266554528 2 [0] = 0.05448139 [1] = -9.684067 [2] = -1.3075534 [3] = 0.05448139 [4] = -9.684067 [5] = -1.3075534 1227266554531 1 [0] = 7.5050936 [1] = -82.0 [2] = 0.0 [3] = 7.5050936 [4] = -82.0 [5] = 0.0 1227266554564 8 [0] = 8.5625 [1] = 12.125 [2] = -71.5625 [3] = 8.5625 [4] = 12.125 [5] = -71.5625 1227266554566 2 [0] = 0.040861044 [1] = -9.670447 [2] = -1.3211738 [3] = 0.040861044 [4] = -9.670447 [5] = -1.3211738 1227266554603 8 [0] = 8.0625 [1] = 12.375 [2] = -71.8125 [3] = 8.0625 [4] = 12.375 [5] = -71.8125 1227266554606 2 [0] = -0.013620348 [1] = -9.724928 [2] = -1.2666923 [3] = -0.013620348 [4] = -9.724928 [5] = -1.2666923 1227266554609 1 [0] = 7.5050936 [1] = -83.0 [2] = 0.0 [3] = 7.5050936 [4] = -83.0 [5] = 0.0 1227266554643 8 [0] = 8.3125 [1] = 12.375 [2] = -71.8125 [3] = 8.3125 [4] = 12.375 [5] = -71.8125 1227266554646 2 [0] = -0.013620348 [1] = -9.615966 [2] = -1.2666923 [3] = -0.013620348 [4] = -9.615966 [5] = -1.2666923 1227266554649 1 [0] = 7.5050936 [1] = -82.0 [2] = 0.0 [3] = 7.5050936 [4] = -82.0 [5] = 0.0 1227266554683 8 [0] = 7.8125 [1] = 11.625 [2] = -71.5625 [3] = 7.8125 [4] = 11.625 [5] = -71.5625 1227266554686 2 [0] = 0.040861044 [1] = -9.615966 [2] = -1.2666923 [3] = 0.040861044 [4] = -9.615966 [5] = -1.2666923 (These examples were when using SENSOR_DELAY_GAME rate, you can probably do better if you listen just for the accelerometer updates and use a faster RATE) You can also vary this Frequency (rate) with android.hardware.SensorManager.registerListener(SensorListener listener, int sensors, int rate) int SENSOR_DELAY_FASTEST get sensor data as fast as possible int SENSOR_DELAY_GAME rate suitable for games int SENSOR_DELAY_NORMAL rate (default) suitable for screen orientation changes int SENSOR_DELAY_UI rate suitable for the user interface I can't help you with the Precision, maybe have a look at android.hardware.SensorListener.onAccuracyChanged (int sensor, int accuracy). Another idea is to find the specs for the sensor being used in the g1 or g2, but there is nothing like measuring it for yourself Regards On Feb 17, 8:39 pm, ashu montoo...@gmail.com wrote: So my question still stands. Frequency? Precision? Thanks for the attempt, Jubei. On Feb 11, 6:14 am, Jubei nkatza...@gmail.com wrote: Supposedly you pass a 3rd parameter to the sensormanager's registerLister function but It doesnt seem to make any difference. On Feb 11, 7:33 pm,ashumontoo...@gmail.com wrote: Hey, I wanted to get the frequency of accelerometer output. How many readings can I get per second? And to what precision do I get? Thanks- Hide quoted text - - Show quoted text