Please don't direct this person to other groups.  This person is confused.
:)  They are writing a third party app, so can only use the Java Sensor API,
and just don't seem to know how to get it to report more than 5 samples per
second.  I don't know anything about the particular device this person is
using, but that is *not* a limitation of the Java API.

On Thu, Nov 18, 2010 at 9:40 AM, Bret Foreman <[email protected]>wrote:

> babak,
>
> You are in the wrong discussion forum for this topic. You need to join
> the android-platform group where they talk about porting, drivers,
> special kernel builds, and so on.
>
> On Nov 18, 9:03 am, babak <[email protected]> wrote:
> > Hey Bret,
> > Thank you for your fast answer.
> > Actually I never did it before. How should I start? Do you have any
> > related document which helps me?
> >
> > Thank you in advance,
> >
> > On Nov 18, 5:42 pm, Bret Foreman <[email protected]> wrote:
> >
> > > 50Hz is nowhere near the capacity of the CPU to handle sensor data.
> > > I've run 2000 Hz on an ARM-7 and still had cycles to spare for other
> > > tasks. You'll need to create your own (C-code) ISR which loads values
> > > into a circular buffer and then unload the buffer from the Java side,
> > > passing the pointer to the buffer via JNI.
> >
> > > Of course, you will need to root the phone and rebuild the kernel and
> > > it will only ever work on rooted phones with your special kernel but
> > > it's totally doable.
> >
> > > On Nov 18, 8:25 am, babak <[email protected]> wrote:
> >
> > > > Thank you for your answer,
> > > > Actually, I am using the HTC Desire and I just reach to 5Hz sampling
> > > > rate with Java-API. But it is too low for me. Do know how to reach to
> > > > 50Hz, it is not important whether by using  standard API, JNI, or
> > > > working on the my phone's kernel. Actually, It is also Ok for me, if
> I
> > > > can reach to this performance just in my phone.
> >
> > > > Regards.
> > > > Babak
> >
> > > > On Nov 17, 9:04 pm, ip332 <[email protected]> wrote:
> >
> > > > > Short answer: no, you can't read sensors directly. With some
> hacking
> > > > > steps and couple of weeks of hard work you might be able to
> duplicate
> > > > > Android's Sensors JNI with exactly the same (or even worse)
> > > > > performance which will work only on your
> super-rooted-hacked-one-of-a-
> > > > > kind phone. Why bother?
> >
> > > > > With respect to the second question: yes, you can, but the maximum
> > > > > speed is device (driver) dependent and sometimes could be too high
> for
> > > > > the device. I mean that reading sensors is not the final goal and
> you
> > > > > need to keep some CPU to process that data, right?
> > > > > Anyway, you need to start from reading Android documentation:
> http://developer.android.com/reference/android/hardware/SensorManager...,
> > > > > android.hardware.Sensor, int)
> >
> > > > > On Nov 13, 12:24 pm, babak <[email protected]> wrote:
> >
> > > > > > Hello all,
> >
> > > > > > I am looking for a way to get sensors' data ( especially
> > > > > > Accelerometer) directly without using Listener approach. Actually
> I
> > > > > > need to have the data really fast!!!
> >
> > > > > > I can not find any way to read sensor data by myself. Anybody
> knows
> > > > > > anything about it?
> > > > > > Is it possible to read data with more than 50Hz?
> >
> > > > > > Regards,
> > > > > > Babak
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]<android-developers%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



-- 
Dianne Hackborn
Android framework engineer
[email protected]

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to