Tag Archives: array

7,049 views

List LinkedList add sort find Item in Java example

List LinkedList Collections add sort find search Item, get searched item to string in Java example. MainClass.java import java.util.Collections; import java.util.LinkedList; import java.util.List;   public class MainClass { public static void main(String[] arg) { String[] arrayOfString = {"nothing", "Hello", "people" … Continue reading

Posted in Android Examples Code, Array,List,Collections | Tagged , , , , , , | Comments Off on List LinkedList add sort find Item in Java example
9,765 views

ArrayList Collections Add new Item Sort Find Item Java example

How add item to ArrayList, sort ArrayList, search find index of item in ArrayList, min(), max() Java basic example. import java.util.ArrayList; import java.util.Collections;   public class MainClass { public static void main(String[] arg) { String[] arrayOfString = {"nothing", "Hello", "people" … Continue reading

Posted in Android Examples Code, Array,List,Collections | Tagged , , , , , | Comments Off on ArrayList Collections Add new Item Sort Find Item Java example
4,489 views

For cycle loop in Java example

Cycle for in Java example public class MainClass { public static void main(String[] arg) { String[] arrayOfString = { "Hello", "people", "hello", "world!" };   for (int i = 0; // start position , first cycle i == 0 i … Continue reading

Posted in Android Examples Code | Tagged , , , , , , , | Comments Off on For cycle loop in Java example
36,393 views

Foreach loop cycle in Java Android example

Foreach in Java basic example source code. MainClass.java   public class MainClass { public static void main(String[] arg) { String[] arrayOfString = { "Hello", "people", "hello", "world!" };   for (String s : arrayOfString) System.out.println(s);   } }

Posted in Android Examples Code | Tagged , , , , , | Comments Off on Foreach loop cycle in Java Android example
25,834 views

Get assets folder files to array of strings Android example

Get assets folder files to array of strings. Its show files in assets folder and sub folders: public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main);   final AssetManager assetManager = getAssets(); try { // for assets folder add empty string String[] … Continue reading

Posted in Android Examples Code | Tagged , , , , , , , | Comments Off on Get assets folder files to array of strings Android example
8,959 views

Create array of strings in xml file Android example

Example source code for Android developers how create array of strings in *.xml file. You can using array of strings in Spinner ( combobox – dropdown list ) or ListView etc. <resources> <string-array name="colors"> <item>red</item> <item>orange</item> <item>yellow</item> <item>green</item> <item>blue</item> </string-array> … Continue reading

Posted in Android Examples Code, Array,List,Collections | Tagged , , , | Comments Off on Create array of strings in xml file Android example