@@ -0,0 +1,2140 @@
+package com.ss12.camacc.activity;%0A%0Aimport android.app.Activity;%0Aimport android.hardware.SensorManager;%0Aimport android.os.Bundle;%0Aimport android.util.Log;%0Aimport android.view.OrientationEventListener;%0A%0A/**%0A * Listens for orientation changes and sets a boolean to true if the phone%0A * is within set levels.%0A */%0Apublic class CameraOrientation extends Activity %7B%0A%0A    /**%0A     * OrientationEventListener object%0A     */%0A    private OrientationEventListener sensorListener;%0A    /**%0A     * A boolean that is true if the phone orientation is leveled.%0A     */%0A    private boolean balanced = false;%0A%0A    /** Called when the activity is first created. */%0A    @Override%0A    public void onCreate(Bundle savedInstanceState) %7B%0A        super.onCreate(savedInstanceState);%0A        /**%0A         * Listens for the orientation of the phone.%0A         */%0A        sensorListener = new OrientationEventListener(this, SensorManager.SENSOR_DELAY_NORMAL) %7B%0A            @Override%0A            public void onOrientationChanged(final int orientation) %7B%0A                CameraOrientation.this.runOnUiThread(%0A                        new Runnable() %7B%0A                            @Override%0A                            public void run() %7B%0A                                //True when at certain orientations%0A                                if((orientation %3E 355) %7C%7C (orientation %3C 5) %7C%7C ((orientation %3E 85)%0A                                        && (orientation %3C 95)) %7C%7C ((orientation %3E 175) && (orientation %3C 185))%0A                                        %7C%7C((orientation %3E 265) &&(orientation %3C 285))) %7B%0A%0A                                    balanced = true;%0A                                %7D%0A                                else %7B%0A                                    balanced = false;%0A                                %7D%0A                            %7D//end run%0A                        %7D);//end runOnUiThread%0A            %7D//end onOrientationChanged%0A        %7D;//end OrientationEventListener%0A        sensorListener.enable(); //Enables Listener%0A    %7D//end onCreate%0A%0A    public boolean getBalanced() %7B%0A        return balanced;%0A    %7D//end getBalanced%0A%0A%7D//end CameraOrientation class%0A

Create CameraOrientation.java