Code example for ActivityRecognitionClient

Methods: connect

0
	 * Note the scan will not start immediately, because it needs to establish a 
	 * connection with Google's servers - you'll be notified of this at 
	 * onConnected 
	 */ 
	public void startActivityRecognitionScan() { 
		mActivityRecognitionClient = new ActivityRecognitionClient(context,
				this, this);
		mActivityRecognitionClient.connect();
		Log.d(TAG, "startActivityRecognitionScan");
		 
	} 
 
	public void stopActivityRecognitionScan() { 
		try { 
			mActivityRecognitionClient.removeActivityUpdates(callbackIntent);
			Log.d(TAG, "stopActivityRecognitionScan");
			 
		} catch (IllegalStateException e) {
			// probably the scan was not set up, we'll ignore 
		} 
	}