¡@

Home 

2014/10/16 ¤W¤È 08:23:02

android Programming Glossary: rotation

Vertical (rotated) label in Android

http://stackoverflow.com/questions/1258275/vertical-rotated-label-in-android

it fools underlying TextView to think that it's normal rotation swapping width height in few places while drawing it rotated...

Detect rotation of Android phone in the browser with javascript

http://stackoverflow.com/questions/1649086/detect-rotation-of-android-phone-in-the-browser-with-javascript

rotation of Android phone in the browser with javascript I know that.. Android phones Update To be clear I am asking whether the rotation of an android device can be detected by JavaScript running on..

Changing Locale within the app itself

http://stackoverflow.com/questions/2264874/changing-locale-within-the-app-itself

works but only until any configuration change e.g. screen rotation and only in that particular Activity. Playing with a code for.. will have custom locale set and it will not be reset on rotation and other events. I have also spent a lot of time trying to..

Android - Camera preview is sideways

http://stackoverflow.com/questions/3841122/android-camera-preview-is-sideways

had to initially put in logging statements in each of the rotation checks to say what the rotation was and then debugged on the.. statements in each of the rotation checks to say what the rotation was and then debugged on the device and watched the logCat output.. . In the code you'll see I didn't need to do any display rotation when the phone was at 90 or 180 degrees the device seemed to..

Implement page curl on android?

http://stackoverflow.com/questions/3912849/implement-page-curl-on-android

beta sin theta v1.z r 1 cos beta cos theta Apply a basic rotation transform around the y axis to rotate the curled page. These..

Activity restart on rotation Android

http://stackoverflow.com/questions/456211/activity-restart-on-rotation-android

restart on rotation Android In my Android application when I rotate the device.. up in another function so it's not all lost on device rotation or 2. Make it so onCreate is not called again and the layout.. to just portrait so that onCreate is not called. android rotation android activity share improve this question Using the Application..

How can I use the animation framework inside the canvas?

http://stackoverflow.com/questions/4938822/how-can-i-use-the-animation-framework-inside-the-canvas

100 Initial vertical position. angle 0 Start value for rotation angle. @Override public void onSizeChanged int w int h int oldw.. 100 Initial vertical position angle 0 Start value for the rotation angle bgrScroll 0 Background scroll position dBgrY 1 Scrolling..

Strange behavior with android orientation sensor

http://stackoverflow.com/questions/5577334/strange-behavior-with-android-orientation-sensor

problem even before applying the sensor values to the 3D rotation. When I try to change the 'pitch' value by rotating the device.. 'pitch' axis the 'yaw' value also changes according to the rotation of the pitch. It seems completely unreasonable to me. Could.. help me I'm stuck in this problem for a month. android rotation orientation accelerometer sensor share improve this question..

Android Camera Preview Rotation

http://stackoverflow.com/questions/10385147/android-camera-preview-rotation

Camera Preview Rotation According to Android Developer Site after android 2.2 there.. rotation activity.getWindowManager .getDefaultDisplay .getRotation int degrees 0 switch rotation case Surface.ROTATION_0 degrees..

Android Fragments Retaining Data

http://stackoverflow.com/questions/11853389/android-fragments-retaining-data

activity goes through an onCreate Destroy cycle like from Rotation In our setup we have potentially large lists loaded from our..

OpenGL ES Android Matrix Transformations

http://stackoverflow.com/questions/13480043/opengl-es-android-matrix-transformations

4000L float mAngle 0.090f int time Matrix.setRotateM mRotationMatrix 0 mAngle 0 0 1.0f Combine rotation and translation avoid.. on the right and left side of multiplyMM see 2 Combine Rotation and Translation matrices mTempMatrix mModelMatrix.clone Matrix.multiplyMM.. Matrix.multiplyMM mModelMatrix 0 mTempMatrix 0 mRotationMatrix 0 Combine the model matrix with the projection and camera..

Convert magnetic field X, Y, Z values from device into global reference frame

http://stackoverflow.com/questions/15315129/convert-magnetic-field-x-y-z-values-from-device-into-global-reference-frame

Rs new float 16 float I new float 16 if SensorManager.getRotationMatrix Rs I accelerometerValues geomagneticValues float RsInv.. z to the basis w_1 w_2 w_3 which in Android is called the Rotation matrix . Then the coordinates of a vector v with respect to.. . In android the rotation matrix is obtained by calling getRotationMatrix float R float I float gravity float geomagnetic and we..

