-
The Basics
MediaPlayer: This class is the primary API for playing sound and video.AudioManager:This class manages audio sources and audio output on a device.
-
Manifest Declarations
-
Internet Permission<uses-permission android:name="android.permission.INTERNET" />
-
| import java.io.IOException; | |
| import okhttp3.HttpUrl; | |
| import okhttp3.Interceptor; | |
| import okhttp3.OkHttpClient; | |
| import okhttp3.Request; | |
| /** An interceptor that allows runtime changes to the URL hostname. */ | |
| public final class HostSelectionInterceptor implements Interceptor { | |
| private volatile String host; |
| # Created by https://www.gitignore.io/api/android | |
| ### Android ### | |
| # Built application files | |
| *.apk | |
| *.ap_ | |
| # Files for the ART/Dalvik VM | |
| *.dex |
- Fundamentals
- Running default task ./gradlew “task name"
- Running task with filename ./gradlew -b solution.gradle hello
- Installation
- java -version
- $ brew install gradle
- $ gradle --version
| [user] | |
| name = Your Name | |
| email = you@youremail.com | |
| [alias] | |
| A = add -A | |
| a = add | |
| aa = add --all | |
| ae = add --edit | |
| ai = add --interactive | |
| amend = commit --amend -C HEAD |
with the Github for Mac app
- From the repositories view in the app, drag the project folder to the bottom of the left sidebar.
- Hit "Yes" when it asks if you want to create a local git repository
- Go to "Changes" view (⌘2)
- Select the files that you want to commit their current state to the repository. You can view the changes of the file by clicking on the double up arrow on the file name bar.
| package com.example.android_transition_samples.app; | |
| import android.animation.Animator; | |
| import android.animation.AnimatorSet; | |
| import android.animation.ObjectAnimator; | |
| import android.animation.PropertyValuesHolder; | |
| import android.content.Context; | |
| import android.graphics.Rect; | |
| import android.util.AttributeSet; | |
| import android.view.View; |
This guide is a first draft (that will end up in the official docs) on writing resilient code for production with the Couchbase Java SDK. At the end, the reader will be able to write code that withstands bugs, latency issues or anything else that can make their application fail.
Note that lots of concepts can be applied for both synchronous and asynchronous access. When necessary, both patterns are discussed separately. Also, the focus is on database interaction, but if you are using RxJava as part of your stack you can apply most of the principles there as well (and should!).
When working with Observables, it is important to understand the difference between cold and hot. Cold Observables will start to emit events once a Observer subscribes, and will do it "fresh" for each Observer. Hot Observables instead are starting to emit data as soon as it becomes available, and will return the same (or parts of the same)
| package com.xwray.vectorbinding; | |
| import android.databinding.BindingAdapter; | |
| import android.databinding.DataBindingUtil; | |
| import android.graphics.drawable.Drawable; | |
| import android.os.Bundle; | |
| import android.support.graphics.drawable.VectorDrawableCompat; | |
| import android.support.v7.app.AppCompatActivity; | |
| import android.widget.TextView; |