edu.dhbw.andar
Class AndARActivity

java.lang.Object
  extended by Activity
      extended by edu.dhbw.andar.AndARActivity
All Implemented Interfaces:
java.lang.Thread.UncaughtExceptionHandler
Direct Known Subclasses:
CustomActivity

public abstract class AndARActivity
extends Activity
implements java.lang.Thread.UncaughtExceptionHandler


Constructor Summary
AndARActivity()
           
AndARActivity(boolean startPreviewRightAway)
           
 
Method Summary
 void disableScreenTurnOff()
          Avoid that the screen get's turned off by the system.
 ARToolkit getArtoolkit()
           
 SurfaceView getSurfaceView()
           
 void onCreate(Bundle savedInstanceState)
          Called when the activity is first created.
 void setFullscreen()
          Maximize the application.
 void setNonARRenderer(OpenGLRenderer customRenderer)
          Set a renderer that draws non AR stuff.
 void setNoTitle()
           
 void setOrientation()
          Set's the orientation to landscape, as this is needed by AndAR.
 void startPreview()
          Open the camera and start detecting markers.
 void surfaceChanged(SurfaceHolder holder, int format, int width, int height)
           
 void surfaceCreated(SurfaceHolder holder)
           
 void surfaceDestroyed(SurfaceHolder holder)
           
 Bitmap takeScreenshot()
          Take a screenshot.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.lang.Thread.UncaughtExceptionHandler
uncaughtException
 

Constructor Detail

AndARActivity

public AndARActivity()

AndARActivity

public AndARActivity(boolean startPreviewRightAway)
Method Detail

onCreate

public void onCreate(Bundle savedInstanceState)
Called when the activity is first created.


setNonARRenderer

public void setNonARRenderer(OpenGLRenderer customRenderer)
Set a renderer that draws non AR stuff. Optional, may be set to null or omited. and setups lighting stuff.

Parameters:
customRenderer -

disableScreenTurnOff

public void disableScreenTurnOff()
Avoid that the screen get's turned off by the system.


setOrientation

public void setOrientation()
Set's the orientation to landscape, as this is needed by AndAR.


setFullscreen

public void setFullscreen()
Maximize the application.


setNoTitle

public void setNoTitle()

startPreview

public void startPreview()
Open the camera and start detecting markers. note: You must assure that the preview surface already exists!


surfaceChanged

public void surfaceChanged(SurfaceHolder holder,
                           int format,
                           int width,
                           int height)

surfaceCreated

public void surfaceCreated(SurfaceHolder holder)

surfaceDestroyed

public void surfaceDestroyed(SurfaceHolder holder)

getArtoolkit

public ARToolkit getArtoolkit()
Returns:
a the instance of the ARToolkit.

takeScreenshot

public Bitmap takeScreenshot()
Take a screenshot. Must not be called from the GUI thread, e.g. from methods like onCreateOptionsMenu and onOptionsItemSelected. You have to use a asynctask for this purpose.

Returns:
the screenshot

getSurfaceView

public SurfaceView getSurfaceView()
Returns:
the OpenGL surface.