Android -Random, case, switch

Random crazy = new Random();


switch(crazy.nextInt(3)){
case 0:
display.setGravity(Gravity.LEFT);
break;
case 1:
display.setGravity(Gravity.CENTER);
break;
case 2:
display.setGravity(Gravity.RIGHT);
break;

default setting is center

Android -Thread -

do different things at the same time
framework
Thread timer =new Thread(){
public void run(){
try{
} catch (InterruptedException e){
//debug if it is slow
}finally{
}
}
};
timer.start();

Android -對話框 Dialog; + Toast

Original: http://code.google.com/p/androidbmi/wiki/AndroidDialog


        private void openOptionsDialog() {
                AlertDialog.Builder dialog = new AlertDialog.Builder(Bmi.this)
                dialog.setTitle(R.string.about_title)
                dialog.setMessage(R.string.about_msg)
                dialog.setPositiveButton(R.string.ok_label,
                    new DialogInterface.OnClickListener(){
                        public void onClick(
                                DialogInterface dialoginterface, int i){
                                }
                        })
                dialog.show();
        }
}

Add in:
String.xml: about_title, about_msg, ok_label
import: dialoginterface, AlertDialog

p.s. openOptionsDialog => private void

Toast:





















別忘了不管是 AlertDialog 或者 Toast,這些函式後都必須加上「show()」方法,這樣提醒訊息才會顯示到螢幕上。 

Android connection

string.xml <=> R.java <=> main.xml

starting name shouldnt be Capital letter!

citysuper, Lane Crawford, G2000

citysuper:
Christmas contract position:
20days
$40 -$60

Lane Crawford:
Temp sales position:
9/12/2011 - end of Jan
3 -5days per week. 8*weeks *5 =40 > 20days
$360 per day, 10hrs, 1hr lunch +0.5hr tea time
=$42

G2000:
full time sales contract all year:
$7400 per month + commission
Mon -Sat, 10a.m. -10p.m.
=$32 per hour

minimum wage by law:
$28

Your choice

G2000

Position 顧客助理
 
Reference Code REF000014
 
Job Requirements 
  • 中五或以上程度
  • 積極主動,親切有禮及具良好顧客服務態度
  • 具零售經驗優先
 
Contact Information 日期: 星期一至五
時間: 9:30am - 12:30pm / 2:30pm - 5:00 pm
地點: 葵涌大連排道200號偉倫中心二期29樓(寫字樓)
(葵芳地鐵站 A 出口近葵芳警署)
備註: 應徵者請攜同近照一張, 學歷及工作證明

如有任何查詢,請致電招聘熱線2449 1149