Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • Java Arrays
  • Java Strings
  • Java OOPs
  • Java Collection
  • Java 8 Tutorial
  • Java Multithreading
  • Java Exception Handling
  • Java Programs
  • Java Project
  • Java Collections Interview
  • Java Interview Questions
  • Java MCQs
  • Spring
  • Spring MVC
  • Spring Boot
  • Hibernate
Open In App
Next Article:
How to Speed Up Android Emulator?
Next article icon

How to Set Up Processing for Android?

Last Updated : 25 Jul, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

Introduction:

Processing is a free graphical library and Integrated Development Environment (IDE) built for the electronic arts and visual design communities. It is one of the most powerful libraries available today for creating visual algorithmic artworks, both 2D and 3D. It is open-source, based on Java, and comes with a large variety of functions geared to making drawing and painting with code both fun and easy. We can create different types of arts using our coding skills example, games, animation and physics engine, etc.

Using Processing's core library in your Android apps, you can create high-performance graphics and animations without dealing with Android's OpenGL or Canvas APIs. Usually, you won't even have to bother with low-level tasks such as managing threads, creating render loops, or maintaining frame rates. In this article, we will discuss how to set up Processing for Android. 

Step-by-Step Implementation

Step 1: Download Processing 3.0 for your operating system (OSX, Windows, or Linux) from this link.

1-660x358


Step 2: Extract The Zip file in any folder and open the processing.exe file.

Step 3: After the application opens click on the icon as shown below in image 'Add More'.

Step 4: Now install the Android Mode.

Step 5: Install Android SDK if you don't have it on your computer.

After installation of Android SDK, our installation part of  Processing for android is done now we make our project on it.

Run-on the Device

Now for running on our device we have to keep our device in developer mode as we do in android and through USB.

Example Code:

Java
// Program to show moving Ball and changing colour.  // Set up variable position,colour and velocity. PVector pos; PVector vel; int col;  // Function to set up size of canvas // and position,velocity and colour. void setup(){   size(600, 600);   pos = new PVector(width/2, height/2);   vel = new PVector(random(-4, 4), random(-4, 4));   col = floor(random(0, 255)); }  // Function to draw eclipse. void draw(){   background(col);   fill(231);   checkValid();   fill(204, 102, 0);   ellipse(pos.x, pos.y, 50, 50);   pos.add(vel); }  // Function to check the position  // of ball must be within screen. void checkValid(){   if(pos.x <= 25 || pos.x >= width - 25){     vel.x *= -1;          // Change in colour when it hit the wall.     col = floor(random(0 ,255));   }   if(pos.y <=25 || pos.y >= height - 25){     vel.y *= -1;          // Change in colour when it hit the wall.     col = floor(random(0 ,255));   } } 

 
 

Output:

WhatsAppVideo20210609at73713PM

To Run on Emulator

To run on an Emulator we have to install it.


 

To see it is installed or not go to C:\Users\Documents\Processing\android\sdk there must be a folder name Emulator. To run click "Run on Emulator".


 


 

In console:

Screenshot30


Output:

Note: If you can't able to run on the emulator then open processing.exe in administrator mode. 


 


Next Article
How to Speed Up Android Emulator?
author
_sh_pallavi
Improve
Article Tags :
  • Java
  • Android
Practice Tags :
  • Java

Similar Reads

  • How to Speed Up Android Emulator?
    Android Emulators are an important part of the android development environment. For creating awesome apps, Developers needs to test their app on different types of android devices. Devices can be real and virtual as well. The advantage of having an android emulator (virtual android device) is that t
    6 min read
  • How to Speed Up Android Studio?
    A slow Android Studio is a pain in the butt for an android developer. Developing an application with a slow IDE is not a cakewalk. It's also annoying that when you are focusing on the logic building for your app, and you got a kick to work and at that time your android studio suddenly starts lagging
    7 min read
  • How To Speed Up an Android Smartphone?
    Your Android smartphone may become slow with time, which can negatively impact your overall experience. Thankfully, there are several efficient methods for optimizing the speed and performance of an Android smartphone. This article will give you useful advice on how to boost your Android phone's spe
    6 min read
  • How to Use Proximity Sensor in Android?
    Proximity Sensor is one of the sensors present in mobile devices which we use almost every day. This sensor is present in the top section of your phone. The sensor is used to detect the presence of any object in the proximity of the phone. This sensor is used in many calling apps when the user keeps
    3 min read
  • How to Play Audio from URL in Android?
    Many apps require the feature to add the audio feature in their application and there so many audio files that we have to play inside our application. If we will store so many audio files inside our application, then it will increase the size of the app and this may reduce the user base due to the h
    4 min read
  • How to Play Video from URL in Android?
    In this article, you will see how to play a video from a URL on Android. For showing the video in our Android application we will use the VideoView widget. The VideoView widget is capable of playing media files, and the formats supported by the VideoView are 3gp and MP4. By using VideoView you can p
    3 min read
  • Android Project folder Structure
    Android Studio is the official IDE (Integrated Development Environment) developed by the JetBrains community which is freely provided by Google for android app development. After completing the setup of Android Architecture we can create an android application in the studio. We need to create a new
    3 min read
  • How to Use Static Method in Android?
    Android is an open-source operating system, based on the Linux kernel and used in mobile devices like smartphones, tablets, etc. Further, it was developed for smartwatches and Android TV. In this article, we are going to see how we can implement static methods in Android. We will be creating static
    5 min read
  • How Does Threading Work in Android?
    When an application is launched in Android, it creates the primary thread of execution, referred to as the “main” thread. Most thread is liable for dispatching events to the acceptable interface widgets also as communicating with components from the Android UI toolkit. To keep your application respo
    6 min read
  • How to Use Android Work Manager?
    We've taken it a step further in WorkManager 2.6 by adding support for Workers to operate in any process and allowing workers to be tied to a specific process. Multi-process functionality is very beneficial for programs that require Workers to operate in different processes. The majority of apps ope
    2 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences