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.whateverpackage.util; | |
import java.io.UnsupportedEncodingException; | |
import java.net.URISyntaxException; | |
import java.security.InvalidKeyException; | |
import java.security.NoSuchAlgorithmException; | |
import javax.crypto.Mac; | |
import javax.crypto.spec.SecretKeySpec; |
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
private void launchGoogleMaps(String name, String vicinity) { | |
Intent intent = new Intent(android.content.Intent.ACTION_VIEW, | |
Uri.parse("http://maps.google.com/maps?q="+name+","+vicinity)); | |
intent.setClassName("com.google.android.apps.maps", "com.google.android.maps.MapsActivity"); // this is the magic | |
startActivity(intent); | |
} |
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 java.io.UnsupportedEncodingException; | |
import java.util.Map; | |
import org.simpleframework.xml.Serializer; | |
import org.simpleframework.xml.core.Persister; | |
import com.android.volley.AuthFailureError; | |
import com.android.volley.NetworkResponse; | |
import com.android.volley.ParseError; | |
import com.android.volley.Request; |
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
^(?!.*(dalvik)).*$ |
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
#!/usr/bin/python | |
from xml.dom.minidom import parse | |
dom1 = parse("AndroidManifest.xml") | |
oldVersion = dom1.documentElement.getAttribute("android:versionName") | |
oldVersionCode = dom1.documentElement.getAttribute("android:versionCode") | |
versionNumbers = oldVersion.split('.') | |
versionNumbers[-1] = unicode(int(versionNumbers[-1]) + 1) | |
dom1.documentElement.setAttribute("android:versionName", u'.'.join(versionNumbers)) |
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
/** | |
* Copyright 2013 Ognyan Bankov | |
* modified by Michal Ursiny for purposes of Fuerte Eshop adding headers and body support | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* |
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
String url = "http://www.example.com"; | |
Intent i = new Intent(Intent.ACTION_VIEW); | |
i.setData(Uri.parse(url)); | |
startActivity(i); |
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 String computeMD5Hash(String password) | |
{ | |
try { | |
// Create MD5 Hash | |
MessageDigest digest = java.security.MessageDigest.getInstance("MD5"); | |
digest.update(password.getBytes()); | |
byte messageDigest[] = digest.digest(); | |
StringBuffer MD5Hash = new StringBuffer(); | |
for (int i = 0; i < messageDigest.length; i++) |
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.graphics.Bitmap; | |
import android.graphics.drawable.*; | |
import android.util.AttributeSet; | |
import com.android.volley.toolbox.NetworkImageView; | |
public class FadeInNetworkImageView extends NetworkImageView { | |
private static final int FADE_IN_TIME_MS = 250; |
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
/** | |
* starts google maps w/ lat lon | |
*/ | |
public static void showOnMap(Context c, double lat, double lng, String name) { | |
String geoUri = "geo:"+lat+","+lng+"?q="+lat+","+lng+"("+name+")"; | |
Uri geo = Uri.parse(geoUri); | |
Intent intent = new Intent(Intent.ACTION_VIEW); | |
intent.setData(geo); | |
intent.setClassName("com.google.android.apps.maps","com.google.android.maps.MapsActivity"); | |
if (intent.resolveActivity(c.getPackageManager()) != null) { |
OlderNewer