Tutorial by Topics: i

A regular expression is a special sequence of characters that helps in matching or finding other strings or sets of strings, using a specialized syntax held in a pattern. Java has support for regular expression usage through the java.util.regex package. This topic is to introduce and help developers...
A Service runs in background to perform long-running operations or to perform work for remote processes. A service does not provide any user interface it runs only in background with User’s input. For example a service can play music in the background while the user is in a different App, or it migh...
Autoboxing is the automatic conversion that Java compiler makes between primitive types and their corresponding object wrapper classes. Example, converting int -> Integer, double -> Double... If the conversion goes the other way, this is called unboxing. Typically, this is used in Collections ...
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. /** -- ...
The Executor interface in Java provides a way of decoupling task submission from the mechanics of how each task will be run, including details of thread use, scheduling, etc. An Executor is normally used instead of explicitly creating threads. With Executors, developers won't have to significantly r...
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...
new Socket("localhost", 1234); //Connects to a server at address "localhost" and port 1234 new SocketServer("localhost", 1234); //Creates a socket server that can listen for new sockets at address localhost and port 1234 socketServer.accept(); //Accepts a new Socket...
FileOutputStream openFileInput (String name) FileOutputStream openFileOutput (String name, int mode) File(File dir, String name) File(String path) File getExternalStoragePublicDirectory (String type) File getExternalFilesDir (String type) ParameterDetailsnameThe name of the file to ope...
Optional is a container object which may or may not contain a non-null value. If a value is present, isPresent() will return true and get() will return the value. Additional methods that depend on the presence of the contained value are provided, such as orElse(), which returns a default value if v...
WebView is a view that display web pages inside your application. By this you can add your own URL. Please don't forget to add permission in your Android manifest file <uses-permission android:name="android.permission.INTERNET" />
Using HttpUrlConnection on Android requires that you add the Internet permission to your app (in the AndroidManifest.xml). There are also other Java HTTP clients and libraries, such as Square's OkHttp, which are easier to use, and may offer better performance or more features.
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...
Instead of using the javax.sound.sampled Clip, you can also use the AudioClip which is from the applet API. It is however recommended to use Clip since AudioClip is just older and presents limited functionalities.
An Android application needs to run on all kinds of devices. Each device may have a different version on Android running on it. Now, each Android version might not support all the features that your app requires, and so while building an app, you need to keep the minimum and maximum Android version...
As of Java 8, Calendar and its subclasses have been superseded by the java.time package and its subpackages. They should be preferred, unless a legacy API requires Calendar.
Nashorn is a JavaScript engine developed in Java by Oracle, and has been released with Java 8. Nashorn allows embedding Javascript in Java applications via JSR-223 and allows to develop standalone Javascript applications, and it provides better runtime performance and better compliance with the ECMA...
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...
RecyclerView is a more advanced version of List View with improved performance and additional features. ParameterDetailAdapterA subclass of RecyclerView.Adapter responsible for providing views that represent items in a data setPositionThe position of a data item within an AdapterIndexThe index ...
ParameterDetailsGoogleMapthe GoogleMap is an object that is received on a onMapReady() eventMarkerOptionsMarkerOptions is the builder class of a Marker, and is used to add one marker to a map. Requirements Google Play Services SDK installed. A Google Console Account. A Google Maps API Key o...
RMI requires 3 components: client, server and a shared remote interface. The shared remote interface defines the client-server contract by specifying the methods a server must implement. The interface must be visible to the server so that it can implement the methods; the interface must be visible...

Page 5 of 340