Anda di halaman 1dari 7

Laporan Tugas Besar Pemrograman Berbasis Objek

Aplikasi Kalkulator Kurs

Kelompok

:5

Nama Anggota : Faridah Nabila Uthami

Muhammad Faishal Akbar


Ricky Nurseptian Pratama
Kelas

: TT 3B

Program Studi Teknik Telekomunikasi


Politeknik Negeri Jakarata
Depok
2015

I. Judul Aplikasi: Fast News


Aplikasi Fast News Ini merupakan aplikasi sederhana yang dapat membantu kita mengakses
situs-situs berita dengan cepat, dengan menekan aplikasi dan akan langsung di berikan beberapa
pilihan situs yang bisa langsung menuju websitenya.
Berikut adalah source code program aplikasi Fast News
Layout Source Code
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/widget33"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/background" >
<RadioGroup
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentLeft="true"
android:orientation="vertical" >
<LinearLayout
android:id="@+id/widget38"
android:layout_width="320px"
android:layout_height="270px"
android:orientation="vertical" >
<TextView
android:id="@+id/widget39"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Dollar"
android:textStyle="bold" />
<EditText
android:id="@+id/dollar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="number"
android:textSize="18sp" >
<requestFocus />
</EditText>
<TextView
android:id="@+id/widget40"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Rupiah"
android:textStyle="bold" />
<EditText
android:id="@+id/rupiah"
android:layout_width="match_parent"

android:layout_height="wrap_content"
android:textSize="18sp" />
<TextView
android:id="@+id/widget41"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Real"
android:textStyle="bold" />
<EditText
android:id="@+id/real"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="18sp" />
</LinearLayout>
<RadioButton
android:id="@+id/dtor"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Dollar ke Rupiah" />
<RadioButton
android:id="@+id/rtod"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Rupiah Ke Dollar" />
<RadioButton
android:id="@+id/rltor"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Real ke Rupiah" />
<RadioButton
android:id="@+id/rtorl"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Rupiah ke Real" />
<RadioButton
android:id="@+id/dtorl"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Dollar ke Real" />
<RadioButton
android:id="@+id/rltod"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Real ke Dollar" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >

<Button
android:id="@+id/convert"
android:layout_width="313px"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginLeft="26dp"
android:text="Convers"
android:textStyle="bold" />
</RelativeLayout>
</RadioGroup>
</RelativeLayout>

Main Activity

package com.example.fastnews;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;
public class MainActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button detik = (Button) findViewById (R.id.detik);
Button kompas = (Button) findViewById (R.id.kompas);
Button vivanews = (Button) findViewById (R.id.vivanews);
Button sportnews = (Button) findViewById (R.id.sportnews);
detik.setOnClickListener( new Button.OnClickListener(){
public void onClick(View v){
callintent(v);
}
});
kompas.setOnClickListener( new Button.OnClickListener(){
public void onClick (View v){
callintent(v);
}
});
vivanews.setOnClickListener( new Button.OnClickListener(){
public void onClick (View v){
callintent(v);
}
});
sportnews.setOnClickListener( new Button.OnClickListener(){
public void onClick (View v){
callintent(v);
}
});
}

public void callintent(View view) {


Intent intent = null;
switch (view.getId()) {
case R.id.detik:
intent = new Intent(Intent. ACTION_VIEW,
Uri. parse( "http://detik.com" ));
startActivity(intent);
break;
case R.id.kompas:
intent = new Intent(Intent. ACTION_VIEW,
Uri. parse( "http://kompas.com" ));
startActivity(intent);
break;
case R.id.vivanews:
intent = new Intent(Intent. ACTION_VIEW,
Uri. parse( "http://vivanews.com" ));
startActivity(intent);
break;
case R.id.sportnews:
intent = new Intent(Intent. ACTION_VIEW,
Uri. parse( "http://www.bola.net" ));
startActivity(intent);
break;
default:
break;
}
}
@Override
protected void onActivityResult( int requestCode, int resultCode,
Intent data) {
if (resultCode == Activity. RESULT_OK && requestCode == 0) {
String result = data.toURI();
Toast. makeText( this, result, Toast. LENGTH_LONG);
}
}}

I.

Hasil eksekusi

Penjelasan Program

Aplikasi ini di gunakan sebagai akses cepat untuk mendapatkan informasi berita
terkini seputar website yang sudah terkenal di kalangan

II.

Kesimpulan
Aplikasi KalkulatorKurs dapat dijalankan dengan target android 4.1 (jelly bean)
dan android minimum 2.2 (froyo) serta cocok dengan android 4.3 (jelly bean). Aplikasi
ini memudahkan pengguna dalam mengkonversi kurs mata uang dollar dan poundsterling
dengan mata uang rupiah. Pada aplikasi ini menggunakan source code dengan metode
private long sebagai perhitungan dasar.

Anda mungkin juga menyukai