Tutorial by Topics: d

When you use the yield keyword in a statement, you indicate that the method, operator, or get accessor in which it appears is an iterator. Using yield to define an iterator removes the need for an explicit extra class (the class that holds the state for an enumeration) when you implement the IEnumer...
One of MEF's big advantages over other technologies that support the inversion-of-control pattern is that it supports resolving dependencies that are not known at design-time, without needing much (if any) configuration. All examples require a reference to the System.ComponentModel.Composition as...
The process of overload resolution is described in the C# specification, section 7.5.3. Also relevant are the sections 7.5.2 (type inference) and 7.6.5 (invocation expressions). How overload resolution works will probably be changed in C# 7. The design notes indicate that Microsoft will roll out ...
In order to be able to use the unsafe keyword in a .Net project, you must check "Allow unsafe code" in Project Properties => Build Using unsafe code can improve performance, however, it is at the expense of code safety (hence the term unsafe). For instance, when you use a for lo...
The Java programming language is... General-purpose: It is designed to be used for writing software in a wide variety of application domains, and lacks specialized features for any specific domain. Class-based: Its object structure is defined in classes. Class instances always have those...
If you want to learn more about the Android Gradle Plugin setting check out the android-gradle Documentation. If you are interested in alternative emulators, you could look at Genymotion. It provides a free plan and requires smaller amount of RAM. VersionAPI LevelVersion CodeRelease Date1.01B...
Objects of type Throwable and its subtypes can be sent up the stack with the throw keyword and caught with try…catch statements. void someMethod() throws SomeException { } //method declaration, forces method callers to catch if SomeException is a checked exception type try { someMethod();...
Lambda expressions provide a clear and concise way of implementing a single-method interface using an expression. They allow you to reduce the amount of code you have to create and maintain. While similar to anonymous classes, they have no type information by themselves. Type inference needs to happ...
Gradle is a JVM-based build system that enables developers to write high-level scripts that can be used to automate the process of compilation and application production. It is a flexible plugin-based system, which allows you to automate various aspects of the build process; including compiling and ...
Object : An object is an unordered set of name/value pairs. An object begins with { (left brace) and ends with } (right brace). Each name is followed by : (colon) and the name/value pairs are separated by , (comma). Array : An array is an ordered collection of values. An array begins with [...
int read(byte[] b) throws IOException Note that most of the time you do NOT use InputStreams directly but use BufferedStreams, or similar. This is because InputStream reads from the source every time the read method is called. This can cause significant CPU usage in context switches into an...
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...
Default Method introduced in Java 8, allows developers to add new methods to an interface without breaking the existing implementations of this interface. It provides flexibility to allow the interface to define an implementation which will be used as default when a class which implements that inter...
Objects have states and behaviors. Example: A dog has states - color, name, breed as well as behaviors – wagging the tail, barking, eating. An object is an instance of a class. Class − A class can be defined as a template/blueprint that describes the behavior/state that the object of its type suppo...
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...
SharedPreferences provide a way to save data to disk in the form of key-value pairs. Context Method public SharedPreferences getSharedPreferences(String name, int mode) Activity Method public SharedPreferences getPreferences() SharedPreferences Methods public SharedPre...
Concurrent computing is a form of computing in which several computations are executed concurrently instead of sequentially. Java language is designed to support concurrent programming through the usage of threads. Objects and resources can be accessed by multiple threads; each thread can potentiall...
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...
Documentation for java code is often generated using javadoc. Javadoc was created by Sun Microsystems for the purpose of generating API documentation in HTML format from java source code. Using the HTML format gives the convenience of being able to hyperlink related documents together. /** -- ...

Page 2 of 221