|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.octoshape.android.client.OctoStatic
public class OctoStatic
Contains static methods to initialize the OctoshapeSystem.
Method Summary | |
---|---|
static OctoshapeSystem |
create(Context context,
ProblemListener problemListener,
OctoshapePortListener portListener)
Creates the OctoshapeSystem . |
static void |
enableLog(boolean toConsole,
java.lang.String filePath)
Enables the logging for the OctoshapeSystem and OctoshapeService. |
static Problem |
generateMediaPlayerProblem(int what,
int extra)
Method for generating Problem instances from Android MediaPlayer errors. |
static void |
terminate(java.lang.Runnable runOnFinish)
Terminates the OctoshapeSystem and unbinds from the Octoshape Service. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static OctoshapeSystem create(Context context, ProblemListener problemListener, OctoshapePortListener portListener)
OctoshapeSystem
.
Creating the OctoshapeSystem object requires the presence of the StreamService service in the Android manifest file:
Only the first call to this method does anyhting; subsequent calls will return the OctoshapeSystem
object already created and ignore their parameters.
context
- required for binding the Octoshape service, once OctoshapeSystem.open()
is called.problemListener
- for the OctoshapeSystem
and the Octoshape Servive.
It is recommended to handle problems from the OctoshapeSystem by showing a text message to the user @see Problem.portListener
- for reporting successful launch and bindpoint of the Octoshape client. This may be NULL, if this information is not needed (see OctoshapePortListener
.
public static Problem generateMediaPlayerProblem(int what, int extra)
Problem
instances from Android MediaPlayer errors.
For details please see the
MediaPlayer.OnErrorListener
documentation.
what
- the type of error that has occurred.extra
- an extra code, specific to the error. Typically implementation dependent.public static void terminate(java.lang.Runnable runOnFinish)
OctoshapeSystem
and unbinds from the Octoshape Service.
This OctoshapeSystem instance must not be used after this method has been called.
The Octoshape System should be terminated after use (e.g, when the application
or activity is destroyed), even if #open
has not been called.
runOnFinish
- If different from null, this is called when the class
switches to closed state.public static void enableLog(boolean toConsole, java.lang.String filePath)
Must be called before create the OctoshapeSystem
object to have any effect.
Enabling debuging requires starting the service in debug mode. This is done by replacing <service android:name="com.octoshape.android.service.StreamService" android:process=":OctoProc"/> with: <service android:name="com.octoshape.android.service.StreamServiceDebug" android:process=":OctoProc"/>
toConsole
- If true the log will be written to the console.filePath
- If non-null the log will be written to a file in the given folder.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |