Take the 2-minute tour ×
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It's 100% free, no registration required.

Since Android is Linux at its base, I logically think it should be possible to run a script on Android, like a Python script or PHP script (with executable bit obviously).

If not conventionally, is there any way to do so?

share|improve this question
    
Are you asking about a command prompt, or about developing Python code under Android? –  david6 Nov 9 '12 at 8:11
    
Python and php are not the same as Linux. But regarding to your question, yes it is possible to run python and php in Android, though you do need to install them first since unlike many other Linux systems, they're not installed by default. –  Lie Ryan Nov 9 '12 at 8:48
4  
Did you try anything? –  Matthew Read Nov 10 '12 at 7:06

2 Answers 2

up vote 10 down vote accepted

Python/PHP specific

If you are asking specifically for Python and PHP scripts, SL4A probably is your best choice (though there are other Python supporting apps in the playstore, like e.g. QPython Lite). And if you want to automate things, you might want to take a look at the SL4A Script Launcher (in connection with TaskBomb task scheduler) as well.

Shell Scripts

But talking about "Linux" and "scripts in general", the first coming to my mind are Shell Scripts. These can be run directly from the command line using any terminal emulator (e.g. Android Terminal Emulator, Terminal IDE) -- or, if you prefer some "graphical help", using specific launcher apps like SH Script Runner, ScriptMe, or Script Manager.

share|improve this answer
    
Bash shell scripts can be run from SL4A also. –  Felipe Voloch Sep 1 '13 at 2:38

You want SL4A. From the website:

Scripting Layer for Android (SL4A) brings scripting languages to Android by allowing 
you to edit and execute scripts and interactive interpreters directly on the Android 
device. These scripts have access to many of the APIs available to full-fledged Android 
applications, but with a greatly simplified interface that makes it easy to get things 
done.
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.