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 static void foo() { | |
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { | |
long x = JobInfo.getMinPeriodMillis(); //available on N+, no lint error | |
} else { | |
long x = JobInfo.getMinPeriodMillis(); //available on M-, lint error | |
} | |
if (isNougatOrAbove()) { | |
long x = JobInfo.getMinPeriodMillis(); //available on N+, no lint error | |
} else { | |
long x = JobInfo.getMinPeriodMillis(); //available on M-, lint check does not work! |
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 com.android.ddmlib.AndroidDebugBridge | |
import com.android.ddmlib.IDevice | |
import com.android.ddmlib.NullOutputReceiver | |
import java.util.concurrent.TimeUnit | |
buildscript { | |
repositories { | |
jcenter() | |
} |
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
--- | |
format_version: '2' | |
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git | |
project_type: android | |
workflows: | |
stf_test: | |
steps: | |
- activate-ssh-key: | |
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}' | |
- cache-pull: {} |
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 java.io.File | |
val file = File("/dev/null") | |
println("exists: ${file.exists()}") | |
println("isFile: ${file.isFile()}") | |
println("isDirectory: ${file.isDirectory()}") |
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 java.nio.file.Files | |
import java.nio.file.Path | |
import java.nio.file.Paths | |
val path = Paths.get("foo") | |
Files.createSymbolicLink(path, path) | |
println("exists : ${path.toFile().exists()}") | |
println("isFile : ${path.toFile().isFile()}") | |
println("isDirectory : ${path.toFile().isDirectory()}") | |
println("createNewFile: ${path.toFile().createNewFile()}") |
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
apply plugin: 'com.android.application' | |
apply plugin: 'kotlin-android' | |
apply plugin: 'kotlin-android-extensions' | |
android { | |
compileSdkVersion versions.compileSdk | |
buildToolsVersion "26.0.1" | |
defaultConfig { | |
applicationId "pl.droidsonroids.bootcamp.rxbootcamp" | |
minSdkVersion 21 |
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
package pl.droidsonroids.edgetest | |
import android.content.res.AssetFileDescriptor | |
import android.support.test.InstrumentationRegistry | |
import org.junit.Assert | |
import org.junit.Test | |
class TooManyOpenFilesTest { | |
//asset named "test" required | |
@Test |
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 java.io.BufferedReader | |
import java.io.File | |
import java.io.FileReader | |
val file = File("test") | |
file.writeText("this is file content") | |
BufferedReader(FileReader(file)).use { | |
println("deleted?: ${file.delete()}") | |
println("content?: ${it.readLine()}") |
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
buildTypes { | |
debug { | |
pseudoLocalesEnabled 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
android { | |
defaultConfig { | |
//other locales will be filtered out | |
resConfigs 'en', 'hu' | |
} | |
buildTypes { | |
debug { | |
pseudoLocalesEnabled true | |
} | |
} |