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 (C) 2014 Chris Banes | |
* | |
* 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 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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 se.redsox; | |
import org.jivesoftware.smack.Connection; | |
import org.jivesoftware.smack.ConnectionConfiguration; | |
import org.jivesoftware.smack.XMPPConnection; | |
import org.jivesoftware.smack.XMPPException; | |
import org.jivesoftware.smack.Roster; |
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
<? | |
header('Content-type: application/json'); | |
require_once('twitteroauth/twitteroauth.php'); | |
$oauth_access_token = "YOUR_HERE"; | |
$oauth_access_token_secret = "YOUR_HERE"; | |
$consumer_key = "YOUR_HERE"; | |
$consumer_secret = "YOUR_HERE"; | |
if ($_GET["token"]!=$oauth_access_token) { |
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 Util{ | |
public void printHashKey(Context context) { | |
try { | |
PackageInfo info = context.getPackageManager().getPackageInfo( | |
"com.clickdelivery.android.redwings", | |
PackageManager.GET_SIGNATURES); | |
for (Signature signature : info.signatures) { | |
MessageDigest md = MessageDigest.getInstance("SHA"); |
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.stefanini.android.cartermensajeria.ws; | |
import java.io.IOException; | |
import java.io.UnsupportedEncodingException; | |
import java.net.URI; | |
import java.net.URISyntaxException; | |
import java.util.List; | |
import org.apache.http.HttpEntity; | |
import org.apache.http.HttpResponse; |
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
/** | |
* Creates a 'ghost' bitmap version of the given source drawable (ideally a BitmapDrawable). | |
* In the ghost bitmap, the RGB values take on the values from the 'color' argument, while | |
* the alpha values are derived from the source's grayscaled RGB values. The effect is that | |
* you can see through darker parts of the source bitmap, while lighter parts show up as | |
* the given color. The 'invert' argument inverts the computation of alpha values, and looks | |
* best when the given color is a dark. | |
*/ | |
private Bitmap createGhostIcon(Drawable src, int color, boolean invert) { | |
int width = src.getIntrinsicWidth(); |
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
ContentValues my_values = new ContentValues(); | |
values.put("address", "+9233397365xx");//sender name | |
values.put("body", "this is my text"); | |
getContentResolver().insert(Uri.parse("content://sms/inbox"), my_values); | |
<uses-permission android:name="android.permission.READ_SMS"/> | |
<uses-permission android:name="android.permission.WRITE_SMS"/> |
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 JSONObject makeHttpRequest(String url, String method, | |
List<NameValuePair> params) throws IOException { | |
AndroidHttpClient httpClient = null; | |
JSONObject json = null; | |
try { | |
// Building the request | |
httpClient = AndroidHttpClient.newInstance("android"); | |
HttpConnectionParams.setConnectionTimeout(httpClient.getParams(), |
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
keytool -list -v -keystore <keystore_name> -alias <aliasname> |
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 some.awesome.package; | |
import android.content.Context; | |
import android.content.res.TypedArray; | |
import android.util.AttributeSet; | |
import android.view.View; | |
import android.view.animation.Animation; | |
import android.view.animation.Animation.AnimationListener; | |
import android.view.animation.Transformation; | |
import android.widget.RelativeLayout; |