Log in or register to post comments

please explain me these lines of codes

September 11, 2011 - 9:46am #1

these are lines of codes from the file ImageTargets.java in samples folder of QCAR.I am newbie.What for these variables are used and why those values are assigned.Please explain me this code.

// Application status constants:
private static final int APPSTATUS_UNINITED = -1;
private static final int APPSTATUS_INIT_APP = 0;
private static final int APPSTATUS_INIT_QCAR = 1;
private static final int APPSTATUS_INIT_APP_AR = 2;
private static final int APPSTATUS_INIT_TRACKER = 3;
private static final int APPSTATUS_INITED = 4;
private static final int APPSTATUS_CAMERA_STOPPED = 5;
private static final int APPSTATUS_CAMERA_RUNNING = 6;

// Name of the native dynamic libraries to load:
private static final String NATIVE_LIB_SAMPLE = "ImageTargets";
private static final String NATIVE_LIB_QCAR = "QCAR";

Re: please explain me these lines of codes

September 15, 2011 - 12:11am #3

thanks for you help sir

Re: please explain me these lines of codes

September 11, 2011 - 10:22am #2

Those are effectively state flags. They're used in initializing the app context and checking the state of the various components (e.g. tracker, camera). Take a look at updateApplicationStatus(int appStatus) in the same file to see how they're employed. You don't need to modify them.

Java's final is a bit like C++'s const, though not as strict. By using the final keyword, and ALL CAPS, they're indicating that these variables should be treated as constants.

Log in or register to post comments