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.preference.DialogPreference; | |
import android.util.AttributeSet; | |
import android.view.View; | |
import android.widget.TimePicker; | |
public class TimePreference extends DialogPreference { | |
private int lastHour=0; | |
private int lastMinute=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
<supports-screens | |
android:largeScreens="true" | |
android:normalScreens="true" | |
android:smallScreens="true" | |
android:resizeable="true" | |
android:anyDensity="true" /> | |
<uses-permission android:name="android.permission.VIBRATE" /> | |
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> | |
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> | |
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" /> |
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 ContactsActivity extends Activity { | |
List<Contact> contacts; | |
ContactsAdapter contactsAdapter; | |
ListView contactsList; | |
/** Called when the activity is first created. */ | |
@Override | |
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); |
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
// just add these few lines of code to your app delegate .m file right before the @implementation part | |
@implementation NSURLRequest (DSInvalidSSL) | |
+ (BOOL)allowsAnyHTTPSCertificateForHost:(NSString *)host { | |
return YES; | |
} | |
@end |
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
/** | |
* Show the activity over the lockscreen and wake up the device. If you launched the app manually | |
* both of these conditions are already true. If you deployed from the IDE, however, this will | |
* save you from hundreds of power button presses and pattern swiping per day! | |
*/ | |
public static void riseAndShine(Activity activity) { | |
activity.getWindow().addFlags(FLAG_SHOW_WHEN_LOCKED); | |
PowerManager power = (PowerManager) activity.getSystemService(POWER_SERVICE); | |
PowerManager.WakeLock lock = |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
/* | |
* MCrypt API available online: | |
* http://linux.die.net/man/3/mcrypt | |
*/ | |
#include <mcrypt.h> |
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
//demo |
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
100% — FF | |
95% — F2 | |
90% — E6 | |
85% — D9 | |
80% — CC | |
75% — BF | |
70% — B3 | |
65% — A6 | |
60% — 99 | |
55% — 8C |
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 ArrayList<string> prepareListFromXml() { | |
ArrayList<string> todoItems = new ArrayList<string>(); | |
XmlResourceParser todolistXml = getResources().getXml(R.xml.todolist); | |
int eventType = -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
<?xml version="1.0" encoding="utf-8"?> | |
<selector xmlns:android="http://schemas.android.com/apk/res/android" > | |
<item> | |
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval"> | |
<stroke android:width="1dp" android:color="#FFFFFF" /> | |
<gradient | |
android:startColor="#679031" | |
android:centerColor="#679031" |
OlderNewer