Public Types | Static Public Member Functions | List of all members
Celartem::AndroidHelper Struct Reference

#include <cel_android.h>

Public Types

enum  FileMode
 

Static Public Member Functions

static void setContext (JNIEnv *env, jobject context)
 
static void setConsoleContext (void *context)
 
static JNIEnv * getJNIEnv ()
 
static jobject getContext ()
 
static bool hasContext ()
 
static bool isConsoleApp ()
 
static jstring convertString (const String &s)
 
static String convertString (jstring s)
 
static String getDir (const String &name, FileMode mode)
 
static String getCacheDir ()
 
static String getExternalCacheDir ()
 
static String getExternalFilesDir (const String &type)
 
static String getFilesDir ()
 
static jobject getApplicationInfo ()
 
static String getStringField (jobject obj, const char *name)
 
static int getIntField (jobject obj, const char *name)
 

Detailed Description

Android Helper functions.

Member Enumeration Documentation

Android defined file creation modes.

Member Function Documentation

static jstring Celartem::AndroidHelper::convertString ( const String s)
static

Convert a String variable to JNI's jstring.

Parameters
sString to convert.
Returns
jstring.
static String Celartem::AndroidHelper::convertString ( jstring  s)
static

Convert a JNI's jstring. to String.

Parameters
sString to convert.
Returns
String instance.
static jobject Celartem::AndroidHelper::getApplicationInfo ( )
static

Wrapper for Context.getApplicationInfo().

Returns
jobject, which points an ApplicationInfo instance.
static String Celartem::AndroidHelper::getCacheDir ( )
static

Wrapper for Context.getCacheDir().

static jobject Celartem::AndroidHelper::getContext ( )
static

Get context set by setContext function.

Returns
Context.
static String Celartem::AndroidHelper::getDir ( const String name,
FileMode  mode 
)
static

Wrapper for Context.getDir(String,int).

static String Celartem::AndroidHelper::getExternalCacheDir ( )
static

Wrapper for Context.getExternalCacheDir().

static String Celartem::AndroidHelper::getExternalFilesDir ( const String type)
static

Wrapper for Context.getExternalFilesDir(String).

static String Celartem::AndroidHelper::getFilesDir ( )
static

Wrapper for Context.getFilesDir().

static int Celartem::AndroidHelper::getIntField ( jobject  obj,
const char *  name 
)
static

Get an integer value from ApplicationInfo.

Parameters
objApplicationInfo returned from getApplicationInfo function.
nameName of a value.
Returns
Integer value corresponding to the name.
static JNIEnv* Celartem::AndroidHelper::getJNIEnv ( )
static

Get thread specific JNIEnv.

Returns
JNIEnv for the thread.
static String Celartem::AndroidHelper::getStringField ( jobject  obj,
const char *  name 
)
static

Get a string value from ApplicationInfo.

Parameters
objApplicationInfo returned from getApplicationInfo function.
nameName of a value.
Returns
String value corresponding to the name.
static bool Celartem::AndroidHelper::hasContext ( )
static

Determine whether context has been set or not.

Returns
true if context is set; otherwise false.
static bool Celartem::AndroidHelper::isConsoleApp ( )
static

Determine whether the app is console app or not.

Returns
true if the app is console app; otherwise false.
static void Celartem::AndroidHelper::setConsoleContext ( void *  context)
static

If the executable is a console app, the console context should be explicitly specified with the function.

Parameters
contextCurrently, it should be NULL.
static void Celartem::AndroidHelper::setContext ( JNIEnv *  env,
jobject  context 
)
static

SDK sometimes requires certain context to execute Android specific operations. This function supplies SDK with the context to use in such situation.

Parameters
envJNIEnv passed by Java environment.
contextA context of either the application or the activity.

The documentation for this struct was generated from the following file:

Cuminas DjVu SDK 3.0.33103
This document is made with doxygen 1.8.5 at Sun Dec 15 2013 19:38:06.
Cuminas Logo