Android Open Source - YesNoGame Poll Service Base






From Project

Back to project page YesNoGame.

License

The source code is released under:

GNU General Public License

If you think the Android project YesNoGame listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package example.swa.yesnogame.service;
/*ww  w .  j  a  va  2s . com*/
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

import android.util.Log;

/**
 * Base class for service implementations. Provides some extended logging to log
 * execution duration of async methods.
 * 
 * @author Hendrik.Stilke@siemens.com
 * 
 */
public abstract class PollServiceBase {

  private Map<String, Date> startTime = new HashMap<String, Date>();

  protected void LogEnd(String tag, String method) {
    LogEnd(tag, method, "");
  }

  /**
   * Log exit point out of a method.
   * 
   * @param method
   *            method name
   * @param tag
   *            logging tag
   * @param message
   *            log message
   */
  protected void LogEnd(String tag, String method, String message) {
    Date endTime = new Date();
    long duration = endTime.getTime() - this.startTime.get(method).getTime();
    Log.i(tag, "(took " + duration + "ms)" + method + " end  > " + message);
  }

  /**
   * Log entry point into a method.
   * 
   * @param method
   *            method name
   * @param tag
   *            logging tag
   */
  protected void LogStart(String tag, String method) {
    this.startTime.put(method, new Date());
    Log.i(tag, method + " start");
  }
}




Java Source Code List

example.swa.yesnogame.BaseActivity.java
example.swa.yesnogame.InitPollActivity.java
example.swa.yesnogame.MainActivity.java
example.swa.yesnogame.PollResultActivity.java
example.swa.yesnogame.VoteActivity.java
example.swa.yesnogame.domain.Poll.java
example.swa.yesnogame.domain.User.java
example.swa.yesnogame.domain.Vote.java
example.swa.yesnogame.domain.dto.PollSimpleDto.java
example.swa.yesnogame.domain.dto.UserSimpleDto.java
example.swa.yesnogame.domain.dto.VoteSimpleDto.java
example.swa.yesnogame.domain.simple.BaseObject.java
example.swa.yesnogame.domain.simple.PollSimple.java
example.swa.yesnogame.domain.simple.UserSimple.java
example.swa.yesnogame.domain.simple.VoteSimple.java
example.swa.yesnogame.domain.util.PollComparator.java
example.swa.yesnogame.domain.util.VoteComparator.java
example.swa.yesnogame.service.IPollService.java
example.swa.yesnogame.service.PollServiceBase.java
example.swa.yesnogame.service.PollServiceCloud.java
example.swa.yesnogame.service.PollServiceMock.java
example.swa.yesnogame.service.PollServiceProvider.java
example.swa.yesnogame.service.PollService.java
example.swa.yesnogame.service.util.EntityFormatEnum.java
example.swa.yesnogame.service.util.RequestMethodEnum.java
example.swa.yesnogame.service.util.RequestUrlParams.java
example.swa.yesnogame.service.util.RequestUrlTask.java
example.swa.yesnogame.ui.YesNoArrayAdapter.java