Okhelp.cz

Recepty, články, nápady, programování. Dříve dum-zahrada, finance, internet a know-how.okhelp.cz Pro lepší výsledky hledání používejte i diakritiku.

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 = new StringBuilder();

        // enter your date of birth
        Calendar dateOfYourBirth = new GregorianCalendar(1998, Calendar.SEPTEMBER, 17);
        Calendar today = Calendar.getInstance();
        int yourAge = today.get(Calendar.YEAR) - dateOfYourBirth.get(Calendar.YEAR);
        dateOfYourBirth.add(Calendar.YEAR, yourAge);
        if (today.before(dateOfYourBirth)) {
            yourAge--;
        }  
        strBuild.append("You are " + yourAge + " old!");
         txtV.setText(strBuild);
    }
}


397LW NO topic_id



Další témata ....(Topics)


74

Continue statement Java example | continue-statement-java-example


For and continue statement in Java.

public class MainClass {
	public static void main(String[] arg) {
		String[] arrayOfString = { "Hello", "people", "hello", "world!" };

		for (int i = 0; i < arrayOfString.length; i++){
			if(arrayOfString[i].equals("hello"))
				continue; // skip to for
			System.out.println(arrayOfString[i]);
		}
	}
}
/*
Hello
people
world!
*/
396

CSS circle style html | css-circle-style-html



      create div with class with name e.g. circle

      create in styleSheet.css class circle



html code

 <div class="circle" id="">3</div>


css code

.circle {
 border-radius: 50%;
    width: 50px;
    height: 50px;
    background: yellow;
    position: absolute;
    display: block;
    border: 6px solid blue;
    font-size: 50px;
    text-align: center;
}






3




















168

Android SDK Samples as a Photo Gallery | android-sdk-samples-as-photo-serial


Photo Gallery of Android SDK Samples.
For better understanding of what the source knows there is a gallery of images.
After clicking on the preview displays the actual size and Titlebar
You can read the path to the source file as: Graphics/AnimateDrawables see the project folder
/ApiDemos/src/com/example/android/apis/graphics/AnimateDrawable.java


63

Date time difference determine which is earlier Android Java example | date-time-difference-between-two-dates


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 = new StringBuilder();
        Calendar firstDate = new GregorianCalendar(2011, Calendar.DECEMBER, 31);
        Calendar secondDate = new GregorianCalendar(2012, Calendar.JANUARY, 1);

        
        Boolean bDetermine = firstDate.after(secondDate);            // false
        strBuild.append("Is firsDate after secondDate? " + bDetermine + "

"); bDetermine = firstDate.before(secondDate); // true strBuild.append("Is firsDate before secondDate? " + bDetermine + "
"); long differenceInMillisecond = 0L; differenceInMillisecond = secondDate.getTimeInMillis()-firstDate.getTimeInMillis(); // second == 1000 millisecond long second = differenceInMillisecond / 1000L; strBuild.append("Difference between two dates is: " + second + "
"); txtV.setText(strBuild); } }
198

Samsung S6102 Galaxy Y Duos | samsung-s6102-galaxy-y-duos


Samsung S6102 Galaxy Y Duos umožňuje pracovat se dvěma aktivními SIM kartami a má GPS navigaci. Cena cca 4.500 korun / léto 2012.

Displej
Rozlišení displeje 320 x 240
Velikost displeje 3.14 "
Počet barev 262000
Rozměry 104 mm x 60 mm x 11.5 mm
Fotoaparát 3 Mpix, natačení videosekvencí
Operační system Android 2.3 (Gingerbread)
Procesor 832 MHz
Funkce Dual sim, Změny velikosti písma, Java, Internetový prohlížeč Přehrávání MP3, jack 3,5, Psaní SMS a e-mailů Multimediální zprávy MMS, Dlouhé SMS, Emailový prohlížeč, Kontakty a volání Hlasité handsfree, MP3/WMA/AAC vyzvánění, Skupiny volajících, Baterie
Typ baterie Li-Ion 1300 mAh
Doba hovoru 370 min
Pohotovostní doba 440 hodin
Uživatelská paměť 160 MB
Datové funkce GPS modul, WiFi, Bluetooth, GPRS, EDGE, Hardwarový modem
Aplikace Diktafon, Kalendář, FM rádio, Záznamník hovoru, Hry v telefonu, Kalkulačka, Budík
Mobilní telefony Samsung mají velmi dobrý poměr KVALITA / CENA


samsung s6102 galaxy y duos


Editace: 2011-09-29 21:08:34
Počet článků v kategorii: 397
Url:how-are-you-old-date-calendar-age-java-android-example
Share
Share
Tweet