This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.Context | |
import android.content.res.Resources | |
import android.util.DisplayMetrics | |
/** | |
* Provides utilities for metrics. | |
* | |
* Original at: | |
* @see <a href="https://stackoverflow.com/a/9563438/8877070">stack overflow answer</a> | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DirectionsJSONParser { | |
/** Receives a JSONObject and returns a list of lists containing latitude and longitude */ | |
public List<List<HashMap<String,String>>> parse(JSONObject jObject){ | |
List<List<HashMap<String, String>>> routes = new ArrayList<List<HashMap<String,String>>>() ; | |
JSONArray jRoutes = null; | |
JSONArray jLegs = null; | |
JSONArray jSteps = null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.sevenlearn.broadcastreceivertutorial; | |
import android.content.Context; | |
import android.net.ConnectivityManager; | |
import android.net.Network; | |
import android.net.NetworkCapabilities; | |
import android.net.NetworkInfo; | |
import android.os.Build; | |
public class NetworkUtil { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.sevenlearn.filemanager; | |
import android.os.Environment; | |
public class StorageHelper { | |
public static boolean isExternalStorageWritable() { | |
String state = Environment.getExternalStorageState(); | |
if (Environment.MEDIA_MOUNTED.equals(state)) { | |
return true; | |
} |