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
/** | |
* Get Image Uri from Image Bitmap | |
* @param inContext | |
* @param inImage | |
* @return Uri | |
*/ | |
public Uri getImageUri(Context inContext, Bitmap inImage) { | |
ByteArrayOutputStream bytes = new ByteArrayOutputStream(); | |
inImage.compress(Bitmap.CompressFormat.JPEG, 100, bytes); | |
String path = MediaStore.Images.Media.insertImage(inContext.getContentResolver(), inImage, "NewsImage", 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
import android.graphics.Bitmap; | |
import android.graphics.drawable.BitmapDrawable; | |
import android.graphics.drawable.Drawable; | |
import java.io.ByteArrayOutputStream; | |
/** | |
* Sketch Project Studio | |
* Created by Angga on 12/04/2016 14.27. | |
*/ | |
public class AppHelper { |
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
//Calling decodePoly | |
String polyline = (String)((JSONObject)((JSONObject)jSteps.get(k)).get("polyline")).get("points"); | |
List<LatLng> list = decodePoly(polyline); | |
/* | |
where "polyline" & "points" are JSON key return from GoogleMap URl. | |
*/ | |
// deocdePoly implementation | |
private List<LatLng> decodePoly(String encoded) { |
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
//This method will return true if internet available else return false. | |
public static boolean checkInternetConnection(Context mContext) { | |
ConnectivityManager connection = (ConnectivityManager) mContext.getSystemService(CONNECTIVITY_SERVICE); | |
if (connection != null) { | |
if (connection.getNetworkInfo(0).getState() == NetworkInfo.State.CONNECTED || | |
connection.getNetworkInfo(0).getState() == NetworkInfo.State.CONNECTING || | |
connection.getNetworkInfo(1).getState() == NetworkInfo.State.CONNECTED || | |
connection.getNetworkInfo(1).getState() == NetworkInfo.State.CONNECTING) { | |
return true; | |
} else if (connection.getNetworkInfo(0).getState() == NetworkInfo.State.DISCONNECTED || |
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
<?php | |
//Function calling | |
$dateRange=getDatesFromRange("2018-07-20", "2018-08-05", $format = 'Y-m-d') | |
//Function body | |
private function getDatesFromRange($start, $end, $format = 'Y-m-d') | |
{ | |
$array = array(); | |
$interval = new DateInterval('P1D'); |
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
apply plugin: 'com.android.application' | |
ext.majorVersion = 1 | |
ext.minorVersion = 0 | |
ext.patchVersion = 1 | |
ext.preRelease = "Alpha" | |
ext.minSdkVersion = 16 | |
android { |