Android :: Sensor Listeners - Threads And Responsiveness
Jun 24, 2010
I have two questions about sensor listeners
1. from which thread are sensor values updated and should this be synchronized? can sensor's listener callback be a good place to call custom's view onDraw method? as this should be done from different thread. I cant find anything about it. In another words my problem is that I want to listen to sensors change and draw something on view surface but I dont know which thread (the main thread of the application?) is updating sensor's state
2. If I register sensor listener with SENSOR_DELAY_FASTEST my application is not responsive at all! Raw application with TextView only is not reacting to go back or home button! How should I deal with this or am I doing something wrong?
View 4 Replies
Aug 25, 2009
I would like to know how to run a listener on an isolated thread. Because I would like to use a LocationListener and make some calculations in the main thread. So the LocationListener would be "slow down", because of those calculations. Is it possible to have it run in a different thread? Or is it by default in a separate thread?
View 2 Replies
View Related
Feb 8, 2010
I have a HTC Hero here, and when I tried to get the list of available sensors on the device by calling ((SensorManager) getSystemService (Context.SENSOR_SERVICE)) .getSensorList(Sensor.TYPE_ALL); I get only the following sensors: D/SensorManager( 6302): found sensor: BMA150 3-axis Accelerometer, handle=0 D/SensorManager( 6302): found sensor: AK8973 3-axis Magnetic field sensor, handle=1 D/SensorManager( 6302): found sensor: AK8973 Orientation sensor, handle=2 D/SensorManager( 6302): found sensor: AK8973 Temperature sensor, handle=3 According to the specs, there should be a light and a proximity sensor on the Hero, and I've seen it in action (the automatic screen brightness adjustment) - so at least the ambient light sensor is definitely there. My question is then, why doesn't the getSensorList return for me the light and the proximity sensors?
View 8 Replies
View Related
Nov 2, 2010
Does anyone know the difference between the orientation sensor and magnetic field sensor on Android?Since I've read that magnetometer is synonymous with digital compass I'm a little bit confused. What are they really?
View 1 Replies
View Related
Apr 13, 2010
What are the advantages/disadvantages in placing a lengthy network access code in a thread in an activity or a thread in a service? How would it affect the application? I am writing a streaming audio player and from what I've read so far putting the code in a service will still end up blocking the application so a new thread is needed, does anyone know if it makes more sense to put this piece of code in a service.
View 1 Replies
View Related
Oct 30, 2009
Or it's just some virtual sensor the uses the data provided by the accelerometer and the magnetic field sensor to calculate the orientation?
View 7 Replies
View Related
Nov 18, 2009
Can some one point towards any documentation/resources/ threads that can explain how a new sensor support can be added in android sensor framework?
View 2 Replies
View Related
Feb 18, 2010
My home icon is way less responsive than the back icon which seems to be perfectly normal. Sometimes I have to "press" the home icon twice to get the "buzz" and have it move the screen. However the back icon works 99% of the time on the first press. IS there any adjustment I can make or should I bring the phone back. I have had it now for 2 weeks.
View 9 Replies
View Related
Sep 14, 2010
Can I have one Activity listen for a message from another?I have a TabActivity and I need to call a function/send a message to the associated tabs.How do I go about doing that?
View 9 Replies
View Related
Nov 24, 2010
I want to implement an Android Service that periodically downloads data and notifies various listener activities that the data has been updated.
There seems to be various way of communicating with a Service. What's the simplest and best way to do the above?
View 2 Replies
View Related
May 24, 2010
I have following code:
CODE:...........
Code is working but here goes my problem: when I call it from main activity in this way:
CODE:........
Then i can see 10 times result of 'doing sth else!!!' and when loop is over i can see then result from activity. So sensor activity waits for some reason and then when main activity has nothing to do, sensors are doing their job.
of course I have well implemented: onActivityResult(int requestCode, int resultCode, Intent intent)
I want to read sensord data directly, not using listeners, is it possible?
View 1 Replies
View Related
Mar 22, 2009
Is there a way to check before sending a broadcast (from a remote service) whether there are registered broadcast listeners? What I'd like to do is to send broadcasts only if there are registered listeners, otherwise make a toast. Does it make any sense?
View 3 Replies
View Related
Oct 13, 2010
Are there any Android phones that are multi-processor (multi-core/ cpu), where application threads execute concurrently on different processors?
There doesn't seem to be any explicit way of doing asynchronous file I/ O or asynchronous resource loading. So, suppose I put BitmapFactory.decodeResource() or Resources.openRawResource() into a separate thread. Will those methods play nice with the other threads, yielding during blocking I/O operations so those other threads can run?
If those methods rely on the thread scheduler to forcibly suspend them, then the separate resource-loading thread isn't going to help me get my application started any faster (although it will help it to be more responsive to user input).
View 5 Replies
View Related
Jun 2, 2010
How to implement Multithreading in Android application so as to increase responsiveness of UI. ?
View 3 Replies
View Related
Nov 2, 2009
I am thinking about buying this and just wanted to know from someone who has used this if the screen is very responsive. I know if may not be like the iPhone or the Hero which used "capacitive" screens, but is it responsive enough that you barely have to push down on the screen to select items? Also, would you recommend this over an unlocked HTC Magic?
View 4 Replies
View Related
Jun 8, 2010
Some people over a PPCGeeks are encountering some of the same screen responsiveness issues that Incredible users were seeing (non-responsive touch screen when phone is on non-conductive surfaces). I have experienced this myself when my phone is in the car dock and when it is laying on plastic or fabric. On my phone, it seems to only be on the top half of the screen.
View 1 Replies
View Related
Mar 4, 2010
Is anyone else having issues with the responsiveness of the touchscreen after updating to 2.1? It seems to have lost some accuracy on touch detection and I find myself having to select things twice sometimes before it registers my touch.
View 10 Replies
View Related
Aug 7, 2010
Eight Issue Camera responsiveness, is there a way to fix this app or will it be glitch until the update and/or even after the update? Is it just my phone or every time I attempt to take a picture it takes quite sometime after I take the picture the actual moment the picture is captured? not to mention the lag between pictures, the lack of burst mode, and another thing that is quite annoying why does the image in the camera gets so DARK when you press the camera button to focus? the image on the screen should represent the actual photo your capturing not some dark version of it one or two seconds after you click/touch the screen to capture the picture.
View 2 Replies
View Related
Dec 30, 2009
Being new to the Eris and smartphones in general, I apologize in advance if I've missed something common-knowledge...
Today I got a 16GB Class 6 SD card in the mail, one to both max out storage and to settle a hunch -- that the class of card (i/o speed) would noticeably affect how the Eris responded. Class 6 cards are about 30 - 50% more cash than Class 2, but triple the rated write speed. Just happened to find one cheap enough to try it out...
Wow. Not only has everything from the pattern unlock screen to the browser become far more responsive, but the stutter for actions in the Sense UI is gone.
Now, for the circumstances... formatted the new card and copied the entire old card's contents onto it w/USB & my desktop. Added another 2GB of music while mounted... still slick. Mind you, tasks themselves don't happen any faster... just the delay between them I'd gotten used to, vanished...
Am I missing something? I'd hate to get anyone's hopes up, if this is just something that only resembles a performance tweak. Either the system or software use SD memory more than I'm aware, or this is all in my head. All I can say for certain is that my Eris is much nicer to use now.
View 49 Replies
View Related
May 8, 2013
I have been using HTC Desire S for about 2 yrs now, but since I am not a power user, I just use it as it came. Now considering to root it and was looking more closely at things and I see there are many services running in the background under "Running".
I don't know the inner workings of Android system, so would like to know if more services are running (especially from apps which I don't regularly use) then does it effect battery life and does it make the phone slower ?
For example under Calendar, 4 services are running - AutoSettingService, ImmediateModeService, DashboardService,ConnecttoPcService.
Google Maps has TrafficAppWidgetUpdateService and PrefetcherService ( I rarely use Google maps because I use offline rmaps)
Another thing is I have a prepaid connection without a data plan so I would like to control which apps connect to the net when i switch on 3G - i mean I would prefer if only the app which I want to use the data should use it, while others should not.
And there are some things taking data, which i don't really understand - but since they are related to Android system I am not sure whether to try to restrict them (Android System, HTC Function test, HTC Checkin service, Settings storage, VPN, Status bar, Bluetooth, Google backpp transport, etc, Phone, Dialer Storage, SIM toolkit)
Any general idea about these services - battery and network usage and effect on responsiveness ?
View 1 Replies
View Related
Jan 6, 2010
I have touched on this question here, where Christopher gave an answer to this, but I dont really get it so I thought its time to make it a real question, not just a "follow up" =)
As it stands, the application Im writing has 4 different screens:
1. Screen 1 - list of nodes (main screen)
2. Screen 2 - options menu, tableLayout with buttons
3. Screen 3 - navigation
4. Screen 4 - text details on version etc
These screens can be navigated to/from using a "header" View that is placed on top. the header then has 4 different buttons:
+--------------------+
| menu with buttons |
+--------------------+
| |
| |
| |
| C O N T E N T |
| |
| |
| |
+--------------------+
The header is just an XML-file (header.xml) with a few buttons. That header.xml is the included in the Layouts using the include-markup. For example, the main.xml has the line:
<include layout="@layout/header"></include>
The header show up alright, but the question is - what is the correct approach to attach OnClickListeners for the buttons in the header?
Christopher pointed out that you could create an Activity class and do the hooks there, like this:
CODE:............
First, I cant make it work since the method setupHeaderButtons isnt accessible from FirstActivity.
Secondly, is this the right way to go at it?
View 3 Replies
View Related
Jul 5, 2010
Just watched this video about the screen responsiveness on the Desire vs the Samsung Galaxy S. These are the two phones I'm considering, so I just wanted people's opinions on it. http://www.youtube.com/watch?v=hVlsRCMltDg&feature=player_embedded
View 24 Replies
View Related
Oct 22, 2010
We are in the process of refitting some of our recievers and services with IntentServices (mostly to address rare ANR issues - and because IntentService is pretty cool...). In one case we are converting a traditional service to an IntentService. The original service fired off a few methods whose job was to download data from our servers. Each of these requests would spawn a thread of their own to do the work (apparently not fast enough to avoid the occasional ANR). So now we have a question concerning the life cycle of these processes.
For example, the following situation demonstrates what is happening:
- Start Intent Service - Trigger Download1 - Download 1 thread starts - End Intent Service
- Download 1 thread continues..... - Download 1 thread ends
Our question concerns our exposure to the OS shutting down the Download 1 thread because the Intent Service has terminated before it finishes up. Not sure if it is becomes more or less likely that the OS will view it as something that can be flushed.
If the Download 1 thread is more likely to be flushed by OS we will need to take a different approach.
View 4 Replies
View Related
Apr 6, 2010
I am working on a simple application (studying purposes) which list all the files from a selected folder. On top of that I would like to have a search feature where the user can search for files (the code for that is already in place). Now, I was thinking about having the search running in the background somehow, whilst the user can still navigate, create folders, copy, sort and do other stuffs normally. When the search finishes the user would get a notification and then could click on it and go to that activity (It ideally should be the same ListView I already use for browsing the files, I would just need to update the Adapter there with the latest processed data after clicking in the notification). What's the best answer for that? Threading or AsyncTask?
View 4 Replies
View Related
Feb 22, 2010
I'm trying to understand the idea behind the Services. If it runs in the program's thread, why not create just a separate thread (or AsyncTask) to do the job? Can a service keep running in the background? For example, i want to create a task that will continuously be polling data from a server, even if the main application is not running. Can this be achieved with a Service?
View 8 Replies
View Related
Mar 13, 2010
while debugging and app that uses AsyncTask to record audio and update UI I noticed that everytime that an AsyncTask object ends running (finishes doInBackground and onPostExecute or on Cancelled it´s thread stays alive (running status).At least for me that should not be the behavior of the class since the doInBackground task may not stay running forever (as an example the android manual says that a status bar should be updated by an asynctask, and it won´t last for the whole app running time).Is there anything I´m missing, as a method to destroy it, or should I just ignore and keep creating threads as I need and the VM will handle them as it needs resources?
View 9 Replies
View Related
Jun 5, 2010
how do i save certain threads?
View 1 Replies
View Related
Aug 3, 2010
As my app matures, I find myself finding more and more uses for threads. By now I must have about 25 threads, all doing important things and working together in symphony.
I notice however that my app is sitting around 15.5MB resident. Compared to the browser (+/-35MB) I feel pretty safe, but I do notice the resident size of my app ever increasing.
The question is, how much overhead is involved with adding a thread?
I'm also wondering if the synchronized keyword encounters more and more latency with each new thread that is present?
View 4 Replies
View Related
Mar 4, 2010
I have an activity that uses a Timer (java.util.Timer) to control the display. I set it off to repeat its run() method every second or so. When it runs, it updates some View elements.
As Timer runs in its own thread, I assumed this would be reliable. But I notice that sometimes there is a stutter, or delay, in the views updating. It's like they occasionally get stacked up, and all happen together. Studying the output from logcat, I notice that this happens when the device is doing something else - some system functions, or sometimes a garbage collection.
How can I avoid this? I'm not aware I can run the main activity in a thread of its own, can I? If the timer has its own thread, why is it affected?
View 8 Replies
View Related
Nov 17, 2009
We are developing an application that needs to suspend and resume threads like a debugger (meaning in a non-safe way like Object.wait() and Object.notify()).In the Java SDK the methods Thread.suspend() and Thread.resume() are deprecated but we can still use them. Also there is the Java debugger API which allows one to do that if you connect to the VM as a debugger. Is there some API for android we can use? Is there a published Java Debugger API we can apply for Android?
View 2 Replies
View Related