using processing in android
DESCRIPTION
Getting started with Processing framework in AndroidTRANSCRIPT
![Page 1: Using Processing in Android](https://reader033.vdocuments.site/reader033/viewer/2022052600/5587c9ecd8b42a7d598b465c/html5/thumbnails/1.jpg)
Using Processing in Android
- Karan Balkar
![Page 2: Using Processing in Android](https://reader033.vdocuments.site/reader033/viewer/2022052600/5587c9ecd8b42a7d598b465c/html5/thumbnails/2.jpg)
What is Processing?
Processing is an open source programming language.
It also serves as an IDE that teaches basic computer programming fundamentals in a visual context.
Processing is based on the Java language that uses simple syntax and a graphical programming model.
![Page 3: Using Processing in Android](https://reader033.vdocuments.site/reader033/viewer/2022052600/5587c9ecd8b42a7d598b465c/html5/thumbnails/3.jpg)
A look back..!The processing project was started in 2001 by
Casey Reas and Benjamin Fry.It is a cross platform object oriented framework
designed for non programmers to get started with programming.
Processing is a descendant of DBN (design by numbers) project that was developed to teach the structure and interpretation of software in a visual manner.
The current version of Processing is 2.0.3 (as on 30th step 2013).
![Page 4: Using Processing in Android](https://reader033.vdocuments.site/reader033/viewer/2022052600/5587c9ecd8b42a7d598b465c/html5/thumbnails/4.jpg)
Processing componentsSketch bookThe sketch book serves as an alternative to an IDE and is a more lightweight way to organize projects.
SketchA short piece of code ( a direct descendant of John Maeda’s work in Design By Numbers)
If you think as designers, coding could be a thought of a task more similar to sketching.
![Page 5: Using Processing in Android](https://reader033.vdocuments.site/reader033/viewer/2022052600/5587c9ecd8b42a7d598b465c/html5/thumbnails/5.jpg)
Mode selectText editor
Sketchconsole
output
![Page 6: Using Processing in Android](https://reader033.vdocuments.site/reader033/viewer/2022052600/5587c9ecd8b42a7d598b465c/html5/thumbnails/6.jpg)
Getting ready to Sketch
Hello world in Processingline(15, 25, 70, 90);
PApplet is the base class for all sketches that use processing.core
Class PApplet java.lang.Object
◦ java.awt.Component java.awt.Container
◦ java.awt.Panel java.applet.Applet
◦ processing.core.PApplet
![Page 7: Using Processing in Android](https://reader033.vdocuments.site/reader033/viewer/2022052600/5587c9ecd8b42a7d598b465c/html5/thumbnails/7.jpg)
Getting ready to Sketch (contd.)
You cannot use most of the AWT or Swing (built on the AWT) since it will interfere with the graphics model of Processing.
Processing runs in a Frame and not a JFrame. It is possible to use PApplet with core.jar in other projects.
One can embed the PApplet inside any GUI component just as in the normal way.
![Page 8: Using Processing in Android](https://reader033.vdocuments.site/reader033/viewer/2022052600/5587c9ecd8b42a7d598b465c/html5/thumbnails/8.jpg)
Putting Android to work!
Processing 2.0 introduced the new Android mode allowing developers to create and run a program on Android devices.
Users can switch from the default standard mode to the Android mode.
Android SDK needs to be downloaded and configured prior to using it in Processing
![Page 9: Using Processing in Android](https://reader033.vdocuments.site/reader033/viewer/2022052600/5587c9ecd8b42a7d598b465c/html5/thumbnails/9.jpg)
First program on Android
//Program
void setup(){ size(480,800); fill(255); rectMode(CENTER); };
void draw() { background(#FF9900); rect(width/2, height/2, 150, 150);};
![Page 10: Using Processing in Android](https://reader033.vdocuments.site/reader033/viewer/2022052600/5587c9ecd8b42a7d598b465c/html5/thumbnails/10.jpg)
Running the sketch on emulatorOpen the sketchGo to Android > Android mode to enable
Android modeHit the Run button Instead of opening in a window as desktop
Processing sketches, you’ll see an Android emulator appear.
![Page 11: Using Processing in Android](https://reader033.vdocuments.site/reader033/viewer/2022052600/5587c9ecd8b42a7d598b465c/html5/thumbnails/11.jpg)
Touch eventsUsing custom or installed fontsOrientationWorking with SensorsUsing Ketai (third party library)
DEMOS
![Page 12: Using Processing in Android](https://reader033.vdocuments.site/reader033/viewer/2022052600/5587c9ecd8b42a7d598b465c/html5/thumbnails/12.jpg)
Points to remember
The Android code for Processing is incomplete and contains bugs. It should be considered "beta" quality.
Supports Android 2.3.3 (API 10) and later.Not a general purpose language.No official support for ARM based devices.
Official source code found at https://code.google.com/p/processing/
![Page 13: Using Processing in Android](https://reader033.vdocuments.site/reader033/viewer/2022052600/5587c9ecd8b42a7d598b465c/html5/thumbnails/13.jpg)
Referenceshttp://processing.googlecode.com/svn/tru
nk/processing/build/javadoc/core/processing/core/PApplet.html
http://wiki.processing.org/w/FAQhttps://en.wikipedia.org/wiki/Processing_(p
rogramming_language)http://processing.org/http://wiki.processing.org/w/Android
![Page 14: Using Processing in Android](https://reader033.vdocuments.site/reader033/viewer/2022052600/5587c9ecd8b42a7d598b465c/html5/thumbnails/14.jpg)
THANK YOU!
![Page 15: Using Processing in Android](https://reader033.vdocuments.site/reader033/viewer/2022052600/5587c9ecd8b42a7d598b465c/html5/thumbnails/15.jpg)
QUESTIONS??