Android-ElectricSheep-Automator

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

    Android::ElectricSheep::Automator::DeviceProperties object or undef if
    there is no connected device. The returned object is constructed during
    a call to "find_current_device_properties($params)" which is called via
    "connect_device($params)" and will persist for the duration of the
    connection. However, after a call to "disconnect_device()" this object
    will be discarded and undef will be returned.

 swipe($params)

    Emulates a "swipe" in four directions. Sets the current Android device
    to control. It is only required if you have more than one device
    connected. $params is a HASH_REF which may or should contain:

      * direction

      should be one of

      up

      down

      left

      right

      * dt

      denotes the time taken for the swipe in milliseconds. The smaller its
      value the faster the swipe. A value of 100 is fast enough to swipe to
      the next screen.

    It returns 0 on success, 1 on failure.

 tap($params)

    Emulates a "tap" at the specified location. $params is a HASH_REF which
    must contain one of the following items:

      * position

      should be an ARRAY_REF as the X,Y coordinates of the point to "tap".

      * bounds

      should be an ARRAY_REF of a bounding rectangle of the widget to tap.
      Which contains two ARRAY_REFs for the top-left and bottom-right
      coordinates, e.g.  [ [tlX,tlY], [brX,brY] ] . This is convenient when
      the widget is extracted from an XML dump of the UI (see
      "dump_current_screen_ui($params)") which contains exactly this
      bounding rectangle.

    It returns 0 on success, 1 on failure.

 input_text($params)

    It "types" the specified text into the specified position, where a
    text-input widget is expected to exist. At first it taps at the
    widget's location in order to get the focus. And then it enters the
    text. You need to find the position of the desired text-input widget by
    first getting the current screen UI (using
    "dump_current_screen_ui($params)") and then using an XPath selector to
    identify the desired widget by name/id/attributes. See the source code
    of method "send_message()" in file
    lib/Android/ElectricSheep/Automator/Plugins/Apps/Viber.pm for how this
    is done for the message-sending text-input widget of the Viber app.

    $params is a HASH_REF which must contain text and one of the two
    position (of the text-edit widget) specifiers position or bounds:

      * text

      the text to write on the text edit widget. At the moment, this must
      be plain ASCII string, not unicode. No spaces are accepted. Each
      space character must be replaced with %s.

      * position

      should be an ARRAY_REF as the X,Y coordinates of the point to "tap"
      in order to get the focus of the text edit widget, preceding the text
      input.

      * bounds

      should be an ARRAY_REF of a bounding rectangle of the widget to tap,
      in order to get the focus, preceding the text input. Which contains
      two ARRAY_REFs for the top-left and bottom-right coordinates, e.g.  [
      [tlX,tlY], [brX,brY] ] . This is convenient when the widget is
      extracted from an XML dump of the UI (see
      "dump_current_screen_ui($params)") which contains exactly this
      bounding rectangle.

    It returns 0 on success, 1 on failure.

 clear_input_field($params)

    It clears the contents of a text-input widget at specified location.

    There are several ways to do this. The simplest way (with
    keycombination) does not work in some devices, in which case a failsafe
    way is employed which deletes characters one after the other for 250
    times.

    $params is a HASH_REF which must contain one of the two position (of
    the text-edit widget) specifiers position or bounds:

    <position

      should be an ARRAY_REF as the X,Y coordinates of the point to "tap"
      in order to get the focus of the text edit widget, preceding the text
      input.

    bounds

      should be an ARRAY_REF of a bounding rectangle of the widget to tap,
      in order to get the focus, preceding the text input. Which contains
      two ARRAY_REFs for the top-left and bottom-right coordinates, e.g.  [
      [tlX,tlY], [brX,brY] ] . This is convenient when the widget is
      extracted from an XML dump of the UI (see
      "dump_current_screen_ui($params)") which contains exactly this
      bounding rectangle.



( run in 1.206 second using v1.01-cache-2.11-cpan-13bb782fe5a )