I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\
This file contains hidden or 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 AccountAuthenticator extends AbstractAccountAuthenticator { | |
| private final Context context; | |
| @Inject @ClientId String clientId; | |
| @Inject @ClientSecret String clientSecret; | |
| @Inject ApiService apiService; | |
| public AccountAuthenticator(Context context) { | |
| super(context); |
This file contains hidden or 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
| def toCamelCase(String string) { | |
| String result = "" | |
| string.findAll("[^\\W]+") { String word -> | |
| result += word.capitalize() | |
| } | |
| return result | |
| } | |
| afterEvaluate { project -> | |
| Configuration runtimeConfiguration = project.configurations.getByName('compile') |
This file contains hidden or 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 Bitmap blurBitmap(Bitmap bitmap){ | |
| //Let's create an empty bitmap with the same size of the bitmap we want to blur | |
| Bitmap outBitmap = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Config.ARGB_8888); | |
| //Instantiate a new Renderscript | |
| RenderScript rs = RenderScript.create(getApplicationContext()); | |
| //Create an Intrinsic Blur Script using the Renderscript | |
| ScriptIntrinsicBlur blurScript = ScriptIntrinsicBlur.create(rs, Element.U8_4(rs)); |
This file contains hidden or 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
| /* | |
| * Copyright 2014 Chris Banes | |
| * | |
| * 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 |
This file contains hidden or 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.libraryVariants.all { variant -> | |
| def name = variant.buildType.name | |
| if (name.equals(com.android.builder.BuilderConstants.DEBUG)) { | |
| return; // Skip debug builds. | |
| } | |
| def task = project.tasks.create "jar${name.capitalize()}", Jar | |
| task.dependsOn variant.javaCompile | |
| //Include Java classes | |
| task.from variant.javaCompile.destinationDir | |
| //Include dependent jars with some exceptions |
This file contains hidden or 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 com.facebook.rebound.origami; | |
| import android.app.Activity; | |
| import android.content.res.Resources; | |
| import android.os.Bundle; | |
| import android.view.View; | |
| import android.view.ViewTreeObserver; | |
| import com.facebook.rebound.SimpleSpringListener; | |
| import com.facebook.rebound.Spring; |
This file contains hidden or 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
| buildscript { | |
| repositories { | |
| mavenCentral() | |
| } | |
| dependencies { | |
| classpath 'com.android.tools.build:gradle:0.6.+' | |
| } | |
| } | |
| apply plugin: 'android' |
This file contains hidden or 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"?> | |
| <manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
| package="de.mobilej.overlay" | |
| android:versionCode="1" | |
| android:versionName="1.0" > | |
| <uses-sdk android:minSdkVersion="14" /> | |
| <application android:label="SystemOverlay" > | |
| <activity |
This file contains hidden or 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 { | |
| signingConfigs { | |
| release | |
| } | |
| buildTypes { | |
| release { | |
| signingConfig signingConfigs.release | |
| } |