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 final class SessionIdentifierGenerator { | |
private SecureRandom random = new SecureRandom(); | |
public String nextSessionId() { | |
return new BigInteger(130, random).toString(32); | |
} | |
} |
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 TaskHelper { | |
public static <P, T extends AsyncTask<P, ?, ?>> void execute(T task) { | |
execute(task, (P[]) null); | |
} | |
public static <P, T extends AsyncTask<P, ?, ?>> void execute(T task, P... params) { | |
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { | |
task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, params); | |
} else { |
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 static void printHashKey(Context context) { | |
try { | |
String TAG = "com.ephron.socialnetgate"; | |
PackageInfo info = context.getPackageManager().getPackageInfo(TAG, PackageManager.GET_SIGNATURES); | |
for (Signature signature : info.signatures) { | |
MessageDigest md = MessageDigest.getInstance("SHA"); | |
md.update(signature.toByteArray()); | |
String keyHash = Base64.encodeToString(md.digest(), Base64.DEFAULT); | |
Log.i(TAG, "keyHash: " + keyHash); | |
} |
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 static Bitmap takeScreenshot(Activity activity) { | |
ViewGroup decor = (ViewGroup) activity.getWindow().getDecorView(); | |
ViewGroup decorChild = (ViewGroup) decor.getChildAt(0); | |
decorChild.setDrawingCacheEnabled(true); | |
decorChild.buildDrawingCache(); | |
Bitmap drawingCache = decorChild.getDrawingCache(true); | |
Bitmap bitmap = Bitmap.createBitmap(drawingCache); | |
decorChild.setDrawingCacheEnabled(false); | |
return bitmap; | |
} |
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 org.json.JSONArray; | |
import org.json.JSONException; | |
import org.json.JSONObject; | |
import com.google.gson.Gson; | |
public List<ModelClass> getArraylistModelClass(String result) { | |
ArrayList<ModelClass> items = new ArrayList<ModelClass>(); | |
// TODO Auto-generated method stub |
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 AppDataPref { | |
public static final String TEMP_PHOTO_FILE_NAME = "fbprofileimg.jpg"; | |
private String DIRECTORY_NAME = "SocialNetGate"; | |
public static boolean CALL_USER_DETAILS = false; | |
public static boolean CALL_INFLUENCE_CALC = true; | |
private Context context; | |
private SharedPreferences prefs; | |
public SharedPreferences prefs1; | |
public AppDataPref(Context context) { |
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 void onReceive(final Context arg0, Intent arg1) | |
{ | |
PreferenceManager.getDefaultSharedPreference(arg0).edit().putInt(yourInt).apply(); | |
} |
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
list.add(new Bank("Choose your bank","",0)); | |
list.add(new Bank("HDFC bank","HDFC",R.drawable.ic_hdfc)); | |
list.add(new Bank("Citibank","CITI",R.drawable.ic_citi)); | |
list.add(new Bank("Icici bank","ICIC",R.drawable.ic_icici)); | |
list.add(new Bank("Axis bank","UTIB",R.drawable.ic_axis)); | |
// list.add(new Bank("Axis bank-Lime","UTIB",R.drawable.lime)); | |
list.add(new Bank("Federal bank","FDRL",R.drawable.ic_federal)); | |
list.add(new Bank("SBI","SBI",R.drawable.ic_sbi)); | |
list.add(new Bank("Union Bank of India","UBI",R.drawable.ic_union)); | |
list.add(new Bank("Kotak bank","KKBK",R.drawable.ic_kotak)); |
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
<?xml version="1.0" encoding="utf-8"?> | |
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> | |
<item | |
android:drawable="@color/gray"/> | |
<item> | |
<bitmap | |
android:gravity="center" | |
android:src="@mipmap/ic_launcher"/> |
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
<resources> | |
<!-- Base application theme. --> | |
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> | |
<!-- Customize your theme here. --> | |
</style> | |
<style name="SplashTheme" parent="Theme.AppCompat.NoActionBar"> | |
<item name="android:windowBackground">@drawable/background_splash</item> | |
</style> |
OlderNewer