Can I develop Android applications in Perl?

23,817

Solution 1

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.

Solution 2

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

Solution 3

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.

Share:
23,817
Andreas
Author by

Andreas

Updated on January 12, 2020

Comments

  • Andreas
    Andreas over 4 years

    I know that I can run Perl on Android, but I'm looking to write an app that can be released on Google Play, for anyone to download and run. Is Perl still a viable choice?

  • Andreas
    Andreas almost 12 years
    The reason I'd like to use Perl is both the immense CPAN, and that I'm a lot more confident with it. Writing the app in Java instead of Perl (if Perl were available) would take a lot more than an extra afternoon, especially if I wanted the same code quality. Now, if there only was a way to bundle SL4A and my script into an APK...
  • Dmitry Zaytsev
    Dmitry Zaytsev almost 12 years
    @Andreas code quality - it's a good reason. But don't forget about application overall quality.
  • zostay
    zostay almost 12 years
    @Andreas, there are quite a few Java libraries out there, but without CPAN finding them is a bit harder and brining libraries into your APK file will definitely bloat your app. (No free lunch and all that...) I suggest looking into the Maven project for Java, which provides a huge number of OSS libraries for Java for various purposes. I would still love to have CPAN on Android too.
  • Andreas
    Andreas almost 12 years
    I know that I can run Perl on Android. But I'm looking to develop an application that can be neatly bundled in an APK on Google Play.