Back to project page checkin.
The source code is released under:
# License Copyright ? 2014 Sam Whited Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ?Software??), to deal ...
If you think the Android project checkin listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.samwhited.checkin.util; // ww w . j a va2s .com import android.content.Context; import android.location.Location; import android.text.format.DateUtils; /** * Utility class for formatting things (dates, coordinates, etc.) */ public class Formatting { // TODO: Possibly make this a preference? public final static int dateFormatFlags = DateUtils.FORMAT_ABBREV_MONTH | DateUtils.FORMAT_SHOW_YEAR | DateUtils.FORMAT_SHOW_DATE | DateUtils.FORMAT_SHOW_TIME; public static String formatDateTime(final Context context, final long time) { return DateUtils.formatDateTime(context, time, dateFormatFlags); } // TODO: Make this a preference? public static String formatCoordinates(final Context context, final Location location) { final String strLat = Location.convert(location.getLatitude(), Location.FORMAT_SECONDS); final String strLong = Location.convert(location.getLongitude(), Location.FORMAT_SECONDS); return strLat + ", " + strLong; } }