| 35 views

Android SharedPreferences Tutorial and Examples.

In this tutorial we want to look at SharedPreferences, what it is, why it's important and several examples.

| 42 views

In Java List is an interface representing an ordered collection (also known as a sequence).

As an interface you cannot directly instantiate List<E>, instead it is there to be implemented by classes, which may then be instantiated.

And infact many important classes like the ArrayList either directly or indirectly implement this interface.

Then those implementers get precise control over which position an element is inserted. Afterwards you can access elements by their integer index (position in the list), and also search for elements in the list.

Lists can allow duplicate elements. If you don't want duplicates then it is recommended you use Set.

The List interface places additional stipulations, beyond those specified in the Collection interface, on the contracts of the iterator, add, remove, equals, and hashCode methods. Declarations for other inherited methods are also included here for convenience.

The List interface provides four methods for positional (indexed) access to list elements. Lists (like Java arrays) are zero based. Note that these operations may execute in time proportional to the index value for some implementations (the LinkedList class, for example). Thus, iterating over the elements in a list is typically preferable to indexing through it if the caller does not know the implementation.

The List interface provides a special iterator, called a ListIterator, that allows element insertion and replacement, and bidirectional access in addition to the normal operations that the Iterator interface provides. A method is provided to obtain a list iterator that starts at a specified position in the list.

The List interface provides two methods to search for a specified object. From a performance standpoint, these methods should be used with caution. In many implementations they will perform costly linear searches.

The List interface provides two methods to efficiently insert and remove multiple elements at an arbitrary point in the list.

| 23 views
XML

XML in full is eXtensible Markup Language.

By definition it is a metalanguage for defining custom markup languages, otherwise known as vocabularies. A metalanguage is a language we use for defining other languages.

XML is very important and popular to the computer science field and this ability to define vocabularies is the key.

So Applications use XML documents to:

  1. Store Data.
  2. Exchange data.

Through XML we can define rules for encoding documents that is both human readable and machine-readable.

There are many XML vocabularies but the most common one is the HTML.

XML documents are text-based and comprise markup and content. A markup is the encoded descriptions of a document's logical structure. The content is the document text that is not interpreted as markup.

| 28 views

An ArrayList is a Resizable-array implementation of the List interface.

This class is one of the most commonly used collection in the java environment. It's so flexible and easy to use and powerful. It's power and flexibility come from the fact that ArrayList implements all optional list operations, and permits all elements, including null.

Internally an ArrayList utilizes an Array to store it's items. Because of this some developers usually refer to an ArrayList as a dynamic array.

Hence the ArrayList class provides methods to manipulate the size of the array that is used internally to store the list.

| 266 views

Flutter CupertinoDialog Tutorial and Examples.

In this tutorial we want to look at a popular style of dialog in flutter called CupertinoDialog.

| 1712 views

Flutter AlertDialog Tutorial and example.

An alert dialog informs the user about situations that require acknowledgement.

| views
| 1715 views

Kotlin Android DialogFragment with ListView tutorial.

We want to see how to open a DialogFragment when a simple button is clicked. The dialogFragment will comprise of a title and a listview.

We infact inflate it via the LayoutInflater class from an xml layout specification.

When the user clicks a ListView item we show it in a Toast. When the user clicks outside the DialogFragment, we dismiss it(the DialogFragment).

Let's go.

| 297 views

This is an android horizontal datetimepicker tutorial and example.

We see how to create a horizontally scrolling datetime picker. You can easily scroll to a certain date.

| 268 views

A DialogFragment is a fragment that displays a dialog window, floating on top of its activity's window.

This fragment contains a Dialog object, which it displays as appropriate based on the fragment's state. Control of the dialog (deciding when to show, hide, dismiss it) should be done through the API here, not with direct calls on the dialog.

We do inherit from this class(android.support.v4.app.DialogFragment) then implement the Fragment.onCreateView(LayoutInflater, ViewGroup, Bundle) to supply the content of the dialogfragment.

You can also override onCreateDialog(Bundle) to create an entirely custom dialog, such as an AlertDialog, with its own content.