How to handle an AsyncTask during Screen Rotation?

http://stackoverflow.com/questions/2620917/how-to-handle-an-asynctask-during-screen-rotation

to handle an AsyncTask during Screen Rotation I read a lot on how to save my instance state or how to deal..

Android: Disable rotations by 90°, but enable rotations by 180°

http://stackoverflow.com/questions/4371631/android-disable-rotations-by-90-but-enable-rotations-by-180

my app is displayed correctly in all four positions. Rotation the device by 180° flips the UI vertically resp. horizontally... INFO WindowManager 1290 Setting rotation to 1 animFlags 0 Rotation is a value between 0 and 3 representing the current orientation...

Android VideoView orientation change with buffered video

http://stackoverflow.com/questions/4434027/android-videoview-orientation-change-with-buffered-video

X1 Y0 W403 H225 12 13 15 37 35.561 1262 1268 I TIOverlay Rotation 90 12 13 15 37 35.561 1262 1268 I Overlay v4l2_overlay_set_position.. X138 Y0 W266 H225 12 13 15 43 00.171 1262 1268 I TIOverlay Rotation 90 12 13 15 43 00.179 1262 1268 I Overlay v4l2_overlay_set_position..

How to set Android camera orientation properly?

http://stackoverflow.com/questions/4645960/how-to-set-android-camera-orientation-properly

this question From other member and my problem Camera Rotation issue depend on different Devices and certain Version. Version.. Devices and certain Version. Version 1.6 to fix the Rotation Issue and it is good for most of devices if getResources .getConfiguration..

Transforming accelerometer's data from device's coordinates to real world coordinates

http://stackoverflow.com/questions/5464847/transforming-accelerometers-data-from-devices-coordinates-to-real-world-coordi

float R new float 16 float I new float 16 SensorManager.getRotationMatrix R I accelerometervalues geomagneticmatrix What should.. . Azimuth pitch and roll in orientationvalues . Rotation matrix R . Inclination matrix I . I think all the necessary..

Strange behavior with android orientation sensor

http://stackoverflow.com/questions/5577334/strange-behavior-with-android-orientation-sensor

to rotate 3D Cube using orientation sensor values using getRotation method. Some unexpected behaviors are observed when the android.. instead of Euler angles in my motion sensing application. Rotation matrices http gentlenav.googlecode.com files DCMDraft2.pdf Rotation.. matrices http gentlenav.googlecode.com files DCMDraft2.pdf Rotation matrices work like a charm. Quaternions are also very popular..

Fragments, DialogFragment, and Screen Rotation

http://stackoverflow.com/questions/8235080/fragments-dialogfragment-and-screen-rotation

DialogFragment and Screen Rotation I have an Activity that calls setContentView with this XML..

rotation and scaling using multi touch in android

http://stackoverflow.com/questions/8515709/rotation-and-scaling-using-multi-touch-in-android

Math.atan2 delta_y delta_x if Constant.TRACE Log.d Rotation ~~~~~~~~~~~~~~~~~ delta_x ## delta_y ## radians ## Math.toDegrees..

Vertical (rotated) label in Android

http://stackoverflow.com/questions/1258275/vertical-rotated-label-in-android

gravity bottom then it's drawn from bottom to top. Technically it fools underlying TextView to think that it's normal rotation swapping width height in few places while drawing it rotated. It works fine also when used in an xml layout. EDIT posting..

Detect rotation of Android phone in the browser with javascript

http://stackoverflow.com/questions/1649086/detect-rotation-of-android-phone-in-the-browser-with-javascript

rotation of Android phone in the browser with javascript I know that in Safari on an iPhone you can detect the screen's orientation.. for the angle. Is this possible in the browser on Android phones Update To be clear I am asking whether the rotation of an android device can be detected by JavaScript running on a standard web page. It is possible on an iPhone and I wondered..

Changing Locale within the app itself

http://stackoverflow.com/questions/2264874/changing-locale-within-the-app-itself

and found out that the method is not exactly correct. It works but only until any configuration change e.g. screen rotation and only in that particular Activity. Playing with a code for a while I have ended up with the following approach I have.. .getDisplayMetrics This code ensures that every Activity will have custom locale set and it will not be reset on rotation and other events. I have also spent a lot of time trying to make the preference change to be applied immediately but didn't..

