- Processing for Android
- Developing with Android Studio
- General steps
- Using Bintray packages
- Processing for Android
- The Android Mode
- Stable releases
- The 4.1 release: integrated debugger and Augmented Reality
- The 4.0 release: wallpapers, watch faces, and Realidad Virtual
- Processing for Android
- Getting Started
- Using Sensors
- Distributing Apps
- Using Android Studio
- Live wallpapers
- Watch Faces
- Location and permissions
- Introduction to VR
- Advanced VR
- AR in Processing
- Processing core android source
- processing / processing-android Go PK Goto Github PK
- processing-android’s Introduction
- Contributors
- Stargazers
- Watchers
- Forkers
- processing-android’s Issues
- implement size() and createGraphics() for arbitrary renderers
- Unable to locate javac
- Fatal error while starting 3D sketch on Android device
- no sketch involving P3D or OPENGL will run on emulator or device
- Processing can’t create emulator.
- Background is copied in the transparents parts of a textured shape
- orientation changes cause «Cannot call endDraw() before beginDraw()» error
- add support for icon-96 for xhdpi icons
- OpenGL Android sketches eventually run of memory
- NullPointerException when calling PImage.resize()
- Arc displayed transparent
- Creating a custom renderer
- means for libraries to automatically add to AndroidManifest.xml when they’re imported
- “Smooth is not supported by this hardware (or driver)” with Nexus 4, Android 4.2.2
- Proposal for a fix of a synchronisation issue with the dequeueing of the eventQueue in android-core.
Processing for Android
Developing with Android Studio
Use Android Studio for advanced Android development with Processing’s core library.
General steps
Android Studio is the tool recommended by Google for Android development. If you’ve already have experience on how to develop Android applications using Android Studio (separately from Processing), and want to make use of the Processing core library in your Android Studio projects, this tutorial can be useful.
All our core code is bundled inside the processing-core.zip, which is inside the AndroidMode folder. You just need to copy this file as processing-core.jar and add it as a dependency to your project. Step by step procedure for Android Studio is as follows:
1. Create an Android project if you haven’t already created one. Start with selecting an Empty Activity:
2. Enter project name, package name and minimum SDK version. Keep the ‘Use legacy android.support libraries’ option unchecked as the latest android processing core is migrated to androidx. After that click on ‘Finish’ button:
3. Copy processing-core.zip (located in the AndroidMode folder in Processing) to /app/libs, rename it to processing-core.jar:
4. To add it as a jar dependency, Click on File -> Project Structure. A dialog box will appear:
5. Select ‘dependencies’ in the left most panel and then click on ‘app’ in modules panel. Click on plus button under Declared Dependencies and then click on Jar Dependency. Another dialog box will appear:
6. In the add jar dialog enter path as ‘libs/processing-core.jar’ and in Step 2, enter scope as ‘implementation’. Click on ‘OK’, ‘Apply’ and then again ‘OK’:
7. Then, write your sketch code by extending PApplet, for example:
8. Initialize the sketch in the main activity:
9. Finally, create a simple layout for the main activity:
The complete Android Studio project is available here.
Using Bintray packages
The processing-core library is also available as a package on Bintray. This package can be easily imported into a Gradle project using the following dependency snippet:
Источник
Processing for Android
The Android Mode
The main component of Processing for Android is the Android mode, a programming mode for the Processing Development Environment (PDE) that adds all the options needed to run Processing sketches on Android devices and also in the emulator.
You could also use only the Android core library to develop Android apps with the IDE of your choice, see this tutorial for more details.
Stable releases
The latest stable release of the Android mode can be installed through the Contribution Manager (CM) in the PDE. To open the CM, click the arrow in the mode selector in the menu bar, and choose «Add Mode. «:
Once the CM window shows up, select the Android Mode from the list, and then click the install button in the bottom of the window:
After installing the mode, you will be able to switch into it using the mode selector in the menu bar. Follow the Getting Started tutorial for the first steps with the Android mode.
The 4.1 release: integrated debugger and Augmented Reality
Version 4.1 introduces two significant additions to Processing for Android: an integrated debugger, just like the one available in the Java mode, and a new AR library based on ARCore.
The 4.0 release: wallpapers, watch faces, and Realidad Virtual
Version 4.0 brings several improvements to the Android mode, incuding new functionality for creating live wallpapers, watch faces, and VR apps. You will find more on how to use this functionality in the tutorials and the reference pages of this site.
Источник
Processing for Android
Getting Started
By the Processing Team
Welcome to Processing for Android! In this tutorial you will learn how to use the Android Mode in Processing to run your sketches on an Android device or in the emulator.
Using Sensors
By the Processing Team
This tutorial gives you the basics of reading sensor data from Processing.
Distributing Apps
By the Processing Team
In this tutorial we will cover the steps to publish your Processing sketch as an app in the Google Play store.
Using Android Studio
By the Processing Team
Use Android Studio for advanced Android development with Processing’s core library.
Live wallpapers
By Andres Colubri
Use the Android Mode to develop interactive live wallpapers.
Watch Faces
By Andres Colubri
Use the Android Mode to develop interactive watch faces.
Location and permissions
By Andres Colubri
Learn to access location using GPS, and properly set the sketch permissions in Android 6+ devices.
Introduction to VR
By Andres Colubri
Get started with Google VR to write immersive apps using Processing.
Advanced VR
By Andres Colubri
Designing experiences in Virtual Reality through interaction and movement.
AR in Processing
By Andres Colubri
How to create Augmented Reality apps using Processing for Android.
Источник
Processing core android source
Since the release of Processing 3.5.4 in January 2020, development has moved to a new repository.
Using a 4.0 release (even an alpha or beta version) is recommended if you find an issue. To avoid confusion, this repo will remain open at least until a 4.0 release is the default download at https://processing.org/download. We chose to move to a new repository so that we could clean out old files accumulated over the last 20 years.
This is the official source code for the Processing Development Environment (PDE), the “core” and the libraries that are included with the download.
I’ve found a bug! Let us know here (after first checking if someone has already posted a similar problem). If it’s a reference, web site, or examples issue, take that up with folks here. There are also separate locations for Android Mode, or the Video and Sound libraries. The processing.js project is not affiliated with us, but you can find their issue tracker here.
Locked Issues Where possible, I’ve started locking issues once resolved. This helps reduce the amount of noise from folks adding to an issue that’s been closed for years. Because this project has existed for a long time and we have thousands of closed issues, lots of them may sound similar to an issue you’re having. But if there’s a new problem, it’ll be missed if it’s lost in a comment added to an already closed issue. I don’t like to lock issues because it cuts off conversation, but it’s better than legitimate problems being missed. Once an issue has been resolved for 30 days, it will automatically lock.
That processing-bugs fella is suspicious. The issues list has been imported from Google Code, so there are many spurious references amongst them since the numbering changed. Basically, any time you see references to changes made by processing-bugs, it may be somewhat suspect. Over time this will clean itself up as bugs are fixed and new issues are added from within GitHub. Help speed this process along by helping us!
Please help. The instructions for building the source are here. Please help us fix problems, and if you’re submitting code, following the style guidelines helps save me a lot of time.
And finally. Someday we’ll also fix all these bugs, throw together hundreds of unit tests, and get rich off all this stuff that we’re giving away for free. But not today.
So in the meantime, I ask for your patience, participation, and patches.
Источник
processing / processing-android Go PK Goto Github PK
Processing mode and core library to create Android apps with Processing
Java 87.20% GLSL 1.38% Python 0.08% Processing 11.20% Groovy 0.14% android mobile learning education art design ar vr
processing-android’s Introduction
Processing for Android
This is the main repository for Processing for Android. It includes the core library inside the core folder, and the mode itself in the root. See the wiki for build instructions.
Contributors
Stargazers
Watchers
Forkers
processing-android’s Issues
implement size() and createGraphics() for arbitrary renderers
Unable to locate javac
I just downloaded Processing 2.1.1, and when I try to run my Android sketch, I get the following error in the console:
[javac] Unable to locate an executable at «/Applications/Processing.app/Contents/PlugIns/jdk1.7.0_51.jdk/Contents/Home/jre/bin/javac» (-1)
If I open the Processing.app package and navigate to the mentioned folder, I find an executable called java but nothing called javac . I tried renaming java to javac but this just creates more (and different) errors.
Fatal error while starting 3D sketch on Android device
Issue by RafaelNadal
Saturday Apr 12, 2014 at 19:06 GMT
Originally opened as processing/processing-android-archive#65
I have processing 2.0.3 for win7 64bit. I can run all my 3D sketches on Samsung SIII with android 4.2.2 and 4.3.
On my HP Slate 7 HD with Android 4.2.2 I can run any non-3D sketches. HP Slate 7 HD supports OpenGL ES 1.0, 1.1, 2.0 and runs well non-Processing 3D apps.But when I start any 3D sketch (the same which run well on Samsung) I have the following error (showing up at the bottom in Processing IDE):
FATAL EXCEPTION: GLThread 873
java.lang.RuntimeException: Cannot link shader program:
at processing.core.PGraphics.showException(Unknown Source)
at processing.opengl.PShader.init(Unknown Source)
at processing.opengl.PShader.getAttributeLoc(Unknown Source)
at processing.opengl.PGraphicsOpenGL$LightShader.loadAttributes(Unknown Source)
at processing.opengl.PGraphicsOpenGL$TexlightShader.loadAttributes(Unknown Source)
at processing.opengl.PGraphicsOpenGL.getPolyShader(Unknown Source)
at processing.opengl.PShapeOpenGL.renderPolys(Unknown Source)
at processing.opengl.PShapeOpenGL.render(Unknown Source)
at processing.opengl.PShapeOpenGL.draw(Unknown Source)
at processing.core.PGraphics.shape(Unknown Source)
at processing.core.PApplet.shape(Unknown Source)
at processing.test.texture_cube.texture_cube.draw(texture_cube.java:40)
at processing.core.PApplet.handleDraw(Unknown Source)
at processing.opengl.PGL$AndroidRenderer.onDrawFrame(Unknown Source)
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1516)
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)
>
What could be the reason for that?
no sketch involving P3D or OPENGL will run on emulator or device
Processing can’t create emulator.
Issue by vormplus
Friday Jun 07, 2013 at 14:24 GMT
Originally opened as processing/processing-android-archive#41
There is a problem when you start a sketch for the first time and have multiple Android APIs installed on your machine. I tried creating the virtual device with the command I found in the Processing console. If there is more than one ABI installed on the machine, you need to specify which one to use. Adding —abi x86 at the end of this command does create the right virtual device. Sketches can run without a problem now.
This is the output of the terminal:
Cloudswimmers-MBP:tools janvantomme$ ./android create avd -n Processing-0217 -t android-10 -c 64M -s WVGA800
Valid ABIs: armeabi, x86
Error: This platform has more than one ABI. Please specify one using —abi.
Cloudswimmers-MBP:tools janvantomme$ ./android create avd -n Processing-0217 -t android-10 -c 64M -s WVGA800 —abi x86
Android 2.3.3 is a basic Android platform.
Do you wish to create a custom hardware profile [no]n
Created AVD ‘Processing-0217’ based on Android 2.3.3, Intel Atom (x86) processor,
with the following hardware config:
hw.lcd.density=240
vm.heapSize=24
hw.ramSize=256
Cloudswimmers-MBP:tools janvantomme$
Background is copied in the transparents parts of a textured shape
orientation changes cause «Cannot call endDraw() before beginDraw()» error
add support for icon-96 for xhdpi icons
Issue by nneonneo
Friday May 24, 2013 at 02:52 GMT
Originally opened as processing/processing-android-archive#37
xhdpi resolution is used by default on some devices, e.g. Samsung Galaxy S3. Processing should understand icon-96.png in the data folder, and generate an xhdpi icon from it. Otherwise, we get the generic Processing icon, which is not desirable.
OpenGL Android sketches eventually run of memory
NullPointerException when calling PImage.resize()
Arc displayed transparent
Issue by nurecas
Wednesday Mar 05, 2014 at 03:23 GMT
Originally opened as processing/processing-android-archive#63
Arcs are displayed transparent, is.without fill if a mode like OPEN or CHORD is explicitly specified. If it is not specified it works fine.
Creating a custom renderer
Moved from processing/processing#2390
Hi there, just working on something that will resolve the problems SMT was having with the latest version of processing — a custom renderer. I have it working fully on the desktop on Windows and Linux ( can’t test on mac ). I ran into a problem on Android however.
This works on the desktop:
However this fails on android:
With the following logcat output:
Help of any kind would be nice. Advice as to where to look and the like would be great.
means for libraries to automatically add to AndroidManifest.xml when they’re imported
“Smooth is not supported by this hardware (or driver)” with Nexus 4, Android 4.2.2
Issue by benfry
Sunday May 12, 2013 at 21:38 GMT
Originally opened as processing/processing-android-archive#3
Proposal for a fix of a synchronisation issue with the dequeueing of the eventQueue in android-core.
I had a consistent problem while handling touch-events in an application that has noLoop() in setup() and uses redraw() whenever the screen needs to be redrawn after a relevant touch-event. The exception «Nothing left on the event queue» was thrown from InternalEventQueue.remove() at arbitrary moments.
The problem was that two threads tried to dequeue the eventsQueue concurrently. The GLThread called PApplet.dequeueEvents() from PApplet.handleDraw() concurrently with the main thread which called PApplet.dequeueEvents() from PApplet.postEvent(), which is called from PApplet.nativeMotionEvent(). Below you can find a trace of a concrete situation.
I’m not deeply familiar with the implementation, but it seems that PApplet.postEvent() should not call PApplet.dequeueEvents() when either looping or redraw is true. This would be fixed as follows:
It might also be necessary to synchronize dequeueEvents() to avoid a potential race condition when postEvent() in the main thread checks the (!looping && !redraw) condition right before redraw is set to true in redraw(). The main thread would then continue with dequeueEvents() while the GLThread would at some point call handleDraw() which would call dequeueEvents() concurrently.
This trace is produced by these trace instructions:
Источник