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.BufferedInputStream; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
import java.lang.reflect.Type; | |
import java.net.MalformedURLException; | |
import java.net.URL; | |
import java.text.ParseException; | |
import java.text.SimpleDateFormat; | |
import java.util.ArrayList; | |
import java.util.Locale; |
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.database.DataSetObserver; | |
import android.util.AttributeSet; | |
import android.util.SparseArray; | |
import android.util.SparseIntArray; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import android.view.ViewTreeObserver; | |
import android.widget.ListAdapter; | |
import android.widget.ListView; |
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 registerListenForSignalStrengths(Context context) | |
{ | |
TelephonyManager tm = (TelephonyManager)context.getSystemService(TELEPHONY_SERVICE); | |
tm.listen(mPhoneStateListener, PhoneStateListener.LISTEN_SIGNAL_STRENGTHS); | |
} | |
public void unregisterListenForSignalStrengths(Context context) | |
{ | |
TelephonyManager tm = (TelephonyManager)context.getSystemService(TELEPHONY_SERVICE); | |
tm.listen(mPhoneStateListener, PhoneStateListener.LISTEN_NONE); |
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.IOException; | |
/** | |
* Comment Stripper | |
* | |
* Usage: cat inputfile.blah | java CommentStripper > outptufile.blah | |
* | |
* | |
*/ | |
public class CommentStripper |
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
// Usage: | |
// AudioTrack tone = generateTone(440, 250); | |
// tone.play(); | |
// | |
private AudioTrack generateTone(double freqHz, int durationMs) | |
{ | |
int count = (int)(44100.0 * 2.0 * (durationMs / 1000.0)) & ~1; | |
short[] samples = new short[count]; | |
for(int i = 0; i < count; i += 2){ | |
short sample = (short)(Math.sin(2 * Math.PI * i / (44100.0 / freqHz)) * 0x7FFF); |
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.example.markers; | |
import java.util.HashSet; | |
import java.util.Iterator; | |
import com.google.android.gms.maps.GoogleMap; | |
import com.google.android.gms.maps.SupportMapFragment; | |
import com.google.android.gms.maps.model.LatLng; | |
import com.google.android.gms.maps.model.Marker; | |
import com.google.android.gms.maps.model.MarkerOptions; |
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.fadeytextthingy; | |
import android.app.Activity; | |
import android.content.Context; | |
import android.graphics.Canvas; | |
import android.graphics.Color; | |
import android.graphics.Typeface; | |
import android.graphics.drawable.ColorDrawable; | |
import android.os.Bundle; | |
import android.support.v4.view.ViewCompat; |
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.content.res.TypedArray; | |
import android.util.AttributeSet; | |
public class DoubleRangeSeekBar extends RangeSeekBar<Double> | |
{ | |
public DoubleRangeSeekBar(Context context) | |
{ | |
super(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
<permission | |
android:label="@string/permission_remote_access_label" | |
android:name="com.google.android.apps.now.REMOTE_ACCESS" | |
android:protectionLevel="normal" | |
android:description="@string/permission_remote_access_desc" | |
/> | |
<service android:name="com.google.android.sidekick.main.remoteservice.GoogleNowRemoteService" | |
android:permission="com.google.android.apps.now.REMOTE_ACCESS" android:process=":search"> | |
<intent-filter> |
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 | |
{ |