Android - Camera preview is sideways

http://stackoverflow.com/questions/3841122/android-camera-preview-is-sideways

Cannot start preview e This was on an HTC Desire and I had to initially put in logging statements in each of the rotation checks to say what the rotation was and then debugged on the device and watched the logCat output while I rotated the device... was on an HTC Desire and I had to initially put in logging statements in each of the rotation checks to say what the rotation was and then debugged on the device and watched the logCat output while I rotated the device. For the HTC Desire 0 was the.. COUNTER CLOCKWISE I had assumed it would have been clockwise . In the code you'll see I didn't need to do any display rotation when the phone was at 90 or 180 degrees the device seemed to handle this itself. Only one point not working properly The..

Implement page curl on android?

http://stackoverflow.com/questions/3912849/implement-page-curl-on-android

asin vi.x R sin theta MAGIC v1.x r sin beta v1.y R A r 1 cos beta sin theta v1.z r 1 cos beta cos theta Apply a basic rotation transform around the y axis to rotate the curled page. These two steps could be combined through simple substitution but..

Activity restart on rotation Android

http://stackoverflow.com/questions/456211/activity-restart-on-rotation-android

restart on rotation Android In my Android application when I rotate the device slide out the keyboard then my activity is restarted onCreate.. onCreate method so I need either 1. Put all the initial setting up in another function so it's not all lost on device rotation or 2. Make it so onCreate is not called again and the layout just adjusts or 3. Limit the app to just portrait so that onCreate.. called again and the layout just adjusts or 3. Limit the app to just portrait so that onCreate is not called. android rotation android activity share improve this question Using the Application Class Depending on what you're doing in your initialization..

How can I use the animation framework inside the canvas?

http://stackoverflow.com/questions/4938822/how-can-i-use-the-animation-framework-inside-the-canvas

acc 0.2f acceleration dY 0 vertical speed initialY 100 Initial vertical position. angle 0 Start value for rotation angle. @Override public void onSizeChanged int w int h int oldw int oldh super.onSizeChanged w h oldw oldh screenW w screenH.. acc 0.2f Acceleration dY 0 vertical speed initialY 100 Initial vertical position angle 0 Start value for the rotation angle bgrScroll 0 Background scroll position dBgrY 1 Scrolling background speed fpsPaint.setTextSize 30 Set thread getHolder..

Strange behavior with android orientation sensor

http://stackoverflow.com/questions/5577334/strange-behavior-with-android-orientation-sensor

gimbal lock. The only difference is I'm experiencing the very problem even before applying the sensor values to the 3D rotation. When I try to change the 'pitch' value by rotating the device around only 'pitch' axis the 'yaw' value also changes according.. change the 'pitch' value by rotating the device around only 'pitch' axis the 'yaw' value also changes according to the rotation of the pitch. It seems completely unreasonable to me. Could somebody help me I'm stuck in this problem for a month. android.. pitch. It seems completely unreasonable to me. Could somebody help me I'm stuck in this problem for a month. android rotation orientation accelerometer sensor share improve this question This is a common problem with yaw pitch and roll. You cannot..

Android Camera Preview Rotation

http://stackoverflow.com/questions/10385147/android-camera-preview-rotation

Camera Preview Rotation According to Android Developer Site after android 2.2 there is the function setDisplayOrientation to adjust the camera.. android.hardware.Camera.getCameraInfo cameraId info int rotation activity.getWindowManager .getDefaultDisplay .getRotation int degrees 0 switch rotation case Surface.ROTATION_0 degrees 0 break case Surface.ROTATION_90 degrees 90 break case Surface.ROTATION_180..

Android Fragments Retaining Data

http://stackoverflow.com/questions/11853389/android-fragments-retaining-data

Data How does one best retain data within a Fragment as its activity goes through an onCreate Destroy cycle like from Rotation In our setup we have potentially large lists loaded from our servers into the fragments custom list adapter and we want..

OpenGL ES Android Matrix Transformations

http://stackoverflow.com/questions/13480043/opengl-es-android-matrix-transformations

