Instead of core.jar, I imported the processing-core.jar. I don't know what's the difference, but the second one seems to work for me (maybe core.jar is okay too, but I can't remember).
If you can't find the processing-core.jar, do this:
1. start Processing (not eclipse) and write anything
2. turn on the Android mode (first you have to save it, i saved it on desktop) and then export the sketch
3. open Eclipse, start a new android project and when you have to import the processing-core.jar go to the exported sketch C:\ Desktop\ SKETCH\ android\ libs and in the libs directory you'll find the processing-core.jar
I suggest you to copy the processing-core.jar to a safer location so you can find it anytime you want.
In your project, open the src>your.package.com (your package) and write your code, here's an example:
- package patak.proba.net;
- import processing.core.*;
- public class ProbaActivity extends PApplet {
- public void setup() {
- size(480, 800);
- background(255);
- smooth();
- fill(0);
- stroke(0);
- }
- float x, y;
- public void draw() {
- background(255);
x = width/2 + 50*cos( (float)(0.0032*millis()) );
y = height/2 + 50*sin( (float)(0.005*millis()) );
- ellipse(x, y, 30, 30);
- line(0,0, x, y);
- line(width, 0, x, y);
- line(0, height, x, y);
- line(width, height, x, y);
- }
- public int sketchWidth() {
- return 480;
- }
- public int sketchHeight() {
- return 800;
- }
- }
Start the emulator and run your project.
Hope this helps!