Skip to content

Instantly share code, notes, and snippets.

View dp-singh's full-sized avatar
🎯
Focusing

Dharmendra Pratap Singh dp-singh

🎯
Focusing
View GitHub Profile

System directories

Method Result
Environment.getDataDirectory() /data
Environment.getDownloadCacheDirectory() /cache
Environment.getRootDirectory() /system

External storage directories

public static class ScaleToFitWidhtHeigthTransform implements Transformation {
private int mSize;
private boolean isHeightScale;
public ScaleToFitWidhtHeigthTransform(int size, boolean isHeightScale){
mSize =size;
this.isHeightScale = isHeightScale;
}
#!/bin/bash -e
# Ensure we're running in location of script.
cd "`dirname $0`"
for f in *; do
if [[ $f == *.png ]];
then
echo "...$f"
convert $f -resize 37.5% ../res/drawable-ldpi/$f
AlertDialog.Builder builder = new AlertDialog.Builder(Activity.this);
builder.setTitle("Delete")
.setIcon(android.R.drawable.ic_dialog_alert)
.setMessage("Do you want to delete?")
.setCancelable(false)
.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
DAO dao = new DAO(Activity.this);
dao.deleteValues(valueSelected);
dao.close();
SelectionQueryBuilder q = new SelectionQueryBuilder()
.expr("is_awesome", EQ, true)
.expr("money", GT, 50.0f)
.expr("speed", LT, 21.1f)
.or()
.expr("door_number", EQ, 123)
.or().expr(
new SelectionQueryBuilder()
.expr("a", GT, 0)
.expr("a", LT, 100)
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.telephony.TelephonyManager;
/**
* Check device's network connectivity and speed
* @author email dharmendrascpm@gmail.com
*
*/