I think saex is looking for a producer / consumer model using a
LinkedBlockingQueue with Weak references, so he can read the settings
into a queue when they're available, but his application may not need
them until slightly later, and needs to aggregate the results.  Weak
reference would allow this stack to grow and garbage collect itself
for memory as needed - keeping as much relevant sensor history as
possible?

http://download.oracle.com/javase/6/docs/api/java/util/concurrent/LinkedBlockingQueue.html

This isn't a good start ...

new Thread()
{
   public void run()
   {
      sensorMan = (SensorManager)
getSystemService(Context.SENSOR_SERVICE);
 
sensorMan.registerListener(SensorListener,
sensorMan.getDefaultSensor(Sensor.TYPE_MAGNETIC_FIELD),
SensorManager.SENSOR_DELAY_UI);
 
sensorMan.registerListener(SensorListener,
sensorMan.getDefaultSensor(Sensor.TYPE_ACCELEROMETER),
SensorManager.SENSOR_DELAY_UI);
   }
}.start();

On Sep 26, 10:41 am, Kristopher Micinski <krismicin...@gmail.com>
wrote:
> In most reality, using bare threads in Android also seems a bit
> contrived, there are a few more system appropriate utilities you might
> look into..
>
> Kris
>
>
>
>
>
>
>
> On Mon, Sep 26, 2011 at 11:35 AM, TreKing <treking...@gmail.com> wrote:
> > On Mon, Sep 26, 2011 at 10:25 AM, saex <elpablos...@gmail.com> wrote:
>
> >> It is for Augmented Reality App, i really need to use Threads for this, or
> >> the camera doesn't works properly
>
> > No, you really don't.
> > If you need help with the camera, try explaining what "doesn't works
> > properly" means, and why you think this "one off" thread is the solution.
>
> > --------------------------------------------------------------------------- 
> > ----------------------
> > TreKing - Chicago transit tracking app for Android-powered devices
>
> > --
> > 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

-- 
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

Reply via email to