Android :: Accelerometer Direction Of Shake?

Apr 8, 2010

I've been playing with the data given by the accelerometer,trying to work out how I can gauge a shake from front to back or side to side. This all seems straightforward enough.But I'd love to know the direction of the shake. So, if the user is shaking backwards and forwards, I want to know if the device is moving away from the user, or back towards him/her. I can't find any way of telling this.

Android :: Accelerometer direction of shake?


Android :: Accelerometer Shake Side-to-side Detection

Jul 31, 2009

I'm developing an app and i need to detect when the user shakes the phone from side to side , that means just along one axis (in this case X).I want to know when the user shakes the phone to the left and when to the right, the problem is that my code does not detect shaking but tilt, i have tested this code and it works when i tilt the phone to left or to the right, but not when a shake it from side to side (no matter the orientation of the phone).

View 2 Replies View Related

Android :: Sounds + Accelerometer - Weird Accelerometer Values - BUG?

Jun 9, 2009

I am developing a game. In which the user controls movement using the accelerometer. Sounds effects can also be enabled. However when laying the phone flat down and playing the game without the accelerometer gives nice 0,0,0 values. However when play WITH SOUNDS on, i get a buch of weird values: while the phone is NOT moving.

This is really a big bug that makes life hard for Game Developers. I tried to take an avarge of the last 5 values from the sensor.. but this is not enough.. The harder the sounds plays: the higher the weird sensor values. When using the headphones: almost no weird values. Seems that sounds interferes with the accelerometer sensor.

View 5 Replies View Related

Android :: Request For Shake Functionality

Nov 21, 2009

The things that sometimes a brute force shake would be most helpful for and that I would pay money to have my phone do:

1. Shake to full brightness. When it's too bright to see the screen, it's a PITA to try to get the brightness turned up.

2. Shake to current phone call. Occasionally, I exit the phone app and it's frustrating not to be able to hop back over there quickly.

3. Shake to unlock. It's annoying to always be swiping when I just want to quickly check something on my phone. A quick shake would be much easier as an option.

View 15 Replies View Related

Android :: Any Listener For Shake Movement?

Mar 1, 2009

Is there any Listener able to listen for shake movement. when someone shakes the phone an event should be triggered ,how I'm supposed to do that ,any idea on this topic is appreciable.

View 12 Replies View Related

Android :: Any Alternative To Shake Awake?

Sep 30, 2009

Ive had my hero 6 weeks now and used shke awake from the start, but recently its been crap. During calls my screen goes black approx 40% of the time and its driving me mad.Is there another app in the market that performs better than 60%?Also, is there an app that disables the volume buttons?

View 3 Replies View Related

Android :: Shake Detection On Emulator

Apr 30, 2010

I am pretty new to android. I have a use case where I need to detect a shake and show some images in my application. Can I test shake functionality on android emulator ? What are the other alternatives apart from testing it on a real phone ?

View 1 Replies View Related

Android :: Need To Add Shake Feature That Will Refresh Application

Feb 23, 2010

I need to add a shake feature that will refresh my Anroid application.All I find of documentation involves implementing the SensorListener, but Eclipse tells me it's deprecated and suggest SensorEventListener. Anybody that has a nice guide to how I go about creating this "shake controller"?

View 5 Replies View Related

Android :: Testing Shake Events On Emulator

May 13, 2010

Can any one help with how to test sensor events like shake on Android Emulator.I have found some posts pointing to openintents but can anyone explain how to use it in android 2.0 avd.

View 1 Replies View Related

Android :: Detecting Shake Movement Without Draining Battery

Sep 10, 2009

I would like to detect shake movement in a service that is running in the background, even when the phone is not currently being used. Is it true that the only way to do this is to hold a wake lock? I suppose this would consume a lot of energy and drain the battery very fast.Is there no way to wake up the phone whenever a shake movement occurs? Maybe with the native sdk? I would imagine the accelerometer causing some kind of interrupt.

View 2 Replies View Related

Android :: Does Anyone Know Of Any Sample Code For Simple Shake Detector?

Jul 16, 2010

I'm looking for an android code example on how I would be able to make my phone listen for a "shake" and then have it trigger webview.reload(); to simply reload the webview on the activity. Anyone have any insight on this topic?

View 2 Replies View Related

Android :: Screen Orientation / Shake Cellphone Crashes Application

Jan 15, 2010

I am having search application, which loads data retreived from the webservice.While application on create it shows progress dialog once its done with loading data it dismiss the progress dialog.problem is while loading if i change the orientation of the phone it works fine it try to load activity again, but if i start shaking the cellphone while it is loading data application get crashed, any solution?

View 1 Replies View Related

HTC EVO 4G :: Applications Keep Opening Automatically With Shake?

Jun 21, 2010

im not sure if anyonelse has this problem but when im holding my phone and doing something and there's momevent on the hand holding the phone,different apps with keep opening from the homescreen?how do i stop this?.

View 3 Replies View Related

