Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I develop Android applications in Perl?

This Google project packages Perl scripts and Perl into a self-contained APK, not requiring any further downloads, that can be uploaded to Google Play:

http://code.google.com/p/perl-android-apk/

It provides Android API access through SL4A - see the following page by one of the authors:

http://www.github.com/damonkohler/sl4a

So yes, Perl is a viable option if it's your preferred language to work with.


I highly recommend Perl for Android together with SL4A for prototyping applications. From there it isn't too much of a leap to refactor your code to Java, as all the system calls are the same on both platforms.

Knowledge of Java is an excellent new string to your bow, and the basics - mainly that everything is a class - can be learned in an afternoon and can largely be replicated in Perl


Technically you can release anything that conforms Google Play policy and is distributed in APK form. But in case of perl you'd either have to bundle perl with your app or expect user to have it (barely noone), not to mention UI. My answer is - it's not really best idea and if you can rethink it, you might come up with something requiring less hassle.


The short answer is: no, you cannot use Perl in a deployed, native Android app. There's no practical way to do this. There are ways to sort of do it, but none that are feasible.

As others have pointed out, there are some things like SL4A and such to make prototyping possible and you might even be able to run a real app on your phone, but deploying it to a wide base of phones will be problematic.

For 95% of the apps out there, a Java application of some sort is the best option. Yet, a native Java application is not the only alternative available to you.

Other options include:

  • You can develop an app that is primarily driven on the server side, which is running Perl. This could be through some sort of socket connection, REST API, or a web-based mobile app wrapped in a thin Java app that installs onto the client. However, your application will only work while the phone or tablet has a working data connection. There are many applications (including my own) that work this way.

  • You can try out PhoneGap, which uses HTML5 and JavaScript (and Java if you want to extend it to do something PhoneGap doesn't support on Android). This framework also has the advantage of making it possible to run your app on iPhones and other smartphones with very little effort. This also has it's own support base and community separate from Android and Google, if that's a concern.

  • You can also try Scala, which is a functional language (i.e., more Perlish than Java) that builds to the JVM and has some tools to aid in the construction of Android projects. This is not as mature, not supported by Google, and harder to start, but not Java for those offended by Java.

Ultimately, it should be possible for someone to deploy apps to Perl and I'd love to see that happen. I'm unwilling, though, to spearhead that project.

Update Jan 2014: Sadly, my original answer from August 2012 still applies despite what others have said. The SL4A + perl installed solution is closer, but SL4A does not allow you to actually build native Android applications. It, basically, gives you the ability to build a locally hosted web application that has access to some of the phone's native features. This may serve the needs of some, but certainly not all application developers. I still don't know of a project that will allow you to build a native Android application in Perl.