for the triangle long time SystemClock.uptimeMillis 4000L float mAngle 0.090f int time Matrix.setRotateM mRotationMatrix 0 mAngle 0 0 1.0f Combine rotation and translation avoid using mModelMatrix as the same matrix on the right and left.. and translation avoid using mModelMatrix as the same matrix on the right and left side of multiplyMM see 2 Combine Rotation and Translation matrices mTempMatrix mModelMatrix.clone Matrix.multiplyMM mModelMatrix 0 mTempMatrix 0 mRotationMatrix 0.. Rotation and Translation matrices mTempMatrix mModelMatrix.clone Matrix.multiplyMM mModelMatrix 0 mTempMatrix 0 mRotationMatrix 0 Combine the model matrix with the projection and camera view again avoid using mModelMatrix as the same matrix on..

Convert magnetic field X, Y, Z values from device into global reference frame

http://stackoverflow.com/questions/15315129/convert-magnetic-field-x-y-z-values-from-device-into-global-reference-frame

if accelerometerValues null geomagneticValues null float Rs new float 16 float I new float 16 if SensorManager.getRotationMatrix Rs I accelerometerValues geomagneticValues float RsInv new float 16 Matrix.invertM RsInv 0 Rs 0 float resultVec.. products the change of basis matrix R from the basis x y z to the basis w_1 w_2 w_3 which in Android is called the Rotation matrix . Then the coordinates of a vector v with respect to the basis w_1 w_2 w_3 is obtained by multiply R with the coordinates.. by the TYPE_MAGNETIC_FIELD sensor and similarly for a . In android the rotation matrix is obtained by calling getRotationMatrix float R float I float gravity float geomagnetic and we normally pass in the returned accelerometer values for the..

How to handle an AsyncTask during Screen Rotation?

http://stackoverflow.com/questions/2620917/how-to-handle-an-asynctask-during-screen-rotation

to handle an AsyncTask during Screen Rotation I read a lot on how to save my instance state or how to deal with my activity getting destroyed during screen rotation...

Android: Disable rotations by 90°, but enable rotations by 180°

http://stackoverflow.com/questions/4371631/android-disable-rotations-by-90-but-enable-rotations-by-180

upside down. Without the android screenOrientation attribute my app is displayed correctly in all four positions. Rotation the device by 180° flips the UI vertically resp. horizontally. When rotation the device the following log messages are created.. the following log messages are created maybe this helps ... INFO WindowManager 1290 Setting rotation to 1 animFlags 0 Rotation is a value between 0 and 3 representing the current orientation. Summarized Is it possible to enable an app to support both..

Android VideoView orientation change with buffered video

http://stackoverflow.com/questions/4434027/android-videoview-orientation-change-with-buffered-video

12 13 15 37 35.561 1262 1268 I TIOverlay Adjusted Position X1 Y0 W403 H225 12 13 15 37 35.561 1262 1268 I TIOverlay Rotation 90 12 13 15 37 35.561 1262 1268 I Overlay v4l2_overlay_set_position w 480 h 224 12 13 15 37 35.561 1262 1268 I Overlay v4l2_overlay_set_position.. 12 13 15 43 00.171 1262 1268 I TIOverlay Adjusted Position X138 Y0 W266 H225 12 13 15 43 00.171 1262 1268 I TIOverlay Rotation 90 12 13 15 43 00.179 1262 1268 I Overlay v4l2_overlay_set_position w 480 h 224 12 13 15 43 00.179 1262 1268 I Overlay v4l2_overlay_set_position..

How to set Android camera orientation properly?

http://stackoverflow.com/questions/4645960/how-to-set-android-camera-orientation-properly

android camera orientation surfaceview share improve this question From other member and my problem Camera Rotation issue depend on different Devices and certain Version. Version 1.6 to fix the Rotation Issue and it is good for most of.. member and my problem Camera Rotation issue depend on different Devices and certain Version. Version 1.6 to fix the Rotation Issue and it is good for most of devices if getResources .getConfiguration .orientation Configuration.ORIENTATION_PORTRAIT..

Transforming accelerometer's data from device's coordinates to real world coordinates

http://stackoverflow.com/questions/5464847/transforming-accelerometers-data-from-devices-coordinates-to-real-world-coordi

break if geomagneticmatrix null accelerometervalues null float R new float 16 float I new float 16 SensorManager.getRotationMatrix R I accelerometervalues geomagneticmatrix What should I do here to transform the components of accelerometervalues.. . A vector of magnetic field values in geomagneticmatrix . Azimuth pitch and roll in orientationvalues . Rotation matrix R . Inclination matrix I . I think all the necessary information is there azimuth pitch and roll should describe..