Motorola Droid :: Any Good Shake Apps Out There?

Dec 21, 2009

im privileged to be one of the few people in my circle of friends that own a droid and i blow them away in many feature comparisons as they all have iphones or blackberries but i noticed through the apple app store there were many cool apps where you can just shake the phone for certain features like wake-ups notifications and even being used in popular games just wondering what Android has that has that kinda cool "shake" feature i think it would be sweet.

View 17 Replies View Related

HTC Incredible :: Found A Good Shake To Wake App

Jul 12, 2010

Anyone found a good shake to wake app.I read in one review that the Incredible has one built in but I can't find it.

View 1 Replies View Related

Android : How I Can Get Direction In Htc Desire

Nov 28, 2010

Every one can any body explain to me how I can get direction in Htc desire ,cause when I ask about any direction or end point always the answer is no route.

View 6 Replies View Related

HTC Hero :: Why Is Shake Awake Not Secure For Incoming Calls?

Feb 8, 2010

I just downloaded Shake Awake thinking I'd give it another shot.In the settings, it says that enabling it for incoming calls may not be secure.Why is that?

View 1 Replies View Related

Android :: Direction Information In MapView

Aug 16, 2010

I want to show the direction information in my app.Direction from one address to the another using Google maps and also wanted to set overlays at the starting address and the destination address.Is there any classes in android too do that.

View 5 Replies View Related

Android :: Draw The Direction Arrow On The Map

Sep 13, 2010

I am creating a class extending mylocationoverlay. then, i override the draw method. is this the correct method? because after i rewrote the draw method, the map tile cannot render.

View 4 Replies View Related

Android :: Scrolling The Wrong Direction?

Dec 7, 2009

Scrolling on an Android phone makes sense because it's like you're physically sliding the page upwards. However, now that I'm used to doing that, when I get on my laptop and start to scroll with my touchpad, sometimes I find myself scrolling the wrong direction. On a touchpad you drag downwards to go down on the page, or to slide the page upwards. So it's backwards from the motion you would make on your phone.

View 17 Replies View Related

Android :: Calculating Direction From Point A To B

Sep 17, 2010

I'm trying to create a compass for my application BUT the difference is that, instead of having a line always pointing to north, I want this line to point for a specific point. I've been trying dozens of algorithms and nothing works. I've finally found one that points me exactlly to the point I want. But it doesn't move if I change the position of the device which is my objective. Basically, what I want is that no matter the direction I'm using my device. The line always point me to the point (picLatitude,picLongitude). I understood that for the line to move, I can't use static variables. I need to use the values offered by the onSensorChanged(SensorEvent event). This are the data I have available:

event.values[0]: azimuth, rotation around the Z axis (device in relation to north, 0º) event.values[1]: pitch, rotation around the X axis event.values[2]: roll, rotation around the Y axis mLatitude: device current latitude got from GPS (variable) mLongitude: device current longitude got from GPS (variable) picLatitude: static picture latitude established previously picLongitude: static picture longitude established previously distance: distance in Km from device to the picture calculated previously

And this the formula that works correct, and gives me the correct angle. (But it doesn't use any of the Sensor Data so the line Compass doesn't move):
double dLong = picLongitude - mLongitude; double y = (Math.sin(dLong) *
Math.cos(picLatitude)); double x = (Math.cos(mLatitude) * Math.sin(picLatitude) - Math.sin(mLatitude)*Math.cos(picLatitude)*Math.cos(dLong)); double angleDegreesWrongRange = Math.abs(Math.toDegrees(Math.atan2(y, x))); float angleDegrees = (float) ((angleDegreesWrongRange+360) % 360);
myCompass.updateDirection(angleDegrees);
I got this "bearing" formula from this website: http://www.movable-type.co.uk/scripts/latlong.html. I've try adding, subtracting, the azimuth.. I've tried with the others, seriously at this point I'm just demoralized.

View 13 Replies View Related

Android :: Scrolling Direction And Velocity

Jul 8, 2010

Is there an easy to know the direction of scroll (up or down for a vertical list) and the scroll velocity for ListView's?

View 2 Replies View Related

Android :: Way To Get Direction Between Two Locations In Droid?

Aug 2, 2010

Is there any way to find the direction between two locations in Android?

View 3 Replies View Related

Media :: Detect Voice Direction On Android

Nov 3, 2010

I am wondering whether it is possible to detect voice direction in android or not? For example on nexus one using the actual mic and the noise cancellation mic or using any other method?

View 4 Replies View Related

Android :: Finding Direction Using Compass Interface

Jan 11, 2010

I need to know if there is an interface to access the direction in which the phone is pointing.

View 2 Replies View Related

Android :: Compass Pointing Direction Other Than North

Sep 16, 2010

I'm trying to implement something that I don't even know if it's possible. So I have this class which implements a SensorEventListener like this:
private SensorEventListener mySensorEventListener = new SensorEventListener(){
@Override public void onAccuracyChanged(Sensor sensor, int accuracy) {
} @Override public void onSensorChanged(SensorEvent event) {
myCompass.updateDirection((float)event.values[0]); } };

