Android Open Source - gpsplayer Utils






From Project

Back to project page gpsplayer.

License

The source code is released under:

GNU General Public License

If you think the Android project gpsplayer 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 heigvd.iict.gpsplayer;
//from   w w w . java2  s.co m
import android.content.Context;
import android.os.Environment;
import android.util.Log;
import android.widget.Toast;

import java.io.File;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Locale;

public class Utils {
    private final static String TAG = "Utils";

    public final static SimpleDateFormat dateFormatISO8601 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", Locale.US);

    public static File getStorageDirectory() {
        final File d = Environment.getExternalStoragePublicDirectory("gpsplayer");
        d.mkdirs();
        return d;
    }

    public static void showMessage(Context ctx, String message) {
        Toast.makeText(ctx, message, Toast.LENGTH_LONG).show();
    }

    public static boolean fileEquals(File f1, File f2) {
        if (f1 == f2) {
            return true;
        }
        if (f1 == null || f2 == null) {
            return false;
        }
        try {
            return f1.getCanonicalPath().equals(f2.getCanonicalPath());
        } catch (IOException e) {
            Log.e(TAG, "fileEquals", e);
            return false;
        }

    }
}




Java Source Code List

heigvd.iict.gpsplayer.ApplicationTest.java
heigvd.iict.gpsplayer.Globals.java
heigvd.iict.gpsplayer.Utils.java
heigvd.iict.gpsplayer.background.RunTrackService.java
heigvd.iict.gpsplayer.data.TrackPoint.java
heigvd.iict.gpsplayer.data.Track.java
heigvd.iict.gpsplayer.events.LocationSentEvent.java
heigvd.iict.gpsplayer.events.ServiceStateChangedEvent.java
heigvd.iict.gpsplayer.io.GpxLoader.java
heigvd.iict.gpsplayer.ui.FilesListActivity.java
heigvd.iict.gpsplayer.ui.ImportTrackActivity.java
heigvd.iict.gpsplayer.ui.StartStopFragment.java
heigvd.iict.gpsplayer.ui.TrackViewActivity.java
heigvd.iict.gpsplayer.ui.fragments.DeleteTrackDialogFragment.java
heigvd.iict.gpsplayer.ui.fragments.FilenameDialogFragment.java