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.text.SimpleDateFormat; | |
import java.util.Calendar; | |
import java.util.TimeZone; | |
import java.text.ParsePosition; | |
import java.text.DateFormat; | |
import java.util.Date; | |
public class DateTimeTest | |
{ |
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 String getContactName(String phoneNumber) | |
{ | |
String name = null; | |
ContentResolver cr = getContentResolver(); | |
Cursor cur = cr.query(Uri.withAppendedPath(PhoneLookup.CONTENT_FILTER_URI, | |
Uri.encode(phoneNumber)), new String[]{ PhoneLookup.DISPLAY_NAME }, null, null, null); | |
if(cur != null){ | |
try{ | |
if(cur.getCount() > 0){ | |
if(cur.moveToFirst()){ |
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
/* | |
new CountDownUpdate((TextView)findViewById(R.id.accept_text), 90, | |
new CountDownUpdate.Callback(){ | |
@Override | |
public void onCountDownComplete(TextView textView) | |
{ | |
Toast.makeText(getApplicationContext(), "BOOM!", Toast.LENGTH_LONG).show(); | |
} | |
}); | |
*/ |
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.app.Activity; | |
import android.content.Intent; | |
import android.os.Bundle; | |
import android.view.View; | |
import android.widget.TextView; | |
public class ActivityA extends Activity | |
{ | |
private static final int REQUEST_CODE_INFO = 1000; |
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.example.sharesubmenu; | |
import java.util.List; | |
import android.support.v4.app.FragmentActivity; | |
import android.content.ComponentName; | |
import android.content.Intent; | |
import android.content.pm.PackageManager; | |
import android.content.pm.ResolveInfo; | |
import android.os.Bundle; |
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 bbc.mobile.news.mps; | |
import android.app.Dialog; | |
import android.app.ProgressDialog; | |
import android.os.AsyncTask; | |
import android.os.Bundle; | |
import android.support.v4.app.DialogFragment; | |
import android.support.v4.app.Fragment; | |
import android.support.v4.app.FragmentActivity; | |
import android.support.v4.app.FragmentManager; |
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 String readTextFromUri(Uri uri) throws IOException | |
{ | |
InputStream in = null; | |
try{ | |
in = getContentResolver().openInputStream(uri); | |
StringBuilder sb = new StringBuilder(in.available()); | |
BufferedReader reader = new BufferedReader(new InputStreamReader(in)); | |
char[] buffer = new char[1024]; | |
int len; | |
while((len = reader.read(buffer)) != -1){ |
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 int getThemeAttributeDimensionSize(Context context, int attr) | |
{ | |
TypedArray a = null; | |
try{ | |
a = context.getTheme().obtainStyledAttributes(new int[] { attr }); | |
return a.getDimensionPixelSize(0, 0); | |
}finally{ | |
if(a != null){ | |
a.recycle(); | |
} |
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
<?php | |
/* | |
Android Reverse ID Lookup Util | |
------------------------------ | |
Use ApkTool to extract resources: apktool d -s filename.apk | |
then go into res\values or copy public.xml and run with this script. | |
Copyright 2014 Simon Lightfoot <simon@demondevelopers.com> | |
Licensed under the Apache License, Version 2.0 (the "License"); |
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.demondevelopers.githubclient; | |
import java.util.List; | |
import android.graphics.Bitmap; | |
import android.graphics.drawable.BitmapDrawable; | |
import android.graphics.drawable.Drawable; | |
import android.os.Bundle; | |
import android.support.v4.app.ListFragment; | |
import android.support.v4.app.LoaderManager.LoaderCallbacks; |
OlderNewer