Strange behavior with android orientation sensor

http://stackoverflow.com/questions/5577334/strange-behavior-with-android-orientation-sensor

with android orientation sensor Currently I'm trying to rotate 3D Cube using orientation sensor values using getRotation method. Some unexpected behaviors are observed when the android device is rotated above some bounds. For instance if I make.. video explains why see at 38 25. I use rotation matrices instead of Euler angles in my motion sensing application. Rotation matrices http gentlenav.googlecode.com files DCMDraft2.pdf Rotation matrices work like a charm. Quaternions are also very.. of Euler angles in my motion sensing application. Rotation matrices http gentlenav.googlecode.com files DCMDraft2.pdf Rotation matrices work like a charm. Quaternions are also very popular and said to be the most stable. This answer was copied from..

Fragments, DialogFragment, and Screen Rotation

http://stackoverflow.com/questions/8235080/fragments-dialogfragment-and-screen-rotation

DialogFragment and Screen Rotation I have an Activity that calls setContentView with this XML LinearLayout xmlns android http schemas.android.com apk res..

rotation and scaling using multi touch in android

http://stackoverflow.com/questions/8515709/rotation-and-scaling-using-multi-touch-in-android

1 double delta_y event.getY 0 event.getY 1 double radians Math.atan2 delta_y delta_x if Constant.TRACE Log.d Rotation ~~~~~~~~~~~~~~~~~ delta_x ## delta_y ## radians ## Math.toDegrees radians return float Math.toDegrees radians Try this..

Camera preview on Android - strange on Samsung Galaxy S

http://stackoverflow.com/questions/3213741/camera-preview-on-android-strange-on-samsung-galaxy-s

static final int IMAGE_HEIGHT 384 private static final String ORIENTATION orientation private static final String ROTATION rotation private static final String PORTRAIT portrait private static final String LANDSCAPE landscape public void surfaceCreated.. void surfaceCreated SurfaceHolder holder camera Camera.open Surface.setOrientation Display.DEFAULT_DISPLAY Surface.ROTATION_90 Parameters p camera.getParameters p.setPictureSize IMAGE_WIDTH IMAGE_HEIGHT p.set ORIENTATION PORTRAIT p.set ROTATION.. Parameters p camera.getParameters p.setPictureSize IMAGE_WIDTH IMAGE_HEIGHT p.set ORIENTATION PORTRAIT p.set ROTATION 90 p.setPreviewSize 640 480 Camera.Size s p.getSupportedPreviewSizes .get 0 Log.d APP preview params s.width s.height p.setPreviewSize..

Why isn't my fragments onSaveInstanceState() being called?

http://stackoverflow.com/questions/9405577/why-isnt-my-fragments-onsaveinstancestate-being-called

using the pre 3.0 support package for fragments brought in through ActionBarSherlock. LogCat gives me BEFORE SCREEN ROTATION PORTRAIT 02 23 11 45 58.015 I TestFragment 22629 onCreate NULL 02 23 11 45 58.015 I TestFragment 22629 onCreateView 02 23.. 58.015 I TestFragment 22629 onCreateView 02 23 11 45 58.035 I TestFragment 22629 onActivityCreated NULL AFTER SCREEN ROTATION LANDSCAPE 02 23 11 46 00.615 I TestFragment 22629 onCreate NULL 02 23 11 46 00.615 I TestFragment 22629 onCreateView 02..

How to play multiple video files simultaneously in one layout side by side in different view in Android

http://stackoverflow.com/questions/9834882/how-to-play-multiple-video-files-simultaneously-in-one-layout-side-by-side-in-di

I SEC_Overlay 2689 Nothing to do 04 10 19 23 38.090 E VideoMIO 2573 AndroidSurfaceOutput setParametersSync VIDEO ROTATION 0 04 10 19 23 38.090 E VideoMIO 2573 AndroidSurfaceOutput setParametersSync VIDEO RENDERER 1 04 10 19 23 38.090 D SEC_Overlay.. 2573 Overlay create failed retrying 04 10 19 23 38.230 E VideoMIO 2573 AndroidSurfaceOutput setParametersSync VIDEO ROTATION 0 04 10 19 23 38.230 E VideoMIO 2573 AndroidSurfaceOutput setParametersSync VIDEO RENDERER 1 04 10 19 23 38.230 D SEC_Overlay..