Instantiate your ExoPlayer:
exoPlayer = ExoPlayer.Factory.newInstance(RENDERER_COUNT, minBufferMs, minRebufferMs);
To play audio only you can use these values:
RENDERER_COUNT = 1 //since you want to render simple audio
minBufferMs = 1000
minRebufferMs = 5000
Both buffer values can be twea...
Note: Let's setup some anonymous authentication for the example
{
"rules": {
".read": "auth != null",
".write": "auth != null"
}
}
Once it is done, create a child by editing your database address. For example:
https://your-proje...
In order to enable writing more complex UI tests the UIAutomatorViewer is needed. The tool located at /tools/ makes a fullscreen screenshot including the layouts of the currently displayed views. See the subsequent picture to get an idea of what is shown:
For the UI tests we are looking for resou...
Putting UIAutomator tests together to a test suite is a quick thing:
package de.androidtest.myapplication;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
@RunWith(Suite.class)
@Suite.SuiteClasses({InterAppTest1.class, InterAppTest2.class})
public class AppTestSuite {}
...
This example creates a MediaSession object when a Service is started. The MediaSession object is released when the Service gets destroyed:
public final class MyService extends Service {
private static MediaSession s_mediaSession;
@Override
public void onCreate() {
// Insta...
Trigger speech to text translation
private void startListening() {
//Intent to listen to user vocal input and return result in same activity
Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
//Use a language model based on free-form speech recognition.
...
The following code can be used to trigger speech-to-text translation without showing a dialog:
public void startListeningWithoutDialog() {
// Intent to listen to user vocal input and return the result to the same activity.
Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEEC...
This example assumes that you have already set up a Firebase Realtime Database. If you are a starter, then please inform yourself here on how to add Firebase to your Android project.
First, add the dependency of the Firebase Database to the app level build.gradle file:
compile 'com.google.firebase...
First create a BroadcastReceiver class to handle the incoming Location updates:
public class LocationReceiver extends BroadcastReceiver implements Constants {
@Override
public void onReceive(Context context, Intent intent) {
if (LocationResult.hasResult(intent)) {
...
We will take vehicle hierarchy example as depicted below.
Vehicle.java
package com.thejavageek.jpa.entities;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance...
angular.component("SampleComponent", {
bindings: {
title: '@',
movies: '<',
reservation: "=",
processReservation: "&"
}
});
Here we have all binding elements.
@ indicates that we need a very basic binding, from the parent scope ...
The next example can be used to determine whether a enumeration has the FlagsAttribute specified. The methodology used is based on Reflection.
This example will give a True result:
Dim enu As [Enum] = New FileAttributes()
Dim hasFlags As Boolean = enu.GetType().GetCustomAttributes(GetType(FlagsAt...
In some very specific scenarios we would feel the need to perform a specific action for each flag of the source enumeration.
We can write a simple Generic extension method to realize this task.
<DebuggerStepThrough>
<Extension>
<EditorBrowsable(EditorBrowsableState.Always)>
Pu...
The next example is intended to count the amount of flags in the specified flag combination.
The example is provided as a extension method:
<DebuggerStepThrough>
<Extension>
<EditorBrowsable(EditorBrowsableState.Always)>
Public Function CountFlags(ByVal sender As [Enum]) As In...
If a singleshot timer is required, it is quiet handy to have the slot as lambda function right in the place where the timer is declared:
QTimer::singleShot(1000, []() { /*Code here*/ } );
Due to this Bug (QTBUG-26406), this is way is only possible since Qt5.4.
In earlier Qt5 versions it has to ...
The config location for your runner is:
Debian/Ubuntu/CentOS
/etc/gitlab-runner/config.toml if run as root
~/.gitlab-runner/config.toml if run as non-root
Windows
config.toml where your binary is located
A minimal config.toml can look like this:
concurrent = 1
[[runners]]
name = "E...
Gmail Example
MAIL_URL=smtp://username%40gmail.com:[email protected]:465/
Note: This setup only allows 2000 emails to be sent per day. Please see https://support.google.com/a/answer/176600?hl=en for alternative configurations.
Setup
First, install the necessary packages with:
npm install express cors mongoose
Code
Then, add dependencies to server.js, create the database schema and the name of the collection, create an Express.js server, and connect to MongoDB:
var express = require('express');
var cors = require('...