The application, titled Quotr is a straightforward quote display application.
The app uses a large vertically and horizontally centered TextView. The content is retrieved using XML in Java. The application consumes a webservice and displays the result.Additionally, I put no menus or buttons in the application. To refresh the quotes I put an onClickListener for the TextView and a listener for shakes.
TextView tv;
tv = (TextView) findViewById(R.id.quote);
tv.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
retrieveQuote();
}
});
and a listener for shake events...
private final SensorEventListener mSensorListener = new SensorEventListener() {
public void onAccuracyChanged(Sensor arg0, int arg1) {
retrieveQuote();
}
};


0 comments:
Post a Comment