Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

cpan android

by Boldra (Deacon)
on Nov 29, 2010 at 11:00 UTC ( #874223=perlquestion: print w/replies, xml ) Need Help??
Boldra has asked for the wisdom of the Perl Monks concerning the following question:

I installed SL4A and Perl on my Android phone on the weekend, and the tests are working (pretty easy really). I'm curious if someone can suggest the best way to add cpan modules?

On the one hand it might be helpful if my script went ahead an installed them itself, but that also might end up costing someone for downloading.

I'm also interested in suggestions about how to get the Android libraries cleanly installed in a (windows or linux) development environment. I don't want to have to create a with '1' in it, just so I pass syntax checking. It would be really helpful if there were a mock android library which performed the UI components using Tk or similar, but I suspect I have to run Eclipse and ADT to test :(

- Boldra

Replies are listed 'Best First'.
Re: cpan android
by marto (Bishop) on Nov 29, 2010 at 11:32 UTC

    I'd suggested installing Eclipse and follow the Android documentation to get a development environment up and running, this allows testing your apps on a virtual Android device, you can alter the hardware specification and Android version for testing/benchmarking purposes.

    As for SL4A, this looks quite interesting, I'll play around with this when I get home this evening. The only problem I can see is that your application will have a much larger filesize than a native JavaApp, which impacts device performance (most people don't have Apps2sd**) and as you say, potential impact on bandwidth use, which may result in a cost.

    The FAQ suggests that you can install (pure) Python modules by coping them to the appropriate place, perhaps this is the same for (pure) Perl modules.

    Update: Do you have a terminal emulator installed on your phone? You could have a look around to see if cpan is part of the perl packages SL4A downloads.

    Update 2: Also, I'd be curious as to know if when publishing a script, what the access permissions will be? The SL4A requirements (essentially wanting full hardware control and access to all your data) may be off putting to end users.

    ** Note that with most Android builds, applications are installed to the phones internal memory, which reduces the free RAM available to the system. I use Cyanogenmod, which allows me to specify where things get installed to, among other improvements.

      Note that with most Android builds, applications are installed to the phones internal memory, which reduces the free RAM available to the system. mean it reduces free storage space available to the system, right? RAM and the non-volatile flash used for storing the OS, the installed apps and your data are two different things on an Android phone, just like on a computer. Filling up the ROM with apps only means you won't be able to install more apps, it doesn't affect anything else. When you update to Froyo, you can move apps to the SD card, so it has even less importance.

      My phone, for example, has 384MB of RAM (memory) and 512MB of ROM (storage). The two don't flow into each other.

        Clearly I've picked something up totally wrong when reading about how the android framework uses internal storage. I have Cyangeon 6 (Android 2.2.1) installed on this old thing, my provider (Vodafone UK) are way behind, I think they may have given up :)

Re: cpan android
by elef (Friar) on Nov 29, 2010 at 22:43 UTC
    Admittedly, I don't know jack about this, but in principle, you could use App::FatPacker. It copies (pure) perl modules inline along with their dependencies, so it gets around installation altogether. If App::FatPacker can do the module(s) you need, the resulting script should run on Android, I imagine.
    I'm not sure if it will have a negative impact on performance; integrating Spreadsheet::WriteExcel to one of my scripts added more than 35,000 lines to it, which could take a phone a fair bit of time to comb through at compile time.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://874223]
Approved by marto
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2018-03-24 09:16 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (297 votes). Check out past polls.