Sunteți pe pagina 1din 5

LAPORAN APLIKASI MOBILE

PRAKTIKUM 6

Disusun Oleh :
FADILLAH BASRI (1903423006)
BM RPL

PROGRAM STUDI BROADBAND MULTIMEDIA


JURUSAN TEKNIK ELEKTRO
POLITEKNIK NEGERI JAKARTA
2019
TUGAS 1

AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.nomorsatu">
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category
android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>

Strings.xml
<resources>
<string name="app_name">nomorSatu</string>
<string name="tottenham">TOTTENHAM HOTSPURS</string>
<string name="chelsea">CHELSEA</string>
<string name="liverpool">LIVERPOOL</string>
<string name="united">MANCHESTER UNITED</string>
</resources>

Colors.xml

<?xml version="1.0" encoding="utf-8"?>


<resources>
<color name="colorPrimary">#008577</color>
<color name="colorPrimaryDark">#00574B</color>
<color name="colorAccent">#D81B60</color>
<color name="a">#070533</color>
<color name="b">#165ed3</color>
<color name="c">#ed1f48</color>
<color name="d">#ca1b0c</color>
<color name="white">#fff</color>
</resources>
Activity_main.xml

<?xml version="1.0" encoding="utf-8"?>


<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity"
android:orientation="vertical">

<Button
android:layout_width="match_parent"
android:layout_height="160px"
android:text="@string/tottenham"
android:layout_marginTop="75px"
android:layout_marginLeft="10px"
android:layout_marginRight="10px"
android:background="@color/a"
android:textColor="@color/white"
android:onClick="open1"/>
<Button
android:layout_width="match_parent"
android:layout_height="160px"
android:text="@string/chelsea"
android:layout_marginTop="75px"
android:layout_marginLeft="10px"
android:layout_marginRight="10px"
android:background="@color/b"
android:textColor="@color/white"
android:onClick="open2"/>
<Button
android:layout_width="match_parent"
android:layout_height="160px"
android:text="@string/liverpool"
android:layout_marginTop="75px"
android:layout_marginLeft="10px"
android:layout_marginRight="10px"
android:background="@color/c"
android:textColor="@color/white"
android:onClick="open3"/>
<Button
android:layout_width="match_parent"
android:layout_height="160px"
android:text="@string/united"
android:layout_marginTop="75px"
android:layout_marginLeft="10px"
android:layout_marginRight="10px"
android:background="@color/d"
android:textColor="@color/white"
android:onClick="open4"/>

</LinearLayout>
MainActivity.java

package com.example.nomorsatu;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;

public class MainActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void open1(View view){


String url="https://www.tottenhamhotspur.com";
Intent openBrowser = new Intent(Intent.ACTION_VIEW);
openBrowser.setData(Uri.parse(url));
startActivity(openBrowser);
}

public void open2(View view) {


String url="https://www.chelseafc.com/en";
Intent openBrowser = new Intent(Intent.ACTION_VIEW);
openBrowser.setData(Uri.parse(url));
startActivity(openBrowser);
}

public void open3(View view) {


String url="https://www.liverpoolfc.com/";
Intent openBrowser = new Intent(Intent.ACTION_VIEW);
openBrowser.setData(Uri.parse(url));
startActivity(openBrowser);
}

public void open4(View view) {


String url="https://www.manutd.com";
Intent openBrowser = new Intent(Intent.ACTION_VIEW);
openBrowser.setData(Uri.parse(url));
startActivity(openBrowser);
}
}
HASIL

S-ar putea să vă placă și