Accessing the Accelerometer

Tutorials with advanced 'difficulty' and more Lines of Code.

Postby venkat » Mon Feb 11, 2008 1:35 pm

Hi Peli,
Thank you very much for your information. sensor simulator works fine.
Regards,
Venkat.
venkat
Senior Developer
Senior Developer
 
Posts: 152
Joined: Tue Nov 27, 2007 5:42 am
Location: India

Top

New Idea based on accelerometer.

Postby nit1507 » Mon Feb 11, 2008 4:08 pm

Hi Plusminus,
I got an idea , suppose I am travelling in car and suddenly
I met with an accident then , a programme should be able to detect
accident situation , (like negative acceleration detected by
accelerometer) and it should immediately send SMS to all interested
parties (already setup by user) with address or image of map where
exactly accident has happened.

How is the idea ? Is it viable ? Please offer your suggestions
User avatar
nit1507
Freshman
Freshman
 
Posts: 6
Joined: Wed Jan 09, 2008 4:27 pm
Location: Chennai, India

Postby plusminus » Mon Feb 11, 2008 4:28 pm

Hello nit,

nice idea :!: and with Android it should be no problem to do so (Acceleration, GPS, SMS all easily accessible).
The only problem is to detect an actual accident. :!:
Could be worked around by asking the user to click deny within 10 seconds if the phone perhaps just fell down a chair. Could also be improved if the speed was higher than 20 miles/hour for > 10 seconds or similar.

This could fit into andnav.....

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby nit1507 » Wed Feb 13, 2008 2:43 pm

Hello plusminus,
Thanks for the feedback. Suggestion to detect accident sounds good. I will start working over it.

Thanks

Nit
User avatar
nit1507
Freshman
Freshman
 
Posts: 6
Joined: Wed Jan 09, 2008 4:27 pm
Location: Chennai, India

Postby plusminus » Wed Feb 13, 2008 2:59 pm

Hello Nit,

just right now, testing your final functionality came to my mind ^^
It is going to be really expensive :P (Broken phones etc ^^) (joke..)
nit1507 wrote:Hello plusminus,
Thanks for the feedback. Suggestion to detect accident sounds good. I will start working over it.

Thanks

Nit


Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby parashar.iiit » Thu Feb 28, 2008 9:20 am

Hello plusminus,
I am using accelerometer in my application. Could you suggest me something so that i can check
my application with real data ? I tried to merge your accelerometer class and openintents sensor simulator. But it didn't work.Could you help me regarding this ?? :roll:

Thanks in advance
Abhinav
User avatar
parashar.iiit
Junior Developer
Junior Developer
 
Posts: 10
Joined: Sat Feb 02, 2008 12:51 pm

Top

Postby Peli » Thu Feb 28, 2008 10:05 am

parashar.iiit wrote:Hello plusminus,
I am using accelerometer in my application. Could you suggest me something so that i can check
my application with real data ? I tried to merge your accelerometer class and openintents sensor simulator. But it didn't work.Could you help me regarding this ?? :roll:

Thanks in advance
Abhinav


Hi Abhinav,

I answered your question here: http://groups.google.com/group/openinte ... 515ea05690

Let me know if this is what you wanted.

Peli
Peli
Junior Developer
Junior Developer
 
Posts: 17
Joined: Thu Dec 27, 2007 10:54 am

Postby parashar.iiit » Thu Feb 28, 2008 10:22 am

Thanks peli .... I got it ...

Abhinav
User avatar
parashar.iiit
Junior Developer
Junior Developer
 
Posts: 10
Joined: Sat Feb 02, 2008 12:51 pm

Postby parashar.iiit » Thu Feb 28, 2008 10:26 am

One more thing ..... I have real accelerometer .... how can i access that ....using this emulator ???
Actually my application is real world application ...so its very important to me to test it in real time
environment .

PlusMinus how do i connect that to your classs ??? can you suggest some idea ??

Abhinav
User avatar
parashar.iiit
Junior Developer
Junior Developer
 
Posts: 10
Joined: Sat Feb 02, 2008 12:51 pm

Postby plusminus » Thu Feb 28, 2008 12:40 pm

Hello Abhinav,

I don't know a single line of your code or what you have tried so far. :)

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby Peli » Thu Feb 28, 2008 1:33 pm

parashar.iiit wrote:One more thing ..... I have real accelerometer .... how can i access that ....using this emulator ???


Hi Abhinav,

In the newest release of OpenIntents (0.1.3), we've included partial support for a IBM Thinkpad accelerometer. The idea is that you could use the SensorSimulator to pass your notebook's accelerometer data to the Android emulator.

If you are interested in that possibility, I guess it is better if we discuss this in the OpenIntents discussion thread, as there are the developers working on the code:

http://groups.google.com/group/openinte ... 515ea05690

See you there,
Peli
Peli
Junior Developer
Junior Developer
 
Posts: 17
Joined: Thu Dec 27, 2007 10:54 am

Postby plusminus » Thu Feb 28, 2008 2:19 pm

Hey Peli,

you are using the accelerometer that is also used for the "Active [HDD] Protection" :?:
I hope so :D

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby Peli » Thu Feb 28, 2008 2:38 pm

plusminus wrote:you are using the accelerometer that is also used for the "Active [HDD] Protection" :?:
I hope so :D


Yes, at least that is the plan. The implementation is not comlete yet. Since I don't have a thinkpad, I would need some help from someone who has one, to try out if the readout works so far, and what the range of values returned is...

Peli
Peli
Junior Developer
Junior Developer
 
Posts: 17
Joined: Thu Dec 27, 2007 10:54 am

Postby plusminus » Thu Feb 28, 2008 4:14 pm

Hello peli,

i have a X41t by my side. I could do some testing, if it consumes only little time.

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby Peli » Thu Feb 28, 2008 5:37 pm

i have a X41t by my side. I could do some testing, if it consumes only little time.


Great! So, please download the latest OpenIntents 0.1.3 release (binary) http://code.google.com/p/openintents/downloads/list

Open the tools/sensorsimulator.jar and in the Settings pane scroll down and click "Use thinkpad accelerometer"

Now you should see the values provided by your accelerometer.

They should read (512,512) or similar if the laptop is at rest.

Now the following tests:
Please let me know the numbers:
when you roll the notebook to the side (right or left) (at 90 degrees)
and when you tilt it to the back or front. (at 90 degrees).

Bonus: The numbers at 45 degrees, or 30 / 60 degrees if you have a ruler :-)

Also, let me know how stable the numbers are (do they change a lot with random fluctuations - how large is this fluctuation, e.g. from 505 to 520, or 512 +- 3, or similar).

Let me also know if there are any problems you encounter.

Also, will the numbers change when you shake it up and down (without rolling or tilting)?

And, shaking left and right - what are the maximum numbers you can achieve, and which g do you think does this correspond to?

And finally, smash it at high velocity against the wall.. which numbers do you read off? :-)
(ok, the last point is just a joke :-) but I'm really interested in the first values!!)

Thanks,
Peli
Peli
Junior Developer
Junior Developer
 
Posts: 17
Joined: Thu Dec 27, 2007 10:54 am

Top
PreviousNext

Return to Advanced Tutorials

Who is online

Users browsing this forum: No registered users and 8 guests