¡@

Home 

2014/10/16 ¤W¤È 08:25:29

android Programming Glossary: surface.rotation_0

How do I get the CURRENT orientation (ActivityInfo.SCREEN_ORIENTATION_*) of an Android device?

http://stackoverflow.com/questions/10380989/how-do-i-get-the-current-orientation-activityinfo-screen-orientation-of-an-a

the device's natural orientation is portrait if rotation Surface.ROTATION_0 rotation Surface.ROTATION_180 height width rotation Surface.ROTATION_90.. Surface.ROTATION_270 width height switch rotation case Surface.ROTATION_0 orientation ActivityInfo.SCREEN_ORIENTATION_PORTRAIT break.. or if the device is square else switch rotation case Surface.ROTATION_0 orientation ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE break..

Android Camera Preview Rotation

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

.getRotation int degrees 0 switch rotation case Surface.ROTATION_0 degrees 0 break case Surface.ROTATION_90 degrees 90 break case..

EXIF orientation tag value always 0 for image taken with portrait camera app android

http://stackoverflow.com/questions/13245556/exif-orientation-tag-value-always-0-for-image-taken-with-portrait-camera-app-and

Build.VERSION.SDK 8 int degrees 0 switch rotation case Surface.ROTATION_0 degrees 0 break case Surface.ROTATION_90 degrees 90 break..

Android Compass that can Compensate for Tilt and Pitch

http://stackoverflow.com/questions/16317599/android-compass-that-can-compensate-for-tilt-and-pitch

float screen_adjustment 0 switch rotation case Surface.ROTATION_0 screen_adjustment 0 break case Surface.ROTATION_90 screen_adjustment..

Rotating phone quickly 180 degrees, camera preview turns upside down

http://stackoverflow.com/questions/19532599/rotating-phone-quickly-180-degrees-camera-preview-turns-upside-down

.getRotation int degrees 0 switch rotation case Surface.ROTATION_0 degrees 0 Constant.result 0 break case Surface.ROTATION_90 degrees..

Android - Camera preview is sideways

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

WINDOW_SERVICE .getDefaultDisplay if display.getRotation Surface.ROTATION_0 parameters.setPreviewSize height width mCamera.setDisplayOrientation..

How to check device natural (default) orientation on Android (i.e. get landscape for e.g., Motorola Charm or Flipout)

http://stackoverflow.com/questions/4553650/how-to-check-device-natural-default-orientation-on-android-i-e-get-landscape

windowManager.getDefaultDisplay .getRotation if rotation Surface.ROTATION_0 rotation Surface.ROTATION_180 config.orientation Configuration.ORIENTATION_LANDSCAPE..

how to detect orientation of android device?

http://stackoverflow.com/questions/5112118/how-to-detect-orientation-of-android-device

from its natural orientation. The returned value may be Surface.ROTATION_0 no rotation Surface.ROTATION_90 Surface.ROTATION_180 or Surface.ROTATION_270..

android camera surfaceview orientation

http://stackoverflow.com/questions/5157984/android-camera-surfaceview-orientation

.getDefaultDisplay if display.getOrientation Surface.ROTATION_0 landscape oriented devices else portrait oriented device Full.. .getDefaultDisplay if display.getOrientation Surface.ROTATION_0 landscape oriented devices if orientation 315 orientation 45..

Screen orientation lock

http://stackoverflow.com/questions/6599770/screen-orientation-lock

.getDefaultDisplay .getOrientation if rotation Surface.ROTATION_0 rotation Surface.ROTATION_90 if orientation Configuration.ORIENTATION_PORTRAIT.. .getDefaultDisplay .getRotation if rotation android.view.Surface.ROTATION_0 rotation android.view.Surface.ROTATION_90 setRequestedOrientation..

Android natural sensor orientation help

http://stackoverflow.com/questions/6605986/android-natural-sensor-orientation-help

y SensorManager.AXIS_MINUS_X break case Surface.ROTATION_0 default break SensorManager.remapCoordinateSystem sensorEvent.values..

Android Camera will not work. startPreview fails

http://stackoverflow.com/questions/7942378/android-camera-will-not-work-startpreview-fails

.getDefaultDisplay switch display.getRotation case Surface.ROTATION_0 previewWidth mPreviewSize.height previewHeight mPreviewSize.width..

How do I get the CURRENT orientation (ActivityInfo.SCREEN_ORIENTATION_*) of an Android device?

http://stackoverflow.com/questions/10380989/how-do-i-get-the-current-orientation-activityinfo-screen-orientation-of-an-a

dm.widthPixels int height dm.heightPixels int orientation if the device's natural orientation is portrait if rotation Surface.ROTATION_0 rotation Surface.ROTATION_180 height width rotation Surface.ROTATION_90 rotation Surface.ROTATION_270 width height switch.. height width rotation Surface.ROTATION_90 rotation Surface.ROTATION_270 width height switch rotation case Surface.ROTATION_0 orientation ActivityInfo.SCREEN_ORIENTATION_PORTRAIT break case Surface.ROTATION_90 orientation ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE.. break if the device's natural orientation is landscape or if the device is square else switch rotation case Surface.ROTATION_0 orientation ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE break case Surface.ROTATION_90 orientation ActivityInfo.SCREEN_ORIENTATION_PORTRAIT..

