最終更新:2013-01-22 (火) 13:21:12 (4111d)  

ioio.lib.util.android.IOIOActivity
Top / ioio.lib.util.android.IOIOActivity

public abstract class IOIOActivity extends Activity implements IOIOLooperProvider

説明

  • A convenience class for easy creation of IOIO-based activities. It is used by creating a concrete Activity in your application, which extends this class. This class then takes care of proper creation and abortion of the IOIO connection and of a dedicated thread for IOIO communication. In the basic usage the client should extend this class and implement createIOIOLooper(), which should return an implementation of the IOIOLooper interface. In this implementation, the client implements the IOIOLooper.setup(ioio.lib.api.IOIO) method, which gets called as soon as communication with the IOIO is established, and the IOIOLooper.loop() method, which gets called repetitively as long as the IOIO is connected.
  • In addition, the IOIOLooper.disconnected() method may be overridden in order to execute logic as soon as a disconnection occurs for whichever reason. The IOIOLooper.incompatible() method may be overridden in order to take action in case where a IOIO whose firmware is incompatible with the IOIOLib version that application is built with.
  • In a more advanced use case, more than one IOIO is available. In this case, a thread will be created for each IOIO, whose semantics are as defined above. If the client needs to be able to distinguish between them, it is possible to override createIOIOLooper(String, Object) instead of createIOIOLooper(). The first argument provided will contain the connection class name, such as ioio.lib.impl.SocketIOIOConnection for a connection established over a TCP socket (which is used over ADB). The second argument will contain information specific to the connection type. For example, in the case of SocketIOIOConnection, the second argument will contain an Integer representing the local port number.

メソッド

  • onCreate
  • onDestroy
  • onStart
  • onStop
  • onNewIntent?
  • createIOIOLooper

プロパティ

  • ioio.lib.util.android.IOIOAndroidApplicationHelper? - extends ioio.lib.util.IOIOApplicationHelper?