ExampleApp/src/com/altinn/apps/fisher/AppContext.java
/**
	 * This method start refresh token timer task,
	 * this will invoked in every 7+ minutes
	 * if conditions are in favor it will try to refresh a token.
	 * Usually in server configuration, token will expire in 30 mins.
	 * If web service called after half of the time (>15 mins) then new token will be issued.
	 * 
	 * Here we are checking 'isRefreshNeeded() = >15 mins' this condition is in favor to refresh the token.
	 * During this task we are just trying to access a web service(dummy), so that we get a refreshed token, and  user remains logged in
	 *  
	 */
This method start refresh token timer task,
this will invoked in every 7+ minutes
if conditions are in favor it will try to refresh a token.
Usually in server configuration, token will expire in 30 mins.
If web service called after half of the time (>15 mins) then new token will be issued.

Here we are checking 'isRefreshNeeded() = >15 mins' this condition is in favor to refresh the token.
During this task we are just trying to access a web service(dummy), so that we get a refreshed token, and  user remains logged in
This method start refresh token timer task this will invoked in every 7 + minutes if conditions are in favor it will try to refresh a token . Usually in server configuration token will expire in 30 mins . If web service called after half of the time ( > 15 mins ) then new token will be issued . Here we are checking ' isRefreshNeeded () = > 15 mins ' this condition is in favor to refresh the token . During this task we are just trying to access a web service ( dummy ) so that we get a refreshed token and user remains logged in
public void scheduleRefreshTimer(){
		if( mRefreshTokenTimer != null){
			mRefreshTokenTimer.cancel();
		}
		mRefreshTokenTimer = new CountDownTimer(Integer.MAX_VALUE, AppConstants.REFRESH_TIMER) {
			public void onTick(long millisUntilFinished) {
				Log.d("scheduleRefreshTimer#onTick(): ", ""+(new Date(System.currentTimeMillis())).toString());
				if(isRefreshNeeded()){		
					startRefreshTask();
				}
			}
			public void onFinish() {
				Log.d("scheduleRefreshTimer#onFinish(): ",""+(new Date(System.currentTimeMillis())).toString());
			}
		};
		mRefreshTokenTimer.start();
	}
public void scheduleRefreshTimer ( ) { if ( mRefreshTokenTimer != null ) { mRefreshTokenTimer . cancel ( ) ; } mRefreshTokenTimer = new CountDownTimer ( Integer . MAX_VALUE , AppConstants . REFRESH_TIMER ) { public void onTick ( long millisUntilFinished ) { Log . d ( "scheduleRefreshTimer#onTick(): " , "" + ( new Date ( System . currentTimeMillis ( ) ) ) . toString ( ) ) ; if ( isRefreshNeeded ( ) ) { startRefreshTask ( ) ; } } public void onFinish ( ) { Log . d ( "scheduleRefreshTimer#onFinish(): " , "" + ( new Date ( System . currentTimeMillis ( ) ) ) . toString ( ) ) ; } } ; mRefreshTokenTimer . start ( ) ; }
This method start refresh token timer task,
 this will invoked in every 7+ minutes
 if conditions are in favor it will try to refresh a token.
This method start refresh token timer task this will invoked in every 7 + minutes if conditions are in favor it will try to refresh a token .