Android Camera Preview Rotation

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

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 degrees 180 break case Surface.ROTATION_270..

EXIF orientation tag value always 0 for image taken with portrait camera app android

http://stackoverflow.com/questions/13245556/exif-orientation-tag-value-always-0-for-image-taken-with-portrait-camera-app-and

.getDefaultDisplay .getRotation if Integer.parseInt Build.VERSION.SDK 8 int degrees 0 switch rotation case Surface.ROTATION_0 degrees 0 break case Surface.ROTATION_90 degrees 90 break case Surface.ROTATION_180 degrees 180 break case Surface.ROTATION_270..

Android Compass that can Compensate for Tilt and Pitch

http://stackoverflow.com/questions/16317599/android-compass-that-can-compensate-for-tilt-and-pitch

rotation m_activity.getWindowManager .getDefaultDisplay .getRotation float screen_adjustment 0 switch rotation case Surface.ROTATION_0 screen_adjustment 0 break case Surface.ROTATION_90 screen_adjustment float Math.PI 2 break case Surface.ROTATION_180 screen_adjustment..

Rotating phone quickly 180 degrees, camera preview turns upside down

http://stackoverflow.com/questions/19532599/rotating-phone-quickly-180-degrees-camera-preview-turns-upside-down

info int rotation activity.getWindowManager .getDefaultDisplay .getRotation int degrees 0 switch rotation case Surface.ROTATION_0 degrees 0 Constant.result 0 break case Surface.ROTATION_90 degrees 90 Constant.result 90 break case Surface.ROTATION_180..

Android - Camera preview is sideways

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

Display display WindowManager getSystemService WINDOW_SERVICE .getDefaultDisplay if display.getRotation Surface.ROTATION_0 parameters.setPreviewSize height width mCamera.setDisplayOrientation 90 if display.getRotation Surface.ROTATION_90 ..

How to check device natural (default) orientation on Android (i.e. get landscape for e.g., Motorola Charm or Flipout)

http://stackoverflow.com/questions/4553650/how-to-check-device-natural-default-orientation-on-android-i-e-get-landscape

config getResources .getConfiguration int rotation windowManager.getDefaultDisplay .getRotation if rotation Surface.ROTATION_0 rotation Surface.ROTATION_180 config.orientation Configuration.ORIENTATION_LANDSCAPE rotation Surface.ROTATION_90 rotation..

how to detect orientation of android device?

http://stackoverflow.com/questions/5112118/how-to-detect-orientation-of-android-device

From the documentation Returns the rotation of the screen from its natural orientation. The returned value may be Surface.ROTATION_0 no rotation Surface.ROTATION_90 Surface.ROTATION_180 or Surface.ROTATION_270 . For example if a device has a naturally tall..

android camera surfaceview orientation

http://stackoverflow.com/questions/5157984/android-camera-surfaceview-orientation

Display display WindowManager getSystemService WINDOW_SERVICE .getDefaultDisplay if display.getOrientation Surface.ROTATION_0 landscape oriented devices else portrait oriented device Full code a bit wasteful by LC but easily demonstrates the approach.. Display display WindowManager getSystemService WINDOW_SERVICE .getDefaultDisplay if display.getOrientation Surface.ROTATION_0 landscape oriented devices if orientation 315 orientation 45 if mOrientation ORIENTATION_LANDSCAPE_NORMAL mOrientation..

Screen orientation lock

http://stackoverflow.com/questions/6599770/screen-orientation-lock

.getConfiguration .orientation final int rotation getWindowManager .getDefaultDisplay .getOrientation if rotation Surface.ROTATION_0 rotation Surface.ROTATION_90 if orientation Configuration.ORIENTATION_PORTRAIT setRequestedOrientation ActivityInfo.SCREEN_ORIENTATION_PORTRAIT.. else int rotation getWindowManager .getDefaultDisplay .getRotation if rotation android.view.Surface.ROTATION_0 rotation android.view.Surface.ROTATION_90 setRequestedOrientation ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE else setRequestedOrientation..

Android natural sensor orientation help

http://stackoverflow.com/questions/6605986/android-natural-sensor-orientation-help

break case Surface.ROTATION_270 x SensorManager.AXIS_MINUS_Y y SensorManager.AXIS_MINUS_X break case Surface.ROTATION_0 default break SensorManager.remapCoordinateSystem sensorEvent.values x y new float @Override public void onAccuracyChanged..

Android Camera will not work. startPreview fails

http://stackoverflow.com/questions/7942378/android-camera-will-not-work-startpreview-fails

WindowManager mContext.getSystemService Context.WINDOW_SERVICE .getDefaultDisplay switch display.getRotation case Surface.ROTATION_0 previewWidth mPreviewSize.height previewHeight mPreviewSize.width mCamera.setDisplayOrientation 90 break case Surface.ROTATION_90..