Hello,everyone!Now,I could use procssing in Eclipse on a Mac to present on an android.I am developing the sky star view application. for example
package
com.android.processing;
import processing.core.*;
public class ProcessingandroidActivity extends PApplet {
int dir= 100;
int year, month, day, hour, minute, second;
public void setup() {
size(screenWidth,screenHeight);
background(0);
PFont font = createFont("MS Gothic",24,true);
textFont(font);
year = 2012;
month = 1;
day = 1;
hour = 0;
minute = 0;
}
public void draw() {
background(0);
textSize(25);
fill(255,255,0);
textAlign(LEFT);
stroke(255);
line(0,screenHeight-230,screenWidth,screenHeight-230);
text("方角:", 10, screenHeight-200);
text(dir,70, screenHeight-200);
text("度",110,screenHeight-200);
text("年:", 10, screenHeight-150);
text(year, 40, screenHeight-150);
text("月:", 90, screenHeight-150);
text(month, 120, screenHeight-150);
text("日:", 150,screenHeight-150);
text(day, 170,screenHeight-150);
text("時:",200,screenHeight-150);
text(hour, 230, screenHeight-150);
}
static public void main(String args[]) {
PApplet.main(new String[] { "Test" });
}
}
I could read the star data from sqlite database at processing standard environment. the code as following
import de.bezier.data.sql.*;
SQLite db;
boolean pressflag = false;
float scalex,scaley;
int dir=100;
int year, month, day, hour, minute, second;
double mjd, lambda, gmst, lst;
double H, theta, delta, phi;// could you tell me the meaning of every variable ?
double[][] star = new double[3143][9];
double[][] star2 = new double[3143][9];
void setup(){
size(630,390);// the area of screen
background(0);//background color
frameRate(30);//画面更新率
PFont font = createFont("MS Gothic",24,true);//font of character
textFont(font);
year = 2012;
month = 1;
day = 1;
hour = 0;
minute = 0;
second = 0;
lambda = 135.362305;
phi = 36.5626;
// query the database
db = new SQLite( this, "bsc5.db" );
if ( db.connect() ){
db.query( "SELECT name as \"Name\" FROM SQLITE_MASTER where type=\"table\"" );
while (db.next()) println( db.getString("Name") );
db.query( "SELECT * FROM bsc5" );
while (db.next()){
star[starcount][0] = db.getFloat("raj2000");
star[starcount][1] = db.getFloat("dej2000");
star[starcount][2] = db.getFloat("vmag");
star[starcount][3] = db.getFloat("hr");
star[starcount][4] = db.getFloat("begin");
star[starcount][5] = db.getFloat("end");
star[starcount][6] = db.getFloat("jpname");
star[starcount][7] = db.getFloat("gra");//I am sorry I cann`t find the jpname, gra and gde in the database which I got from Mr Hiraba yashi,could you tell me what`s meaning of these?
star[starcount][8] = db.getFloat("gde");//
starcount++;
}
}
}
But now ,I want to read the star data from the sqlite database which can be run in the android in the eclipse environment.I don't know how to do,if you know ,please tell me!
Thanks in advance!