Tutorial by Topics: at

@"verbatim strings are strings whose contents are not escaped, so in this case \n does not represent the newline character but two individual characters: \ and n. Verbatim strings are created prefixing the string contents with the @ character" @"To escape quotation marks, &qu...
In C#, an operator is a program element that is applied to one or more operands in an expression or statement. Operators that take one operand, such as the increment operator (++) or new, are referred to as unary operators. Operators that take two operands, such as arithmetic operators (+,-,*,/), ar...
$"content {expression} content" $"content {expression:format} content" $"content {expression} {{content in braces}} content}" $"content {expression:format} {{content in braces}} content}" String interpolation is a shorthand for the string.Format() ...
This sixth iteration of the C# language is provided by the Roslyn compiler. This compiler came out with version 4.6 of the .NET Framework, however it can generate code in a backward compatible manner to allow targeting earlier framework versions. C# version 6 code can be compiled in a fully backwa...
var result = possibleNullObject ?? defaultValue; ParameterDetailspossibleNullObjectThe value to test for null value. If non null, this value is returned. Must be a nullable type.defaultValueThe value returned if possibleNullObject is null. Must be the same type as possibleNullObject. The n...
Provides a convenient syntax that ensures the correct use of IDisposable objects. using (disposable) { } using (IDisposable disposable = new MyDisposable()) { } The object in the using statement must implement the IDisposable interface. using(var obj = new MyObject()) { } class M...
X?.Y; //null if X is null else X.Y X?.Y?.Z; //null if X is null or Y is null else X.Y.Z X?[index]; //null if X is null else X[index] X?.ValueMethod(); //null if X is null else the result of X.ValueMethod(); X?.VoidMethod(); //do nothing if X is null else call X.VoidMethod(); Note that w...
The Format methods are a set of overloads in the System.String class used to create strings that combine objects into specific string representations. This information can be applied to String.Format, various WriteLine methods as well as other methods in the .NET framework. string.Format(strin...
The nameof operator allows you to get the name of a variable, type or member in string form without hard-coding it as a literal. The operation is evaluated at compile-time, which means that you can rename a referenced identifier, using an IDE's rename feature, and the name string will update with i...
The NavigationView represents a standard navigation menu for application. The menu contents can be populated by a menu resource file. Before using the NavigationView you must add the design support library dependency in the build.gradle file: dependencies { compile 'com.android.support:de...
Setup Before using data binding, you must enable the plugin in your build.gradle. android { .... dataBinding { enabled = true } } Note: Data binding was added to the Android Gradle plugin in version 1.5.0 Binding class names The data binding plugin generates a bind...
Note that a ViewTreeObserver instance associated with a View instance can become invalid while that View is still alive. From the View.getViewTreeObserver javadocs: // The returned ViewTreeObserver observer is not guaranteed to remain // valid for the lifetime of this View. If the caller of this...
AVD stands for Android Virtual Device
Material Design is a comprehensive guide for visual, motion, and interaction design across platforms and devices. Also see the original Android blog post introducing the Design Support Library Official Documentation https://developer.android.com/design/material/index.html Guidelines for Mat...
The 8 primitive data types byte, short, int, long, char, boolean, float, and double are the types that store most raw numerical data in Java programs. int aInt = 8; // The defining (number) part of this int declaration is called a literal. int hexInt = 0x1a; // = 26; You can define literals...
In Java, an annotation is a form of syntactic metadata that can be added to Java source code. It provides data about a program that is not part of the program itself. Annotations have no direct effect on the operation of the code they annotate. Classes, methods, variables, parameters and packages ar...
Date object = new Date(); Date object = new Date(long date); ParameterExplanationNo parameterCreates a new Date object using the allocation time (to the nearest millisecond)long dateCreates a new Date object with the time set to the number of milliseconds since "the epoch" (Januar...
ParameterDetailsJNIEnvPointer to the JNI environmentjobjectThe object which invoked the non-static native methodjclassThe class which invoked the static native method Setting up JNI requires both a Java and a native compiler. Depending on the IDE and OS, there is some setting up required. A guide...

Page 1 of 102