Are there an options to install Perl modules like LWP on Android (on SL4A environment ). Also, are there prepackaged Perl modules that can be installed on Android, and is there an option to see which modules are installed using the Android Debug Bridge.
No. No. Perl can surely be asked to provide this, but you can start by looking under
$ ls /data/data/com.googlecode.perlforandroid/files/perl/5.10.0/
SL4A's perl actually comes with CPAN.pm - but not all of its dependencies, as you'll see with the errors you get with
$ perl -MCPAN -eshell
I used CPAN.pm on a Sharp Zaurus, running OpenBSD, and I used a CPAN.pm-less hack to install modules off of CPAN so that the process would be easier on my 64MB of RAM. My Galaxy Tab has slightly better hardware. But at present, nobody's done the work to make (unrooted) Android a comfortable home for Perl -- and as Perl is poorly-suited to Android app development, that may remain the case for a while.
EDIT: Well, try these:
App::FatPacker
App::cpanminus
Only "Pure Perl" modules that aren't coded in C (aka., "XS" modules) can be added to SL4A's version of Perl. You can view what modules are included in that simply by downloading the Perl zip installed by SL4A.
In SL4A's current version (Perl 5.10), modules are fairly limited due to the incomplete compile process used. A new version of the Perl for Android Interpreter should be available here soon, which will have more of the standard Perl Core modules, along with a description of how to compile more from CPAN.
Related
I want to do Ruby development on an Android tablet, just like on any laptop. So, using vim, git, and rspec to run tests. So, I've found the following apps:
Vimtouch
Ruboto
Git (yes, it's an app)
Terminal Emulator (provides bash)
Each app works just fine. By itself. But, I don't know how to put it all together. I'm a bit of a newbie when it comes to how Android works. So, if anyone could help provide a writeup so that I can:
clone a github repository
edit files from that repository
run my tests
NOTE: I don't want to write an Android app. I want to use my tablet to do Ruby development.
The Android Scripting Environment said to plan on Ruby. Might be worth a check how far they got; at least they're tagged "JRuby" at Google Code. According to their project page:
Scripts can be run interactively in a terminal, in the background, or via Locale. Python, Perl, JRuby, Lua, BeanShell, JavaScript, Tcl, and shell are currently supported, and we're planning to add more.
this can be done
Compile Ruby and Nodejs for android
Install on device and configure with c/c++ ide (You can use
C4droid,CCTools,Terminal IDE.... for installing the expansion
modules on с/с++)
On a fresh Ubuntu installation, I have installed build-essential package, amongst other packages that I've then used to compile Nvidia driver for my PC. Meaning kernel and module compilation works on the PC.
Now on the same PC, I tried to Cross compile an Android linux kernel, using the Google NDK Toolchain based on gcc 4.4.3.
Compilation proceeds smoothly, however at the end, it gives the following output:
CHK include/linux/version.h
CHK include/generated/utsrelease.h
make[1]: `include/generated/mach-types.h' is up to date.
CALL scripts/checksyscalls.sh
CHK include/generated/compile.h
Building modules, stage 2.
MODPOST 0 modules
I have done 'make prepare' before invoking 'make menuconfig' and then doing a 'make'.
Note that the same toolchain, on a build server works with the same files cloned from a git repo. In short, same kernel source, same toolchain, builds modules on the server, doesnt build any modules on my PC.
.config has "Loadable modules support" enabled.
$cat modules.order
kernel/drivers/scsi/scsi_wait_scan.ko
kernel/drivers/net/wireless/bcmdhd/dhd.ko
kernel/drivers/net/wireless/btlock/btlock.ko
kernel/drivers/net/tun.ko
The Makefiles have correct obj-m and obj-$ setup, which is also obvious by the fact that it works on one PC.
I'll be glad to have some insight on why I cant get my PC to compile modules for my Android kernel.
After a lot of searching, I found the answer.
I'm sharing it here because it's almost inconceivable that anyone would think that this is the reason for this issue!
I have GREP_OPTIONS set for providing color automatically, and to number the results. It seems that a the script which builds modules depends on grep, and seems to get messed up.
unsetting the envt variable made it perform modpost successfully.
So the solution is to:
GREP_OPTIONS=
And remove the setting from the profile and .bashrc scripts.
I've had several errors in kernel logs on device boot after all partitions were mounted.
ext3_free_blocks_sb: bit already cleared for block ######
After searching I've discovered that a bugfix for the same issue was already integrated in the kernel.
Then I've searched for similar commits on repository and didn't find anything so it seems like the bug was fixed on the mainstream and the issue is Android-related.
From the discussion on RedHat bugtracker about the bug I discovered that it can be reproduced with stress-test utility. Unfortunately, I don't know any of these for ext3 on Android.
The main difficulty with porting such diagnostic tools to Android is it's reduced kernel functionallity. In this case there is a bunch of filesystem stress utilities for regular linux:
Bonnie++
dbench
fsstress and other tools included in LTP
etc.
Most of them require specific headers or BASH script features which are missing in Android.
After rewiewing available set of tools in filesystem test case of LTP I came up with the following approach:
Find a tool with minimal subset of scripts, headers and syscalls.
Compile it using Android NDK.
Install BASH for Android to run required scripts.
Replace missing commands with their' Busybox equivalents.
I want make a dynamic loaded kernel module for android.
I don't want to install a linux, I just have cygwin and android NDK.
Yes, it is possible to build kernel modules with the NDK. Note, this works best with a Linux system (I'm told Linux x86_64 is the supported environment) because it's harder to cross-compile kernel code on case sensitive filesystems (such as those that come by default on Windows and Mac systems), and because building kernel modules requires building ELF-manipulation binaries (modpost) which require ELF headers typically only present on Linux.
That said...
First you need to get the source code to the same exact kernel on your device, and make sure that the configuration is the same as your device. (otherwise there's a chance you will confuse the build system)
Second, you need to determine where in your Android NDK the cross-compiler toolchain is. Here's how I found mine:
$ cd $NDK_HOME
$ find . | grep '\-gcc$'
./toolchains/arm-eabi-4.4.0/prebuilt/linux-x86/bin/arm-eabi-gcc
./toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc
(note, $NDK_HOME is where I installed the Android NDK)
Third, you need to add the $NDK_HOME/toolchains/arm-eabi-4.4.0/prebuilt/linux-x86/bin directory (or wherever it is on your system) to your PATH environment variable.
Then you need to export two environment variables:
export ARCH=arm
export CROSS_COMPILE=arm-eabi-
(note, the arm-eabi- prefix is the same as what we saw in the find command. When the kernel is built, commands such as gcc and ld will be prefixed with this. Note, if you were building for an x86 platform I expect you would have to adjust these. I have only built modules for ARM.)
Next, you should compile the kernel. (to do this, I pulled down /proc/config.gz from my Android device, ran zcat config.gz > .config within the kernel source directory, then ran make menuconfig && make.) Kernel build gurus may know some shortcuts here, but I wasn't able to set up the kernel source directory correctly for building a module without doing an actual build. (If the kernel in your build tree matches your device, you don't have to actually update the kernel, you can just insert the modules.)
Last, I used the normal process to build the kernel modules from source. Typically kernel modules will have a parameterized build which will read in the kernel source tree directory somehow, then invoke the build. At that point, as long as the kernel source tree is set up correctly and ARCH and CROSS_COMPILE are set up, your module should build!
Good luck with this. I'm sure there is some per-device variance.
Just now I found this URL where the user has attempted loading LKM and was successful, though on Android (Kernel core: 2.6.29) and I think it was on Linux and not on Cygwin. Hope you get it too!
There is one more resource here and here too!.
All the best!
Follow this URL, Android developer suggests to go for virtual Ubuntu image for this than cygwin.
What are the minimal steps necessary (including retrieving the source code) to compile and run just the Dalvik virtual machine on Linux?
Actually , I got Dalvik working on my elementary OS installation.
First download the Android AOSP source tree using https://source.android.com/source/downloading.html. Wait for it to download (2 hours for me cloning only the current commits and Marshmallow branch)
After running build/envsetup.sh while in the source tree run lunch full_x86-eng. Then type make -jN (replace N with number of cores).
WAIT. This took me about 1 hour on an AMD-4500M laptop. Newer ccomputers may be as low as half and hour and older ones might take half a day.
Change directory to !!AOSP-PATH!!/out/host/linux-x86/bin/ and run export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:!!AOSP-PATH!!/out/host/linux-x86/obj/lib/ or
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:!!AOSP-PATH!!/out/host/linux-x86/lib
or export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:!!AOSP-PATH!!/out/host/linux-x86/lib64
TRY ALL OF THESE
and then
./dalvikvm --32. If you try to run without the --32 option it will crash (don't know why)
Working Marshmallow Dalvik. To get the GUI apps working you will need to do some more porting and coding which is another project which I am working on.
Took me half a day to figure this out.
References
http://milk.com/kodebase/dalvik-docs-mirror/docs/hello-world.html
Use sabayon Linux. This is a distro that can natively run Android programs and all Linux ones too.
Actually, that's rather android running on Dalvik and the underlying system is already linux.
I guess running a bare Dalvik VM on a desktop linux box is just a matter of getting the sources and compile it.
The GUI stuff is something else.
You are not the only one with this idea, and that is great in internet society terms.
This is probably what you are looking for: http://www.android-x86.org/.
Those guys ported android over to x86.
It still works as an OS, so I'm not sure if you can run Linux and Android(Linux) together without using VirtualBox.
Dalvik runs on Android. The authors of Dalvik are only worrying about it running on Android, as far as we are aware.
Various groups have indicated they are working on getting Dalvik outside of Android. You are probably best off finding and talking to them.
In other words, there are no official instructions of the type you seek.
Sorry!
Getting apps designed for Android to run on Linux is going to be tricky. However, it is possible to run a Dalvik VM on Linux. In fact, this GitHub project has a pre-compiled binary of Dalvik VM for Linux, ready to use! Check the associated blog post for information about how the binary was compiled and how to use it.
Learn to program Java \ C \ C++ and other frameworks
Modify the Android source (I think app_process or something) so it shows a windows on the Linux desktop (learn X11 / Wayland APIs)
Below is a simpile base for you to start with
www.android-x86.org/getsourcecode
Getting Android-x86 source code
First, follow this page to configure your build environment. Then
mkdir android-x86
cd android-x86
repo init -u git.android-x86.org/manifest -b $branch
repo sync
Where $branch is any branch name described in the previous section. This will point the projects created or modified by android-x86 to our git server. All the other projects still point to AOSP.
We also have a git mirror server on SourceForge.net. To use it, you only need to change the repo init command to
repo init -u git.code.sf.net/p/android-x86/manifest -b $branch