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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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 java8 = getJavaVersion(8) | |
String java7 = getJavaVersion(7) | |
retrolambda { | |
jdk java8 | |
oldJdk java7 | |
javaVersion JavaVersion.VERSION_1_7 | |
// jvmArgs '-arg1', '-arg2' < if I don't comment this line gradle fails | |
defaultMethods false | |
incremental true |
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"?> | |
<fragment xmlns:android="http://schemas.android.com/apk/res/android" | |
android:id="@+id/map" | |
android:name="com.google.android.gms.maps.SupportMapFragment" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" /> |
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 BatteryActivity extends Activity { | |
//UI Elements | |
private TextView mTextViewLevel; | |
private TextView mTextViewTemperature; | |
private TextView mTextViewVoltage; | |
private TextView mTextViewHealth; | |
//Battery details | |
private int level; |
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
//Sticky Service | |
public class StickyService extends Service | |
{ | |
private static final String TAG = "StickyService"; | |
@Override | |
public IBinder onBind(Intent arg0) { | |
// TODO Auto-generated method stub | |
return null; |
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
try{ | |
shareIntent.setAction(Intent.ACTION_SEND); | |
//Target whatsapp: | |
shareIntent.setPackage("com.whatsapp"); | |
//Add text and then Image URI | |
shareIntent.putExtra(Intent.EXTRA_TEXT, picture_text); | |
shareIntent.putExtra(Intent.EXTRA_STREAM, imageUri); | |
shareIntent.setType("image/jpeg"); | |
shareIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); | |
startActivity(shareIntent); |
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
/** | |
* A collection of authentication and account connection utilities. With strong inspiration from the Google IO session | |
* app. | |
* @author Dandré Allison | |
*/ | |
public class AccountUtils { | |
/** | |
* Interface for interacting with the result of {@link AccountUtils#getUserProfile}. | |
*/ |
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 AnimatedActivity extends Activity | |
{ | |
@Override | |
protected void onCreate(Bundle savedInstanceState) | |
{ | |
super.onCreate(savedInstanceState); | |
//opening transition animations | |
overridePendingTransition(R.anim.activity_open_translate,R.anim.activity_close_scale); | |
} |
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
// Slide up animation | |
<?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" > | |
<translate | |
android:duration="@android:integer/config_mediumAnimTime" | |
android:fromYDelta="100%" | |
android:interpolator="@android:anim/accelerate_interpolator" | |
android:toXDelta="0" /> |