-
-
Notifications
You must be signed in to change notification settings - Fork 297
Building Processing for Android
codeanticode edited this page Aug 28, 2017
·
60 revisions
- Since we only require processing as a dependency, perform a shallow clone of the processing repo and build it by running ant in the processing/build folder, as detailed in the build instructions for Processing:
git clone https://github.com/processing/processing.git --depth 1
- Import the repo into Eclipse: Import > Projects from Git > Existing local repository > Select Processing folder > Import existing eclipse project
- Select:
- processing-app
- processing-core
- processing-java (Select the option with path processing/java)
- Right click the processing-app project and select Run As > Java Application > “Base - processing.app”
- Import the repo into IntelliJ: Import Project > Select Processing folder > Import from external model (Eclipse)
- In the “Select Eclipse projects to import” window, select
- processing-app
- processing-core
- processing-java (java)
- Goto Run > Edit Configurations and create a new Application configuration.
- Set “Main class” to “Base (processing.app)”
- And “Use classpath of module” to “processing-app”
First of all, download and install the Android SDK. All you need are the command line tools (available at the bottom of this page). Using the command line tools, you can download all the required components of the Android SDK. In order to build the Android mode, you only need to install the Android SDK Tools, the SDK Platform-tools, the Build-tools, and the SDK Platform for Android 8 (API 26).
- Import Processing Android into Eclipse similarly using Step 2 above.
- Right click the android-core package > Build Path > Configure Build Path
- Edit the ANDROID_JAR path and set it to the android.jar file located in the platforms/android-xx folder of your android sdk (where xx is the Android API level).
- Run the ant command in the processing-android/core folder to build the core library.
- If you imported processing-vr in Step 1, configure its build path and set the processing-core.zip path to the file now present in the root of your processing-android folder. Also set the ANDROID_JAR path.
- Add/Edit the Run Configuration to the processing-app needed to load the Android mode from the development repository:
- Right click on the processing-app project, and select Run As...|Run Configurations
- Create a new run configuration or edit the existing configuration, making sure it has processing-app as the project, and processing.app.Base as the main class.
- In the arguments tab, enter
-Dusemode=processing.mode.android.AndroidMode:${resource_loc:/android-mode}
as VM arguments.
- Run the “ant dist” command in the processing-android root folder.
- Start processing-app from the run menu. The Android Mode should now be present in the Mode menu.
- In order to run a debug session including breakpoints in the source code, add the processing and processing-android folders in the Source tab of Run Configurations dialog.
- Go to File > Project Structure > Modules > Add > Import Module > Select Processing-Android folder > Import module from external model (Eclipse) > Select all projects
- Go to File > Settings > Appearance & Behaviour > Path Variables and set the ANDROIDJAR variable’s(create if not present) value to the android.jar file located in the platforms/android-xx folder of your android sdk (where xx is the Android API level). Also create a new variable called PROC_AND (or anything you want) and set its value to your processing-android folder.
- Run the ant command in the processing-android/core folder to build the core library first then “ant dist” in the processing-android root folder.
- Set the VM options parameter of the run configuration to
-Dusemode=processing.mode.android.AndroidMode:$VAR$
. Replace VAR with the variable you created in step 2 (e.g.: PROC_AND). - Run the project. The Android Mode should now be present in the Mode menu.