Basic Timer For Android

Here is a basic timer for Android in Eclipse/ Java.  I’ve simply modified the example shown in the link here by declaring the delay/period as global variables (measured in milliseconds) / implementing my own ‘tasks’ in the void run

	public void onClick(final View view) {

		timer.scheduleAtFixedRate(new TimerTask() {
		        public void run() {
		    		results = wifi.getScanResults();
		    		textStatus.setText("number of networks: " + results.size());
			    		if (view.getId() == {
			    			Log.d(TAG, "onClick() wifi.startScan()");
		    }, delay, period);

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s