DEVELOPMENT ENVIRONMENT CONFIGURATION
To develop Android applications using PHP script , the four softwares, such as JDK, Android SDK, SL4A and PFA must be installed. The steps are as follows: firstly the JDK isdownload and installed on the computer; second the Android SDK is download and installed on the computer; next the simulator is created; finally SL4A and PFA are installed on the simulator.
A. Download and Install the JDK JDK 5.0 of Java or higher is recommended for runningAndroid emulator. The JDK can be downloaded from the Oracle web site “http://www.oracle.com/technetwork/java/javase/downloads/index.html”. After downloading, we can run the JDK installation file and install the JDK to the specified folder. In this paper, the JDK is installed to the C: \ Program Files \Java \ JDK.
B. Download and Install the Android SDK The newer Android SDK main installation package can be downloaded from“http://dl.google.comland roid/andro id -sdk r22.2.1-Windows.Zip”. The downloaded file should be directly extracted into a specified folder. In this paper, the Android SDK files are extracted into D: \ android SDK, the main installation package contains the SDK manager, the AVD manager, and the toolkit. Then the window of android SDK Manager is opened when we double-click the SDK Manager. exe file under the directory of D: \ android SDK .The developer can select the android SDK package to install according to the need.After installed the android SDK package and opened the directory of D: \ android SDK, the complete directory structure of the Android SDK is shown in Fig.2, it includes the directories of “tools”,”system-images”, “platform-tools”,”platforms”,”build-tools”,etc. Next, the Path environment variable must be modified for adding the Android SDK directory. The paths of “D:\android-sdk-windows\tools” and “D:\android-sdk-windows\platform-tools” are added into the Path environment variable
C. Create the Simulator After the above operation, applications can be run on Android phones. If developer doesn’t have an android phone, an emulator must be created to replace an android phone. Of course, the simulator doesn’t fully simulate the phone.
D. Install SL4A and PFA on the Android Phone or Emulator Now the program file of the latest SL4A is sl4a_r6.apk. It may be downloaded from http://code.google.com/p/android-scripting/downloads/list/.After the SL4A is downloaded, the command “adb install sl4a_r6.apk” in the Windows command window will install SL4A in the running emulator. The PFA script may be downloaded from PFA official website http://www.phpforandroid.net , its corresponding file is called phpforandroid_r1.apk. After downloading the file phpforandroid_r1.apk, the next step is to execute the command “adb install phpforandroid_r1.apk ” to install PFA scripting interpreter in the Windows command window.After installing SL4A and PFA and clicking on the buttons at the bottom of the main screen to display the list of applications,the icons can be seen of SL4A and PFA. Click Here