Minggu, 06 November 2011

MODUL PENGEMBANGAN APLIKASI ANDROID

PERCOBAAN MJENI
MODUL PENGEMBANGAN APLIKASI ANDROID
  1. TEXT VIEW 
 
package com.seamolec.buku;

import android.app.Activity;
import android.os.Bundle;
import android.text.util.Linkify;
import android.widget.TextView;

public class Textv extends Activity{

   @Override
   protected void onCreate(Bundle savedInstanceState) {
         // TODO Auto-generated method stub
         super.onCreate(savedInstanceState);
         TextView tv=new TextView(this);
         tv.setText("SEAMOLEC REGIONAL OPEN LEARNING CENTER "+
                    " Kompelek Universitas Terbuka " +
                    " Jl. Cabe Raya, Pondok Cabe Pamulang 15418 " +
                    " PO BOX 5/CPA, Ciputat 15401 Jakarta - Indonesia" +
                    " Tel : (62-21) 7422184, 7423725, 7424154" +
                    " Fax : (62-21) 7422276 " +
                    " Website : http//www.seamolec.org " +
                    " e-mail : secretariat@seamolec.org " );
         Linkify.addLinks(tv,Linkify.ALL);
         setContentView(tv);
   }
}



HASIL KODE
 
1.         DATE PICKER DAN TIME PICKER

package com.seamolec.buku;

import android.app.Activity;
import android.os.Bundle;
import android.widget.DatePicker;
import android.widget.TimePicker;

public class DnT extends Activity{
@Override
protected void onCreate(Bundle savedInstanceState) {
   // TODO Auto-generated method stub
   super.onCreate(savedInstanceState);
   setContentView(R.layout.dnt);
   DatePicker dp =(DatePicker) this.findViewById(R.id.datePicker);
   dp.init(1992,10, 19, null);
   TimePicker tp =(TimePicker) this.findViewById(R.id.timePicker);
   tp.setIs24HourView(true);
   tp.setCurrentHour(new Integer(10));
   tp.setCurrentMinute(new Integer(10));
}
}

 
HASIL CODE
 
1.         LINEAR LAYOUT
package com.seamolec.buku;

import android.app.Activity;
import android.os.Bundle;

public class Lilay extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
   // TODO Auto-generated method stub
   super.onCreate(savedInstanceState);
   setContentView(R.layout.lilay);
}
}

HASIL CODE
 
1.         TABLE LAYOUT
package com.seamolec.buku;

import android.app.Activity;
import android.os.Bundle;

public class TaLay extends Activity{

   @Override
   protected void onCreate(Bundle savedInstanceState) {
          // TODO Auto-generated method stub
          super.onCreate(savedInstanceState);
   setContentView(R.layout.talay);
   }
}

HASIL CODE


Tidak ada komentar:

Posting Komentar