Posts

Showing posts with the label shell command

shell command in android

Image
Executing Shell commands is useful to perform deep operating system operations. In this tutorial we are going to see how to execute Linux shell commands with your Android Application. Creating Project Create a new Android Application project in eclipse with package as com.learn2crack.androidshell. Create the main layout as activity_main and main Activity as MainActivity. Creating Layout Our main layout consists of a EditText widget to get shell command as input. It also has a Button widget to execute the command. It also has a TextView widget to display the outupt of the command which is executed. activity_main.xml <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:tools="http://schemas.android.com/tools"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:orientation="vertical"     android:layout_gravity="center"     tools...