using processing in android

15
Using Processing in Android - Karan Balkar

Upload: karan-balkar

Post on 22-Jun-2015

664 views

Category:

Technology


3 download

DESCRIPTION

Getting started with Processing framework in Android

TRANSCRIPT

Page 1: Using Processing in Android

Using Processing in Android

- Karan Balkar

Page 2: Using Processing in Android

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

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

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

Mode selectText editor

Sketchconsole

output

Page 6: Using Processing in Android

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

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

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

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

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

Touch eventsUsing custom or installed fontsOrientationWorking with SensorsUsing Ketai (third party library)

DEMOS

Page 12: Using Processing in Android

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 14: Using Processing in Android

THANK YOU!

Page 15: Using Processing in Android

QUESTIONS??