Monthly Archives: September 2011

7,493 views

Locale location Java Android example

Locale lc = Locale.getDefault(); // default now locale on device String sCountry = lc.getCountry(); // CZ   lc = new Locale("fr","FR"); //FRANCE .. Locale(language, country); String sCountry2 = lc.getDisplayCountry(); // Francie   Locale locale = Locale.GERMAN; String sCountry3 = locale.getDisplayCountry(); … Continue reading

Posted in Android Examples Code | Tagged , , | Comments Off on Locale location Java Android example
12,509 views

How are you old – date calendar age Java Android example

Calendar dateOfYourBirth = new GregorianCalendar(1998, Calendar.SEPTEMBER, 17); Calendar today = Calendar.getInstance(); Android example. public class HoriziontalScrollActivity extends Activity { TextView txtV; Context cntx;   @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); txtV = (TextView)findViewById(R.id.idLabel); cntx = this; StringBuilder strBuild … Continue reading

Posted in Android Examples Code | Tagged , , , , | Comments Off on How are you old – date calendar age Java Android example
4,755 views

Leap year date time Java Android example

GregorianCalendar cal = new GregorianCalendar(); Boolean b = cal.isLeapYear(2012); // true, Android example. public class MainActivity extends Activity { TextView txtV; Context cntx;   @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); txtV = (TextView)findViewById(R.id.idLabel); cntx = this; StringBuilder strBuild … Continue reading

Posted in Android Examples Code | Tagged , , , , | Comments Off on Leap year date time Java Android example
6,036 views

Date time difference determine which is earlier Android Java example

Date difference in millisecond between two date, GregorianCalendar, Calendar, after(), befor(), getTimeInMillis().   public class HoriziontalScrollActivity extends Activity { TextView txtV; Context cntx;   @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); txtV = (TextView)findViewById(R.id.idLabel); cntx = this; StringBuilder strBuild … Continue reading

Posted in Android Examples Code | Tagged , , , , | Comments Off on Date time difference determine which is earlier Android Java example
5,210 views

Date Calendar Java Android Example

Calendar cal = new GregorianCalendar(), int year = cal.get(Calendar.YEAR), ERA, MONTH, DAY_OF_MONTH, DAY_OF_WEEK, Android example code. public class MainActivity extends Activity { TextView txtV; Context cntx;   @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); txtV = (TextView)findViewById(R.id.idLabel); cntx = … Continue reading

Posted in Android Examples Code | Tagged , , , | Comments Off on Date Calendar Java Android Example
8,796 views

Get text file content from raw folder to StringBuilder Android example

StringBuilder, res/raw folder, try catch finaly throws, BufferedReader, InputStream, openRawResource, getResources Android example MainActivity.java   public class MainActivity extends Activity { TextView txtV; Context cntx;   @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); txtV = (TextView)findViewById(R.id.idLabel); cntx = this; … Continue reading

Posted in Android Examples Code | Tagged , , , , , , | Comments Off on Get text file content from raw folder to StringBuilder Android example
2,966 views

Get all ID from xml file for Android developers utility

This software allow find all IDs from xml layout file source code and create variables with findViewById for onCreate, for onClick and load save preferences functions. Get all ID is for Windows XP and higher. 2017,04,28 Download 1.0.2.0

Posted in Android Software Download | Tagged , | Comments Off on Get all ID from xml file for Android developers utility
5,551 views

Relative layout RelativeLayout Android example

xml RelativeLayout Android example: Eclipse graphical xml layout editor res/layout/main.xml <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <TextView android:id="@+id/idLabel" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Enter word"/> <EditText android:id="@+id/idEntry" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@android:drawable/editbox_background" android:layout_below="@id/idLabel"/> <Button android:id="@+id/idOk" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@id/idEntry" android:layout_alignParentRight="true" android:layout_marginLeft="10dip" android:text="OK" /> <Button android:layout_width="wrap_content" … Continue reading

Posted in Android Examples Code | Tagged , , , , | Comments Off on Relative layout RelativeLayout Android example
15,285 views

HorizontalScrollView ScrollView horizontal vertical Android xml example

HorizontalScrollView ScrollView LinearLayout horizontal vertical Android xml basic example and image. <?xml version="1.0" encoding="utf-8"?> <LinearLayout android:id="@+id/LinearLayout01" android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android">   // horizontal and vertical Scrollview <ScrollView android:id="@+id/ScrollView01" android:layout_height="135px" android:layout_width="wrap_content" android:scrollbars="horizontal|vertical">   // HorizontalScrollview <HorizontalScrollView android:id="@+id/HorizontalScrollView01" android:layout_height="fill_parent" android:layout_width="wrap_content">   <LinearLayout android:id="@+id/LinearLayout02" … Continue reading

Posted in Android Examples Code | Tagged , , , , | Comments Off on HorizontalScrollView ScrollView horizontal vertical Android xml example
15,932 views

Change TableRow background color if on row click Android example

Change table row background color if user click on row Android example code. MainActivity.java public class MainActivity extends Activity { Boolean bColorYellow = true; TextView hTextView; TableRow hTableRow; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); hTextView = (TextView)findViewById(R.id.idTextView); hTableRow … Continue reading

Posted in Android Examples Code | Tagged , , , , , | Comments Off on Change TableRow background color if on row click Android example