Compile, Install, Run Linux Apps on Android

in #technology7 years ago (edited)

The advantage of using a POSIX based mobile OS is that you can run and install any Linux applications on your mobile (smartphone) with ease. And thanks to Open Source, its even easier to Compile, Install & Run Linux Applications on Android.

To get basic Linux apps running on Android, you need BusyBox. To give you some background, BusyBox is a software application that provides many standard Unix tools, much like the larger (but more capable) GNU Core Utilities. BusyBox is designed to be a small executable for use with the Linux kernel, which makes it ideal for use with embedded devices. It has been self-dubbed “The Swiss Army Knife of Embedded Linux”.
Using this guide, you’ll be able to:
Compile Linux C, C++ app directly on Android
Install, Run Linux apps on Android.
How to Compile, Run Linus Apps on Android

Step 1. Install BusyBox from Play Store (requires root). If you don’t have Root access, you can follow steps mentioned in the video which involves adb push for busybox binary to /data/ and setting permissions.
BusyBox would allow you to install various Linux apps on Android coz BusyBox is bundled with all the runtime dependecies.

Step 2. To make your environment even more capable, lets go ahead and install BotBrew Basil from Play store.
BotBrew Basil bootstraps the base system and do some basic package management by using uses Dpkg and Apt instead of Opkg. This will let you install various linux packages, this is where BotBrew shines.

Step 3. Install Linux apps using APT Package manager
To install apps using apt package manager, all you need to do is:
su
botbrew
apt-get install gcc g++
This will install gcc, g++ compilers and you can specify any other package name and ARM version should be automatically installed to your android.
Step 4. Compiling C, C++ source code on Android
Compile any source file using g++ and run it:

g++ ./sourceCode.cpp
./a.out

That’s it. You’ve successfully compiled and run your own C code.

You can watch the video below, it essentially covers the same steps in an easy to follow tutorial:

You can follow similar stories on http://geeknizer.com/

Sort:  

Hi! I am a robot. I just upvoted you! I found similar content that readers might be interested in:
http://geeknizer.com/install-run-linux-applications-on-android/

Congratulations @bt799! You have completed some achievement on Steemit and have been rewarded with new badge(s) :

You made your First Comment
You published your First Post
You got a First Vote

Click on any badge to view your own Board of Honor on SteemitBoard.
For more information about SteemitBoard, click here

If you no longer want to receive notifications, reply to this comment with the word STOP

By upvoting this notification, you can help all Steemit users. Learn how here!

Congratulations @bt799! You have received a personal award!

1 Year on Steemit
Click on the badge to view your Board of Honor.

Do not miss the last post from @steemitboard:
SteemFest³ - SteemitBoard support the Travel Reimbursement Fund.

Do you like SteemitBoard's project? Then Vote for its witness and get one more award!

Congratulations @bt799! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 2 years!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Vote for @Steemitboard as a witness to get one more award and increased upvotes!