Class NetworkUtils


  • public class NetworkUtils
    extends Object
    • Constructor Detail

      • NetworkUtils

        public NetworkUtils()
    • Method Detail

      • getJSONZipped

        public static org.json.JSONObject getJSONZipped​(UrlBuilder builder,
                                                        boolean debug)
      • getStringGSONZipped

        public static String getStringGSONZipped​(UrlBuilder builder,
                                                 boolean debug)
      • isOnline

        public static boolean isOnline​(android.content.Context context)
        Checks to see whether or not we have an established connection. If a device, it will check for a wifi connection and network Connection
        Parameters:
        context - Context
        Returns:
        true if connected
      • getString

        public static String getString​(URL url)
      • getJSON

        public static org.json.JSONObject getJSON​(URL url)
      • getJSON

        public static org.json.JSONObject getJSON​(UrlBuilder builder)
      • loadBitmap

        public static android.graphics.Bitmap loadBitmap​(String srcUrl,
                                                         int opacity)
        Loads the bitmap from the given src Url.
        Parameters:
        srcUrl - String
        opacity - int
        Returns:
        Bitmap
      • headingToString

        public static String headingToString​(double x)
        Parameters:
        x - Double Bearing
        Returns:
        String Cardinal Direction
      • getDMSDegrees

        public static int getDMSDegrees​(double pCoord)
        This method returns the degrees portion of the passed on latitude or longitude coordinate.
        Parameters:
        pCoord - double
        Returns:
        int
      • getDMSMinutes

        public static int getDMSMinutes​(double pCoord)
        This method returns the minutes portion of the passed on latitude or longitude coordinate.
        Parameters:
        pCoord - double
        Returns:
        int
      • getDMSSeconds

        public static int getDMSSeconds​(double pCoord)
        This method returns the seconds portion of the passed on latitude or longitude coordinate.
        Parameters:
        pCoord - double
        Returns:
        int
      • launchNetworkAsyncTask

        public static boolean launchNetworkAsyncTask​(android.os.AsyncTask<Void,​Void,​?> task,
                                                     android.content.Context context)