Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
96 lines (64 sloc) 4.36 KB


Object::Remote is a Perl module which can be used to run your Perl program or script on a remote host and return the results, without needing to run any install steps. The only thing that must exist on the host is Perl itself. You'll need a version of Perl that's at least 5.8.1 to use it.

Object-Remote-Java (or JavaBridge) is an Object::Remote compatible backend written in Java. It can be used to call Java objects and methods by writing Perl code.

The backend can be built to run standalone, producing a set of Java classes that will run with any (most) Java interpreters, or as an Android application.

Example use with Android

use Object::Remote;
use Object::Remote::Connector::TCP;
my $conn = Object::Remote->connect('tcp://');

# Fetch the Android Activity object:
my $activity = uk::me::desert_island::theorbtwo::bridge::AndroidServiceStash->can::on($conn, 'get_activity')->();

# Create some GUI objects:
my $edit_text = android::widget::EditText->new::on($conn, $activity);
my $button = android::widget::Button->new::on($conn, $activity);
$button->setText("DO IT!");

# Layout the GUI objects:
my $layout = android::widget::LinearLayout->new::on($conn, $activity);

# We can only change the GUI in the GUI thread, so create a Runnable
# and pass it to runOnUiThread:
my $runnable = uk::me::desert_island::theorbtwo::bridge::MethodCallRunnable->new::on($conn, $activity, 'setContentView', [$layout]);

# Set a callback coderef to call when the configuration changes:
$activity->set_on_configuration_changed_callback(sub {
    print "Your configuration changed, and we actually managed to get here!\n";

# Kick off an event loop so that we can receive callbacks:
my $or_loop = Object::Remote->current_loop;

More examples in scripts/perl/

This is a work in progress, so far we can

  • Create new objects
  • Call methods on objects
  • Pass objects as method arguments
  • Run callbacks with no arguments

To build and install (Android 2.2+)

  • Download the Android SDK tools: and unpack it.

  • To fetch the actual SDK, run the "tools/android" command, which will open a GUI, install an SDK from the list. We are using android-12, so pick that if available. Docs:

  • Install the "ant" tool for your machine (available as a package in most linux distributions).

  • Create a file named "" in the main checkout directory of this project, and add one line:


  • Run ant from this directory:

    ant -f debug

  • Configure your Android device to allow installing packages outside of Google-Play, by checking the option "Unknown Sources" in the "Security" section of the "Settings" app.

  • Copy the file bin/JavaBridgeActivity-debug.apk to your Android device and install and run it.

  • Now you can run Perl scripts to connect to the server on :9849.


  • Unresolved project targets, eg:

    BUILD FAILED /opt/adt-bundle-linux/sdk/tools/ant/build.xml:539: Unable to resolve project target 'android-12'

Means that either you skipped the "fetch an actual SDK" point above, or you installed something that wasn't "android-12". Either go install android-12, or edit the file to match the one you did download.

(There's an android command for updating the project but, I'd have to go lookup what it is)

OR Download it

There is a prebuilt copy (Android v4.0.3) in the github downloads directory:

Older versions of Android

There is currently no real reason this is only building for Android 4.0.3+ except that we were tinkering with the "onConfigurationChanged" callback. To build for older versions, remove the "android:configChanges" tag from AndroidManifest.xml, and change the values in the "" tag. See