using processing in android

Post on 22-Jun-2015

664 Views

Category:

Technology

3 Downloads

Preview:

Click to see full reader

DESCRIPTION

Getting started with Processing framework in Android

TRANSCRIPT

Using Processing in Android

- Karan Balkar

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.

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).

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.

Mode selectText editor

Sketchconsole

output

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

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.

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

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);};

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.

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

DEMOS

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/

THANK YOU!

QUESTIONS??

top related