And a class that handles the way the compass looks like this:
public static class compassLook extends View {
private Paint paintPointer = new Paint(Paint.ANTI_ALIAS_FLAG);
private Paint paintCircle = new Paint(Paint.ANTI_ALIAS_FLAG);
private Paint paintLeters = new Paint(Paint.ANTI_ALIAS_FLAG);
private boolean firstDraw; private float direction = 0 ;
public compassLook(Context context) { super(context); init();
} public compassLook(Context context, AttributeSet attrs) { super(context, attrs); init();
} public compassLook(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle); init(); } private void init(){
paintPointer.setStyle(Paint.Style.STROKE); paintPointer.setStrokeWidth(3);
paintPointer.setColor(Color.argb(255, 209, 114, 2)); paintCircle.setStyle(Paint.Style.STROKE);
paintCircle.setStrokeWidth(2); paintCircle.setColor(Color.argb(150, 255, 255, 255));
paintLeters.setStyle(Paint.Style.STROKE); paintLeters.setStrokeWidth(1);
paintLeters.setColor(Color.argb(230, 255, 255, 255)); paintLeters.setTextSize(12);
firstDraw = true; } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { setMeasuredDimension(MeasureSpec.getSize(widthMeasureSpec),
MeasureSpec.getSize(heightMeasureSpec)); } @Override protected void onDraw(Canvas canvas) {
int cxCompass = (getMeasuredWidth()/2); int cyCompass = (getMeasuredHeight()/2);
float radiusCompass; if(cxCompass > cyCompass){ radiusCompass = (float) (cyCompass * 0.9);
} else{ radiusCompass = (float) (cxCompass * 0.9);}
canvas.drawCircle(cxCompass-50, cyCompass, radiusCompass, paintCircle);
if(!firstDraw){ // Desenho da linha que aponta canvas.drawLine(cxCompass-50, cyCompass,
(float)(cxCompass-50 + radiusCompass * Math.sin((double)(- direction) * 3.14/180)),
(float)(cyCompass - radiusCompass * Math.cos((double)(-direction) * 3.14/180)),
paintPointer); double mLatitude = (mLocation.getLatitude() / 1E6);
// I get this value from a LM request double mLongitude = (mLocation.getLongitude() / 1E6);
// I get this value from a LM request double picLatitude= Double.parseDouble(picLatitudeString);
// I get this value from a bundle double picLongitude = Double.parseDouble(picLongitudeString);
// I get this value from a bundle float direction = (float)
Math.toDegrees(Math.atan2(picLongitude- mLongitude, picLatitude-mLatitude));
float distancia = (float) (Math.sqrt(Math.pow(mLatitude- picLatitude,
2) + Math.pow(mLongitude-picLongitude,2)))/2;
//Desenho do texto que indica a distancia
canvas.drawText(String.valueOf(distancia) + "Km", cxCompass-30,
cyCompass+20, paintLeters); } } public void updateDirection(float dir)
{ firstDraw = false; direction = dir; invalidate(); } }

View 5 Replies View Related

Android :: Sub Activity Flies In Horizontal Direction?

Nov 18, 2009

My current app flies in a sub activity when you flick-up. Problem is, it flies in horizontally from the right. I want it to fly in vertically from the bottom to match the flick direction. I'm sure this must be an xml property somewhere, but I can't find it. Does someone have a pointer as to how to set this?

View 10 Replies View Related

Android :: Change Direction Of Playback Video?

Jun 1, 2009

I am using Tablet skin for running emulator output. All the menu and list items are displayed properly e.g. Horizontally whereas Videos are being played vertically. How can I change the direction of video? Kindly reply as soon as possible.

View 2 Replies View Related

Android :: Implemented An Android Shake Detector That Works Well On Most Phones?

Jul 11, 2010

Has anyone implemented an Android Shake Detector that works well on most phones?I thought it would be fairly simple to implement but I keep getting false results. Basically, what I'm doing is setting up a sensor Listener, checking to make sure it is a SensorManager.SENSOR_ACCELEROMETER event, then only checking the event if the last event I received was more than 50 milliseconds ago (to try to reduce the amount of checking I do).Then I look for 3 "Shakes" within 4 seconds.A "Shake" to me being a speed reading of over 1000 followed by a speed reading of less than 400 within 1 second. If I don't get three "Shakes" within 4 seconds then the counter is reset to zero.At times it seems to work well but I continue to have instances where I just pick up the phone, and it triggers all three shakes, which makes very little sense to me because at other times, I can physically shake the phone quite hard, and not trigger all three shakes.As I said.. it works about 90% of the time correctly, but a 10% error rate is making the feature I want to implement useless.

View 5 Replies View Related

Android :: How To Play Video In Time Reversed Direction?

Oct 12, 2009

How to play video in a time reversed direction? The requirement is to loop playing forward and backward repeatedly.

View 7 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved