Android system routines
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
t
.gitignore
Changes
MANIFEST
MANIFEST.SKIP
Makefile.PL
README.mkdn

README.mkdn

NAME

Android - Android system routines

Exportable functions

launch_activity

launch_activity( 'http://www.google.com' );

Launches an activity. Currently, no metadata is passed on. This is intended to change.

input_event_fh

my ($fh)= input_event_fh();

This needs root access.

Returns the process id and a filehandle from which all input events can be read. This will croak if the child process cannot be launched. The child process will be automatically killed at the end of the program.

Currently, no selection of the specific input device is possible.

See also decode_input_event.

decode_input_event

my $input_events= input_event_fh();
my $input= < $input_events >;
my $ev= decode_input_event($input);

This will decode one line of sensor input. It returns a hash with the four keys device, type, subtype and value. The interpretation of value varies between the device and types.

send_input_event

send_input_event(
    command => 'tap',
    args => [10,10],
    device => 'touchscreen',
);

Sends an input event.

This needs root access.

Valid commands are

  • text - arguments: string
  • keyevent - arguments: key code number or name
  • tap - arguments: x, y
  • swipe - arguments: x1, y1, x2, y2
  • press - arguments: none
  • roll - arguments: dx, dy

REPOSITORY

The public repository of this module is https://github.com/Corion/perl-android.

SUPPORT

The public support forum of this module is https://perlmonks.org/.

TALKS

I've given a talk that featured this module at Perl conferences:

German Perl Workshop 2015, German

BUG TRACKER

Please report bugs in this module via the RT CPAN bug queue at https://rt.cpan.org/Public/Dist/Display.html?Android or via mail to android-Bugs@rt.cpan.org.

AUTHOR

Max Maischein corion@cpan.org

COPYRIGHT (c)

Copyright 2015 by Max Maischein corion@cpan.org.

LICENSE

This module is released under the same terms as Perl itself.