Class NativeLookup

java.lang.Object
com.codename1.system.NativeLookup

public final class NativeLookup extends Object

Creates an instance of the native interface which will call the underlying platform using the convention documented in the package docs. To understand more about native interfaces you can check out this quick "How Do I?" tutorial.

Alternatively you can dig deeper into this tutorial for integrating 3rd party native libraries.

  • Method Summary

    Modifier and Type
    Method
    Description
    static <T extends NativeInterface>
    T
    create(Class<T> c)
    Creates an instance of the given native interface and returns it for user callbacks.
    static boolean
    Indicates whether stack traces should be printed when lookup fails
    static void
    register(Class ni, Class cls)
    Do NOT invoke this method.
    static void
    setVerbose(boolean aVerbose)
    Indicates whether stack traces should be printed when lookup fails

    Methods inherited from class Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    Modifier and Type
    Method
    Description
    protected Object
     
    boolean
    Indicates whether some other object is "equal to" this one.
    final Class
    Returns the runtime class of an object.
    int
    Returns a hash code value for the object.
    final void
    Wakes up a single thread that is waiting on this object's monitor.
    final void
    Wakes up all threads that are waiting on this object's monitor.
    Returns a string representation of the object.
    final void
    Causes current thread to wait until another thread invokes the method or the method for this object.
    final void
    wait(long timeout)
    Causes current thread to wait until either another thread invokes the method or the method for this object, or a specified amount of time has elapsed.
    final void
    wait(long timeout, int nanos)
    Causes current thread to wait until another thread invokes the method or the method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
  • Method Details

    • isVerbose

      public static boolean isVerbose()

      Indicates whether stack traces should be printed when lookup fails

      Returns

      the verbose

    • setVerbose

      public static void setVerbose(boolean aVerbose)

      Indicates whether stack traces should be printed when lookup fails

      Parameters
      • aVerbose: the verbose to set
    • create

      public static <T extends NativeInterface> T create(Class<T> c)

      Creates an instance of the given native interface and returns it for user callbacks.

      Parameters
      • c: the class of the NativeInterface sub interface
      Returns
      Returns:
      an instance of that interface that can be invoked or null if the native interface isn't present on the underlying platform (e.g. simulator platform).
    • register

      public static void register(Class ni, Class cls)

      Do NOT invoke this method. This method is invoked internally by the stub to register the implementation class that matches a specific interface type.

      Parameters
      • ni: the native interface

      • cls: the stub class matching said interface