blip
0.1
|
An abstract base class for all "native" (C++) Android activities. More...
#include <NativeActivity.hpp>
Public Member Functions | |
virtual | ~NativeActivity () |
Destructor. More... | |
Protected Member Functions | |
NativeActivity (NativeContext context) | |
Construct a new NativeActivity. More... | |
void | sleep (timespan_ms_t msec) |
virtual void | onCreate (ccxx::ByteBuffer *buffer) |
This method is called when the activity is being created. More... | |
virtual void | onStart () |
This method is called when the activity is being started. More... | |
virtual void | onResume () |
This method is called when the activity is being resumed. More... | |
virtual void | onPause () |
This method is called when the activity is being paused. More... | |
virtual void | onStop () |
This method is called when the activity is being stopped. More... | |
virtual void | onDestroy () |
This method is called when the activity is about to be destroyed. More... | |
virtual void | onSaveInstanceState (ccxx::ByteBuffer *buffer) |
Called when the activity should save its instance state. More... | |
virtual void | onConfigurationChanged () |
This method is called when the device configuration has changed. More... | |
void | finish () |
Finish this activity. More... | |
virtual bool | onKeyEvent (const KeyEvent &event) |
This method is called when a KeyEvent is received. More... | |
virtual bool | onMotionEvent (const MotionEvent &event) |
This method is called when a MotionEvent is received. More... | |
virtual void | onSensorEvent (const SensorEvent &event) |
This method is called when a SensorEvent is received. More... | |
virtual void | onTimerEvent (const TimerEvent &event) |
This method is called when a TimerEvent has been received. More... | |
virtual void | onIdle ()=0 |
Idle callback. More... | |
virtual void | onWindowFocusChanged (bool hasFocus) |
This method is called when the activity's window gains or loses input focus. More... | |
virtual void | onWindowCreated () |
This method is called when the activity's window has been created. More... | |
virtual void | onWindowDestroyed () |
This method is called when the activity's window is about to be destroyed. More... | |
virtual void | onWindowResized () |
This method is called when the activity's window has changed size. More... | |
virtual void | onWindowRedrawNeeded () |
This method is called when the activity's window needs to be redrawn. More... | |
virtual void | onContentRectChanged (const Rectangle &rect) |
This method is called when the rectangle in the activity's window in which content should be placed has changed. More... | |
virtual void | onLowMemory () |
This method is called when the system is running low on memory. More... | |
AssetManager * | getAssetManager () |
Get the asset manager for this activity. More... | |
const DeviceConfiguration * | getDeviceConfiguration () |
Get the current device configuration. More... | |
ccxx::JavaVirtualMachine * | getJavaVirtualMachine () |
Get the Java Virtual Machine for this activity. More... | |
RenderingContext * | getRenderingContext () |
Get the rendering context for this activity. More... | |
SensorManager * | getSensorManager () |
Get the SensorManager for this activity. More... | |
StorageManager * | getStorageManager () |
Get the StorageManager for this activity. More... | |
TimerManager * | getTimerManager () |
Get the timer manager for this activity. More... | |
Window * | getWindow () |
Get the native Window for this activity. More... | |
const Intent & | getIntent () |
Get the Intent that this activity was launched with. More... | |
Intent * | newIntent () |
Construct a new Intent object. More... | |
void | startActivity (Intent *intent) |
Start a new activity with the given intent. More... | |
ccxx::String | getInternalDataPath () const |
Get the filesystem path to application-private data in the device's internal storage (e.g., onboard flash memory). More... | |
ccxx::String | getExternalDataPath () const |
Get the filesystem path to shared data in the device's external storage (e.g., removable flash media). More... | |
void | showSoftInput (bool forced=false) |
Display the soft input method (e.g., a virtual on-screen keyboard). More... | |
void | hideSoftInput () |
Hide the soft input method (e.g., a virtual on-screen keyboard). More... | |
An abstract base class for all "native" (C++) Android activities.
This class provides a complete framework for implementing native Android applications, including the following facilities:
Subclasses must provide a constructor which accepts a single argument, the opaque NativeContext
, which must be passed directly to the superclass constructor.
|
virtual |
Destructor.
|
protected |
Construct a new NativeActivity.
context | The native context; this is an opaque value which must be passed along by subclasses. |
|
protected |
Finish this activity.
Notifies the system that this activity has completed and should be terminated.
|
protected |
Get the asset manager for this activity.
|
inlineprotected |
Get the current device configuration.
|
protected |
Get the filesystem path to shared data in the device's external storage (e.g., removable flash media).
|
protected |
Get the filesystem path to application-private data in the device's internal storage (e.g., onboard flash memory).
|
inlineprotected |
Get the Java Virtual Machine for this activity.
|
inlineprotected |
Get the rendering context for this activity.
|
protected |
Get the SensorManager for this activity.
The SensorManager is not initialized until the first call to this method.
|
protected |
Get the StorageManager for this activity.
The StorageManager is not initialized until the first call to this method.
|
protected |
Get the timer manager for this activity.
The TimerManager is not initialized until the first call to this method.
|
protected |
Hide the soft input method (e.g., a virtual on-screen keyboard).
|
protected |
Construct a new Intent object.
The caller must take ownership of the returned object. This is intended for use in conjunction with startActivity() to start a new activity.
JavaException | If an error occurs while instantiating the new object. |
|
protectedvirtual |
This method is called when the device configuration has changed.
The new configuration can be obtained by calling getDeviceConfiguration().
The default implementation does nothing.
|
protectedvirtual |
This method is called when the rectangle in the activity's window in which content should be placed has changed.
The default implementation does nothing.
rect | The bounds of the new content rectangle. |
|
protectedvirtual |
This method is called when the activity is being created.
The default implementation does nothing.
buffer | A buffer from which the activity may restore its saved instance state. |
|
protectedvirtual |
This method is called when the activity is about to be destroyed.
The default implementation does nothing.
|
protectedpure virtual |
Idle callback.
This method is called repeatedly as long as there are no events to be processed. The typical native activity will implement its screen update logic here.
|
protectedvirtual |
This method is called when a KeyEvent is received.
The default implementation does nothing and returns false.
event | The event. |
|
protectedvirtual |
This method is called when the system is running low on memory.
The default implementation does nothing.
|
protectedvirtual |
This method is called when a MotionEvent is received.
The default implementation does nothing and returns false.
event | The event. |
|
protectedvirtual |
This method is called when the activity is being paused.
The default implementation does nothing.
|
protectedvirtual |
This method is called when the activity is being resumed.
The default implementation does nothing.
|
protectedvirtual |
Called when the activity should save its instance state.
The default implementation does nothing.
buffer | A buffer into which the activity may store its instance state. |
|
protectedvirtual |
This method is called when a SensorEvent is received.
In order to receive sensor events, the application must first enable one or more sensors via the SensorManager.
The default implementation does nothing.
event | The event. |
|
protectedvirtual |
This method is called when the activity is being started.
The default implementation does nothing.
|
protectedvirtual |
This method is called when the activity is being stopped.
The default implementation does nothing.
|
protectedvirtual |
This method is called when a TimerEvent has been received.
In order to receive timer events, the application must first register one or more timers via the TimerManager.
The default implementation does nothing.
|
protectedvirtual |
This method is called when the activity's window has been created.
The activity may access the window itself by calling getWindow(), and may obtain a rendering context for the window by calling getRenderingContext().
The default implementation does nothing.
|
protectedvirtual |
This method is called when the activity's window is about to be destroyed.
The activity should suspend all drawing and avoid any further access to the window or rendering context.
The default implementation does nothing.
|
protectedvirtual |
This method is called when the activity's window gains or loses input focus.
The default implementation does nothing.
hasFocus | If true, the window has gained input focus; otherwise the window has lost focus. |
|
protectedvirtual |
This method is called when the activity's window needs to be redrawn.
The method should not return until the window has been fully redrawn.
The default implementation does nothing.
|
protectedvirtual |
This method is called when the activity's window has changed size.
The application should retrieve the new size and adjust its drawing behavior accordingly.
The default implementation does nothing.
|
protected |
Display the soft input method (e.g., a virtual on-screen keyboard).
forced | If true, shows IME even if a physical keyboard is open. |
|
protected |
|
protected |
Start a new activity with the given intent.
After this method has been called, the intent object can be safely deleted.