Original solution sacrifices new api lint check.
Here my solution:
int minSdk = hasProperty('minSdk') ? minSdk.toInteger() : 16
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
// retries up to 3 times while exponentially backing off with each retry | |
.retryWhen(errors -> | |
errors | |
.zipWith( | |
Observable.range(1, MAX_RETRIES), (n, i) -> i | |
) | |
.flatMap( | |
retryCount -> Observable.timer((long) Math.pow(4, retryCount), TimeUnit.SECONDS) | |
) | |
) |
Original solution sacrifices new api lint check.
Here my solution:
int minSdk = hasProperty('minSdk') ? minSdk.toInteger() : 16
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
public void readTwice() | |
{ | |
Observable.fromCallable(() -> { | |
RedditData inflatedModel = null; | |
Response response = makeRequest(); | |
String diskValue = null; | |
try { | |
File file = new File(getContext().getCacheDir(), "file"); | |
BufferedSink cacheBody = Okio.buffer(Okio.sink(file)); |
Create the main Progressbar wrapper in your main source code. Use it instead of the android.widget.Progressbar
as it will just forward all calls to the default Progressbar.
In your androidTest package create the Progressbar
class in the exact same package as you did in the main source code. This way all your UI tests will call this ProgressBar
instead of the default one.
And since the modifications prevent the Progressbar from showing and animating, the UI thread won't be blocked and Espresso can continue the test.
var crypto = require('crypto'); | |
// the Base64 encoded Google Play license key / Base64-encoded RSA public key from the Google Play Dev Console | |
var publicKey = "ABCEDF1234...."; | |
/** sample | |
{ | |
"orderId":"12999763169054705758.1371079406387615", | |
"packageName":"com.example.app", | |
"productId":"exampleSku", |
Copyright (c) 2016 Stephen D'Amico | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE |
<?xml version="1.0" encoding="utf-8"?> | |
<!-- | |
Copyright (C) 2015 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 |