Showing posts with label Processing. Show all posts
Showing posts with label Processing. Show all posts
Saturday, September 29, 2012
Building an .apk file from your Processing sketch on OSX in order to publish it in Google Play
Building a comercial app for Android OS.
Processing is capable of run the sketch directly on device, however, it doesn't generate the file with a commercial format, that is a signed .apk. In order to get that file, there is a list of procedures to make.
Preparing the sketch
Create icons
It's indicated that you create the icons that will appear when a customer install the application. To get that, you should create three versions of the same icon with different resolutions in png (36x36px, 48x48px and 72x72px), name them as "icon-36.png", "icon-48.pg" and "icon-72.png" and place them inside the sketch folder (not data folder or any other subfolder).
Exporting the sketch
With the sketch opened in Processing in Android Mode, go to File > Export Android Project. It wil create an "android" folder inside the sketch folder with the project.
I had problems exporting with the 2.0 beta version of Processing. I used the version 2.0a.6.
Signing
Installing Tools
The programs needed are Apache Ant, Java Development for OSX, MacPorts, OpenSSL and Android SDK.
Install Apache Ant, that could be download there: http://ant.apache.org/bindownload.cgi
Extract the archive and rename to "ant". Open Terminal and browse to ant folder. Use the command below to move the folder to ".usr/local":
mv ant /usr/local
Next, type the following command:
cd /usr/local
ln -s ant ant
Open the archive "bashrc"inside "/etc" with the command
sudo pico bashrc
add the following lines in the end of the text
export ANT_HOME=/usr/local/ant
export PATH=${PATH}:${ANT_HOME}/bin
Press control+x to exit and save the file without rename it.
Close Terminal and open it again. Type
ant
If the message “build.xml does not exist” appears, the process is successful.
Install Java Development for OSX https://developer.apple.com/downloads/index.action (mine was Java for OSX 2012-005 Developer Package)
Install MacPorts (http://www.macports.org/install.php).
Use MacPorts to install OpenSSL with the following command:
sudo port sync; sudo port selfupdate; sudo port install openssl
If you don't have the Android SDK installed, Install Android SDK: download this file and extract it into a safe place: http://developer.android.com/sdk/index.html. Go to the folder "tools" and open the file "android". Next, download the packages. I suggest you download everything you could.
Create the secret key
Open Terminal and browse to the folder in which the Android project were exported.
Create the secret key in order to sign the app.
Type the syntax below replacing the data inside brackets, including the brackets "{}"with the actual names and paths.
keytool -genkey -v -keystore {sketchName}-release-key.keystore -alias {yourName} -keyalg RSA -keysize 2048 -validity 10000
It will be made various questions like your name and last name, city, etc. Fill everithing and type return everytime. When it's done, the following message will be showed [Storing {sketchName}-release-key.keystore], and the file will be stored inside the android folder.
Build an unsigned .apk file
Open Terminal, browse to the android folder and type
ant release
When the build is complete, the message "Build Successful"will be showed and the folde /bin with the unsigned apk file will be created inside the folder "android".
Sign the apk file with the secret key replacing the data inside brackets, and the brackets, with actual data
jarsigner -verbose -keystore {sketchName}-release-key.keystore {complete/path/to/sketchFolder/android/bin/sketchName-unsigned.apk} {Your name (that you defined in the secret key step)}
Hit return
It wil ask you to insert the password that you defined in the secret key step
Next, verify if jarsigner did what it had to with the following command"
jarsigner -verify {complete/path/to/sketchFolder/android/bin/sketchName-unsigned.apk}
The following message will appear:
jar verified.
Finally, build an signed apk ready to publish in Google Play with the command:
zipalign -v 4 {complete/path/to/sketchFolder/android/bin/sketchName-unsigned.apk} {sketchName}.apk
A long list of messages will appear and the message "Verification successful" will be showed
If everything worked, there will be a new file with the name {sketchName}.apk inside the "android" folder.
But, I had a problem. When I called the command "zipalign", the message "command not found" appeared.
What I did (and worked fine) is to open Terminal and browse inside the folder that you installed the Android SDK tools " /android-sdk-macosx/tools" and type the following command:
./zipalign -v 4 {complete/path/to/sketchFolder/android/bin/sketchName-unsigned.apk} {sketchName}.apk
In this case, the file {sketchName}.apk will be builded inside the "tools" folder.
This is the file ready to publish in Google Play.
Thats it! I hope you enjoy!!
Friday, July 27, 2012
Links super interessantes sobre Creative Coding
P5 = processing, Py = Python, Ar = Arduino, JS = JavaScript, C++ = C++
♥ = HOT!
TOOLS
♥ Processing an open source programming language and environment for people who want to create images, animations, and interactions P5
♥ Cinder C++
♥ openFrameworks C++
♥ Python Py
PyProcessing Python package that creates an environment for graphics applications that closely resembles that of the Processing system P5 Py
NLTK Natural Language Toolkit Py
Regular Expression Generator P5 Py JS C++
MongoDB Scalable, high-performance, open source, document-oriented database JS
Structure Synth a cross-platform application for generating 3D structures by specifying a design grammar
Field an environment for writing code to rapidly and experimentally assemble and explore algorithmic systems
Polycode a free, open-source, cross-platform framework for creative code C++
HYPE framework a collaborative visual framework developed in FDT and AS3
pixeltoaster a library for C++ programmers who want to write their own software rendering routines, reading and writing to an array of pixels C++
NodeBox a Mac OS X application that lets you create 2D visuals (static, animated or interactive) using Python programming code and export them as a PDF or a QuickTime movie Py
vvvv a graphical programming environment for easy prototyping and development
GETTING STARTED
♥ Processing Tutorials A collection of step-by-step lessons covering beginner, intermediate, and advanced topics. P5
Learning Processing A Beginner's guide to programming images, animation, and interation. By Daniel Schiffmann P5
Processing Demos by Prof. Jarek Rossignac for his 3D Graphics, Modeling, Animation and Compression Classes P5
Processing Video Tutorials P5
Hello, Cinder C++
AUDIO
SuperCollider A real time audio synthesis programming language
SuperCollider Reference Manual
ChucK Strongly-timed, Concurrent, and On-the-fly Audio Programming Language
Pure Data a real-time graphical programming environment for audio, video, and graphical processing
maximilian Audio synthesis library C++
Understanding FFT
USING THE INTERNET
♥ Processing.js You write code using the Processing language, include it in your web page, and Processing.js does the rest. P5 JS
Twitter & Processing Accessing the Twitter API with the twitter4j libraryP5
toxiclibs.js Open-source computational design library ported to javascript JS
Multi-threading in JavaScript How to run intense javascript JS
Creepy Application that allows you to gather geolocation related information about users from social networking platforms and image hosting services
ELECTRONICS AND HARDWARE
♥ Arduino Ar
arduino/of/code/class Ar C++
ladyada Ar
Drawing Robot Ar
Attaching a Motorola C168i to an Arduino Ar
Arduino in XCode Ar
TV Out A composite video output library for AVR/Arduino Ar
Arduino Tutorials Ar
Arduino Tutorials Ar
How to Hack Toy EEGs Brain Wave Readers Ar
Microprinter Hacking Receipt Printers Ar
Hacking Nintendo Games Cory Arcangel
MAX232 Serial Level Converter Ar
3D
OpenGL Tutorials
OpenGl The red book
OpenGl on iPhone C++
THREEJS WebGL Graphics Library JS
Meshes in Cinder C++
CONNECTING THINGS
OSCemote Send Open Sound Control messages to other programs using an iPhone or iPod touch
SMS to Email Using text messages with computers Py
VoiceXML 2.0 Helping developers to build the highest quality voice-enabled applications
iPhone Serial Communication C++
iProcessing Open programming framework to help people develop native iPhone applications using the Processing language. P5
Node.js access serial ports through javascript JS
VISUALS WITH MATH AND PHYSICS
The Nature of Code Programming strategies and techniques behind computer simulations of natural systems. By Daniel Shiffman P5
Particles, vector fields, box2d C++
fractals, computer graphics, mathematics, demoscene and more C++
Clever Algorithms Nature-Inspired Programming Recipes C++
outstanding geometry, graphics programming C++
Boids basic flocking model
Easy Ray Tracing P5Sunflow is an easy way to make your Processing sketches look sexy as hell. Well, only three-dimensional ones... P5
Projecting on Quads P5
Python for Math Teachers Py
DATA VISUALIZATION
Getting Started with Processing and Data Visualization P5
JavaScript InfoVis Toolkit JS
dygraphs JavaScript Visualization Library JS
Travel Time Tube Map P5
Map Projections Java applet + code of different map projections P5
geo-location-javascript javascript geo location framework for the mobile web JS
googlemaps python googlemaps module Py
GeoNames Geographical database covers all countries and contains over eight million placenames that are available for download free of charge.
OpenStreetMap Free editable map of the whole world.
Creating Contour Maps P5
COMPUTER VISION
Frame Differencing P5
Kinect and Processing P5
Hand Tracking w/Kinect C++
Computer Vision Algorithms and Applications by Richard Szeliski
TEXT/LANGUAGE
Generating pseudo random text with Markov chains using Python Py
VIDEOGAMES
Pygame Set of Python modules designed for writing games Py
Flixel an open source game-making library
GET HELP
Processing Forum P5
Stack Overflow P5 Py JS C++
OpenFrameworks Forum C++
BOOKS
♥ Processing: A Programming Handbook for Visual Designers and Artists by Casey Reas and Ben Fry
Getting Started with Processing by Casey Reas and Ben Fry
Programming Interactivity: A Designer's Guide to Processing, Arduino, and openFrameworks by Joshua Noble
Visualizing Data by Ben Fry
♥ Getting Started with Arduino by Massimo Banzi
Programming Collective Intelligence: Building Smart Web 2.0 Applications by Toby Segaran
♥ Handmade Electronic Music: The Art of Hardware Hacking by Nicolas Collins
Mining the Social Web by Matthew A. Russell
Generative Art by Matt Pearson
BLOGS/WRITING/THEORY/SHOWCASES
Hack a Day
Rhizome
Vauge Terrain DIGITAL ART / CULTURE / TECHNOLOGY
Creative Applications Apps That Inspire...
OpenProcessing Share Your Sketches!
Generator.x Software and generative strategies in art and design
neural new media art, electronic music, hacktivism
information aesthetics Information Visualization & Visual Communications
runme.org say it with software art!
The Teeming Void generative art and design, data aesthetics, digital materiality; theory, criticism and practice
ctheory.net an international peer-reviewed journal of theory, technology, and culture
Grand Text Auto a group blog about computer narrative, games, poetry, and art
How To Become a Hacker
43 Dodgy Statements on Computer Art
Geoff Cox on Software and Art
ARTISTS
Cory Arcangel
Blast Theory
Mr.doob
Mary Flanagan
Ben Fry
Futurefarmers
Robert Hodgin (Flight 404)
Natalie Jeremijenko
Aaron Koblin
David Kraftsow
Steve Lambert
Caleb Larsen
Rober Lazzarini
Golan Levin
Eva and Franco Mattes
Greg Niemeyer
Josh Nimoy
Marisa Olson
Jon Rafman
Casey Reas
Rafael Rozendaal
Jason Salavon
Daniel Shiffman
Jennifer Steinkamp
Penelope Umbrico
Camille Utterback
IRL
HackerSpace Wiki
Marcadores:
Arduino,
Creative Coding,
OpenFrameworks,
Processing,
Pure Data
Tuesday, July 17, 2012
Monday, July 16, 2012
Apresentando: Processing
O Processing é uma linguagem e ambiente de programação open source e grátis, baseada em Java, mas com sintaxe simplificada, o que é ideal para ao primeiro contato com o mundo da programação.
O projeto foi iniciado por Casey Reas e Ben Fry, integrantes do MIT Media Lab em 2001 e agora conta com milhares de colaboradores e usuários em todo mundo.
A versão mais atual é a 2.0a6 (alfa) e a versão estável é a 1.5.1. O download pode ser feito aqui: http://processing.org/download/.
O Processing é extremamente prático: fácil de instalar, facil de adicionar bibliotecas, conta com um site muito bem estruturado (http://processing.org/), referências bem documentadas, além de ter um IDE extremamente limpo.
Uma de suas maiores virtudes em relação às linguagens de programação comerciais é que o Processing apresenta respostas (visuais ou sonoras) imediatas: basta escrever o código e clicar no botão "run". A compilação é geralmente muito rápida e o resultado aparece na janela que é aberta. Isso torna o aprendizado muito mais fácil e intuitivo.
Uma pergunta pertinente é "o que o Processing faz?". Uma resposta é: tudo o que a imaginação permitir, de meros esboços a jogos completos, aplicativos, instalações artísticas interativas, trabalhos em audio e video, entre outros.
Um porém: o Processing é conhecido por ter limitações importantes: a principal é a lentidão na velocidade de processamento, já que ele roda em uma máquina virtual. Outro gargalo são as bibliotecas, pois algumas vezes o que é cogitado não é alcançado devido a ausência de uma determinada biblioteca que execute alguma função muito específica, mas nada impede que programadores mais avançados escrevam novas bibliotecas que suplantem as necessidades.
Aliás, um ponto forte do Processing é a comunidade, que colabora desenvolvendo bibliotecas, compartilhando códigos, partilhando dúvidas e respondendo perguntas.
Características do Processing:
- Apesar do IDE limpo, também pode ser compilado no Eclipse ou mesmo em algum outro IDE Java.
- Possibilita exportar os sketches facilmente para web por javascript. Apesar de exportar para web, as bibliotecas de áudio ainda são limitadas para esse fim.
- Exporta diretamente para dispositivos móveis com sistema operacional Android.
- Com o Iprocessing e o Xcode, é possível exportar para IOS.
Para quem quiser saber a fundo sobre o Processing, uma boa descrição sobre o projeto está na página oficial http://processing.org/.
Há uma breve descrição histórica no Wikipedia http://pt.wikipedia.org/wiki/Processing_(linguagem_de_programa%C3%A7%C3%A3o).
O concorrente direto do Processing é o OpenFrameworks, que falarei mais detalhadamente em outro post. O OF é indiscutivelmente mais rápido que o Processing, pois ele é baseado em C++.
Para quem quiser ver o que o Processing faz, basta ver os vídeos inserido aqui: http://processing.org/exhibition/
Uma forma muito boa de aprender é pelo livro Learning Processing, a Beginner's Guide to Programming Images Animation and Interaction, de Daniel Shiffman.
http://www.learningprocessing.com/
Dúvidas? Poste um comentário!
Subscribe to:
Posts (Atom)

