(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.
#!/usr/bin/env bash | |
# I've found that the "Migrate to AndroidX" converter in Android Studio doesn't work very | |
# well, so I wrote my own script to do the simple job of converting package names. | |
# | |
# You can download a CSV of package names here: https://developer.android.com/topic/libraries/support-library/downloads/androidx-class-mapping.csv | |
# | |
# It'll run faster on a clean build because then there are fewer files to scan over. | |
# | |
# Uses `gsed` because I'm on a Mac. Can easily replace with `sed` if you don't have `gsed`. |
package com.your.package | |
import android.app.Dialog | |
import android.os.Bundle | |
import com.your.package.R | |
import com.google.android.material.bottomsheet.BottomSheetDialog | |
import com.google.android.material.bottomsheet.BottomSheetDialogFragment | |
/** | |
* BottomSheetDialog fragment that uses a custom |
adb help // List all comands | |
== Adb Server | |
adb kill-server | |
adb start-server | |
== Adb Reboot | |
adb reboot | |
adb reboot recovery | |
adb reboot-bootloader |
package com.benli.app.utils.net; | |
import com.android.volley.AuthFailureError; | |
import com.android.volley.Request; | |
import com.android.volley.toolbox.HttpStack; | |
import org.apache.http.HttpEntity; | |
import org.apache.http.HttpResponse; | |
import org.apache.http.ProtocolVersion; | |
import org.apache.http.StatusLine; |
import android.app.Activity; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.content.pm.ResolveInfo; | |
import android.content.res.AssetFileDescriptor; | |
import android.database.Cursor; | |
import android.graphics.Bitmap; | |
import android.graphics.BitmapFactory; | |
import android.graphics.Matrix; | |
import android.media.ExifInterface; |
package com.vaughandroid.test.espresso.idlingresources; | |
import android.app.Activity; | |
import android.os.Handler; | |
import android.support.annotation.IdRes; | |
import android.support.annotation.NonNull; | |
import android.support.test.espresso.*; | |
import android.view.View; | |
import java.lang.ref.WeakReference; |
var min = 7427658739644928; // min int value that is 10 bytes long in base58 | |
var max = 9007199254740992; // max safe integer (exclusive), also 10 bytes | |
var alphabet = '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ'; // base58 | |
var base = alphabet.length; | |
function encode(num) { | |
var mod, str = ''; | |
while (num >= base) { | |
mod = num % base; |
// "/en/sports_api/" + r + "/bets" | |
// "/en/sports_api/live/events?markets=none"; | |
// "/en/sports_api/live/event/" + t, | |
// "/en/sports_api/pre_match/competition/" + t + "/events" | |
// "/en/sports_api/pre_match/event/" + t, | |
// "/en/sports_api/pre_match/" + e.node + "/" + e.nodeid + "/events" : | |
// "/en/sports_api/pre_match/events" |
(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 2014 Mostafa Gazar | |
* | |
* 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 |