(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| /* | |
| * Copyright (C) 2017 The Android Open Source Project | |
| * | |
| * 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 |
| package com.gabesechan.android.reusable.receivers; | |
| import java.util.Date; | |
| import android.content.BroadcastReceiver; | |
| import android.content.Context; | |
| import android.content.Intent; | |
| import android.telephony.TelephonyManager; | |
| public abstract class PhonecallReceiver extends BroadcastReceiver { |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| package se.marteinn.utils; | |
| import android.content.Context; | |
| import android.os.AsyncTask; | |
| import android.view.View; | |
| import android.view.inputmethod.InputMethodManager; | |
| import android.widget.EditText; | |
| /** | |
| * Created by martinsandstrom on 2014-04-21. |
| android.applicationVariants.all { variant -> | |
| println "*********" + variant.description + "**********"; | |
| def variants = variant.baseName.split("-"); | |
| def apkName = "ricebook-"; | |
| apkName += variants[0]; | |
| apkName += "-v" + android.defaultConfig.versionName; | |
| if (!variant.zipAlign) { | |
| apkName += "-unaligned"; | |
| } | |
| if (variant.buildType.name == "release") { |
| <div class="container"> | |
| <div class="row"> | |
| <div class="col-sm-6 col-md-4 col-md-offset-4"> | |
| <h1 class="text-center login-title">Sign in to continue to Bootsnipp</h1> | |
| <div class="account-wall"> | |
| <img class="profile-img" src="https://lh5.googleusercontent.com/-b0-k99FZlyE/AAAAAAAAAAI/AAAAAAAAAAA/eu7opA4byxI/photo.jpg?sz=120" | |
| alt=""> | |
| <form class="form-signin"> | |
| <input type="text" class="form-control" placeholder="Email" required autofocus> | |
| <input type="password" class="form-control" placeholder="Password" required> |
| import android.app.Activity; | |
| import android.content.Context; | |
| import android.view.View; | |
| import android.view.inputmethod.InputMethodManager; | |
| /** | |
| * Utility methods for manipulating the onscreen keyboard | |
| */ | |
| public class KeyboardUtil { |
| import android.support.v4.app.Fragment; | |
| public class FragmentUtils { | |
| /** | |
| * @param fragment | |
| * The Fragment whose parent is to be found | |
| * @param parentClass | |
| * The interface that the parent should implement | |
| * @return The parent of fragment that implements parentClass, |
| Latency Comparison Numbers (~2012) | |
| ---------------------------------- | |
| L1 cache reference 0.5 ns | |
| Branch mispredict 5 ns | |
| L2 cache reference 7 ns 14x L1 cache | |
| Mutex lock/unlock 25 ns | |
| Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
| Compress 1K bytes with Zippy 3,000 ns 3 us | |
| Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
| Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |