Android Open Source - RazorRunner-AndroidProject Activity Utils






From Project

Back to project page RazorRunner-AndroidProject.

License

The source code is released under:

Apache License

If you think the Android project RazorRunner-AndroidProject 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 edu.uark.csce.razorrunner;
/*from   w  w  w  .  jav  a2  s  . co m*/
import android.app.Service;
import android.text.format.Time;

/**
 * Created by Kai Tribble on 11/28/2014.
 */
public class ActivityUtils {
    // Used to track what type of request is in process
    public enum REQUEST_TYPE {ADD, REMOVE}

    public static final String APPTAG = "edu.uark.csce.RazorRunner";

    public static final String GENDER = "prefUserGender";
    public static final String AGE = "prefUserAge";
    public static final String WEIGHT = "prefUserWeight";

    /*
     * Define a request code to send to Google Play services
     * This code is returned in Activity.onActivityResult
     */
    public final static int CONNECTION_FAILURE_RESOLUTION_REQUEST = 9000;

    // Intent actions and extras for sending information from the IntentService to the Activity
    // Constants used to establish the activity update interval
    public static final int MILLISECONDS_PER_SECOND = 1000;

    public static final int DETECTION_INTERVAL_SECONDS = 20;

    public static final int DETECTION_INTERVAL_MILLISECONDS =
            MILLISECONDS_PER_SECOND * DETECTION_INTERVAL_SECONDS;

//    // Shared Preferences repository name
//    public static final String SHARED_PREFERENCES =
//            "com.example.android.activityrecognition.SHARED_PREFERENCES";

    // Key in the repository for the previous activity
    public static final String KEY_PREVIOUS_ACTIVITY_TYPE =
            "com.example.android.activityrecognition.KEY_PREVIOUS_ACTIVITY_TYPE";

    private Service mService;


    private static ActivityUtils instance = null;


    private ActivityUtils() {
    }

    public static ActivityUtils getInstance() {
        if (instance == null) {
            instance = new ActivityUtils();
        }
        return instance;
    }

    public void setService(Service service) {
        mService = service;
    }

    public static long currentTimeInMillis() {
        Time time = new Time();
        time.setToNow();
        return time.toMillis(false);
    }
}




Java Source Code List

edu.uark.csce.razorrunner.ActivityUtils.java
edu.uark.csce.razorrunner.BuildConfig.java
edu.uark.csce.razorrunner.DistanceNotifier.java
edu.uark.csce.razorrunner.HistoryActivity.java
edu.uark.csce.razorrunner.Manifest.java
edu.uark.csce.razorrunner.OverviewActivity.java
edu.uark.csce.razorrunner.PedometerSettings.java
edu.uark.csce.razorrunner.ProfileActivity.java
edu.uark.csce.razorrunner.RemoveDetection.java
edu.uark.csce.razorrunner.RequestDetection.java
edu.uark.csce.razorrunner.StepDetector.java
edu.uark.csce.razorrunner.StepDisplayer.java
edu.uark.csce.razorrunner.StepListener.java
edu.uark.csce.razorrunner.UserActivityRecognition.java
edu.uark.csce.razorrunner.UserSettingsActivity.java
edu.uark.csce.razorrunner.UserStepRecognition.java
edu.uark.csce.razorrunner.WorkoutActivity.java
edu.uark.csce.razorrunner.WorkoutContentProvider.java
edu.uark.csce.razorrunner.WorkoutData.java
edu.uark.csce.razorrunner.WorkoutItemAdapter.java