Tutorial by Examples: f

By default, Android will display Toast messages at the bottom of the screen even if the keyboard is showing. This will show a Toast message just above the keyboard. public void showMessage(final String message, final int length) { View root = findViewById(android.R.id.content); Toast toas...
ndk-build NDK_PROJECT_PATH=PROJECT_PATH APP_BUILD_SCRIPT=MyAndroid.mk
Currently it contains rules for following libraries:- ButterKnife RxJava Android Support Library Android Design Support Library Retrofit Gson and Jackson Otto Crashlitycs Picasso Volley OkHttp3 Parcelable #Butterknife -keep class butterknife.** { *; } -keepnames class * { @butterk...
For enabling ProGuard configurations for your application you need to enable it in your module level gradle file. you need to set the value of minifyEnabled true. You can also enable shrinkResources true which will remove resources that ProGuard flaggs as unused. buildTypes { release { ...
First of all you need to setup your project adding Firebase to your Android project following the steps described in this topic. Set up Firebase and the FCM SDK Add the FCM dependency to your app-level build.gradle file dependencies { compile 'com.google.firebase:firebase-messaging:11.0.4' } ...
This annotation ensures that only the valid integer constants that you expect are used. The following example illustrates the steps to create an annotation: import android.support.annotation.IntDef; public abstract class Car { //Define the list of accepted constants @IntDef({MICROCA...
A Gemfile is the standard way to organize dependencies in your application. A basic Gemfile will look like this: source 'https://rubygems.org' gem 'rack' gem 'sinatra' gem 'uglifier' You can specify the versions of the gem you want as follows: # Match except on point release. Use only 1.5....
Due to not being Excel-VBA exclusive contents this Example has been moved to VBA documentation. Link: Jagged Arrays (Arrays of Arrays)
You can create a form using the form_tag helper <%= form_tag do %> Form contents <% end %> This creates the following HTML <form accept-charset="UTF-8" action="/" method="post"> <input name="utf8" type="hidden" value=...
To create a search form, enter the following code <%= form_tag("/search", method: "get") do %> <%= label_tag(:q, "Search for:") %> <%= text_field_tag(:q) %> <%= submit_tag("Search") %> <% end %> form_tag: This is t...
Checkboxes <%= check_box_tag(:pet_dog) %> <%= label_tag(:pet_dog, "I own a dog") %> <%= check_box_tag(:pet_cat) %> <%= label_tag(:pet_cat, "I own a cat") %> This will generate the following html <input id="pet_dog" name="pet_dog&q...
This is a step-by-step guide to installing OpenCV 3 on a Debian-based Linux system from source. The steps should stay the same for other distros, just replace the relevant package manager commands when installing packages for the build. Note: If you don't feel like wasting time building stuff or di...
The result of casting a pointer to an integer using reinterpret_cast is implementation-defined, but "... is intended to be unsurprising to those who know the addressing structure of the underlying machine." int x = 42; int* p = &x; long addr = reinterpret_cast<long>(p); std::...
Store data in SEQUENCEFILE if the data needs to be compressed. You can import text files compressed with Gzip or Bzip2 directly into a table stored as TextFile. The compression will be detected automatically and the file will be decompressed on-the-fly during query execution. CREATE TABLE raw_seque...
Using dotnet new will scaffold a new console application. To scaffold other types of projects, use the -t or --type flag: dotnet new -t web dotnet restore dotnet run The available templates vary by language. C# Templates console (default) - A console application. web - An ASP.NET Core app...
By default, dotnet new creates C# projects. You can use the -l or --lang flag to scaffold projects in other languages: dotnet new -l f# dotnet restore dotnet run Currently, dotnet new supports C# and F#.
Note: Following instructions are written for Python 2.7 (unless specified): instructions for Python 3.x are similar. WINDOWS First, download the latest version of Python 2.7 from the official Website (https://www.python.org/downloads/). Version is provided as an MSI package. To install it manu...
Facade is structural design pattern. It hides the complexities of large system and provides a simple interface to client. Client uses only Facade and it's not worried about inter dependencies of sub-systems. Definition from Gang of Four book: Provide a unified interface to a set of interfaces i...
Round a decimal number to an integer value For exact numeric values (e.g. DECIMAL): If the first decimal place of a number is 5 or higher, this function will round a number to the next integer away from zero. If that decimal place is 4 or lower, this function will round to the next integer value cl...
public class ConnectSocketExample { private int HTTP_PORT = 80; /** * example method to create unconnected socket * then connect to it * at end return connected socket * * @param httpHostName - endpoint host name fot socket connection * @throws IOEx...

Page 203 of 457