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
* Downloaded or downloading
=============================
**http://kickass.to/infiniteskills-learning-jquery-mobile-working-files-t7967156.html
**http://kickass.to/lynda-bootstrap-3-advanced-web-development-2013-eng-t8167587.html
**http://kickass.to/lynda-css-advanced-typographic-techniques-t7928210.html
**http://kickass.to/lynda-html5-projects-interactive-charts-2013-eng-t8167670.html
**http://kickass.to/vtc-html5-css3-responsive-web-design-course-t7922533.html
*http://kickass.to/10gen-m101js-mongodb-for-node-js-developers-2013-eng-t8165205.html
*http://kickass.to/cbt-nuggets-amazon-web-services-aws-foundations-t7839734.html
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
*
*/
@dp-singh
dp-singh / Gzip compression
Created September 10, 2014 14:48
Volley gzip compression
import com.android.volley.NetworkResponse;
import com.android.volley.ParseError;
import com.android.volley.Response;
import com.android.volley.toolbox.HttpHeaderParser;
import com.android.volley.toolbox.StringRequest;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
@dp-singh
dp-singh / gist:cfc83203fa674c1b5040
Last active August 29, 2015 14:06
Some gud set of lib for android
http://www.blogc.at/category/development/page/2/
http://android.hew.io/
@dp-singh
dp-singh / Facebook Helper
Created September 30, 2014 15:23
Facebook helper use to manage facebook UI
import android.app.Activity;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.text.TextUtils;
import com.facebook.FacebookException;
import com.facebook.FacebookOperationCanceledException;
import com.facebook.FacebookServiceException;
import com.facebook.HttpMethod;
@dp-singh
dp-singh / writeToSystem
Created October 13, 2014 09:56
Snippet to store string data in andrdoi
public Boolean write(String fname, String fcontent) {
try {
String fpath = "/sdcard/" + fname + ".txt";
File file = new File(fpath);
// If file does not exists, then create it
if (!file.exists()) {
file.createNewFile();
}
FileWriter fw = new FileWriter(file.getAbsoluteFile());
BufferedWriter bw = new BufferedWriter(fw);
@dp-singh
dp-singh / Location
Created November 21, 2014 05:11
Location based Class android
/*
* This file is part of the AusStage Utilities Package
*
* The AusStage Utilities Package is free software: you can redistribute
* it and/or modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* The AusStage Utilities Package is distributed in the hope that it will
* be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
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)
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();
#!/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