Image

Android Java - UI Control – Textview Dasar

Bismillah. Assalamu’alaikum sob. Pada postingan kali ini kita akan mencoba mengupas Textview. Salah satu komponen dalam pembuatan aplikasi yang terpenting dan paling sering digunakan adalah komponen Textview. Apa itu Textview?

Textview merupakan komponen yang berfungsi untuk menampilkan data tertentu kepada pengguna. Judul "Zainsoft Tutorial" dibawah merupakan contoh penggunaan komponen Textview.

Untuk lebih jelasnya kita akan langsung coba implementasikan langsung di Android Studio. Android studio yang saya gunakan versi Android Studio 4.2 ya sob.

  1. Buat New Project
    File -> New Project -> Empty Activity -> Next
    Kemudia kita berima nama project dengan nama "UI Controls"


  2. Lengkapi script
    Gradle:
    implementation 'androidx.appcompat:appcompat:1.3.0'
        implementation 'com.google.android.material:material:1.3.0'
        implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
        testImplementation 'junit:junit:4.+'
        androidTestImplementation 'androidx.test.ext:junit:1.1.2'
        androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
    activity_main.xml
    s:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/white"
        tools:context=".MainActivity">

                android:id="@+id/id_title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerHorizontal="true"
            android:layout_margin="20dp"
            android:textStyle="bold"
            android:textSize="40sp"
            android:fontFamily="cursive"
            android:text="ZainSoft Tutorial  " />

    AndroidManifest.xml
    xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="com.zainsoft.uicontrol">


        <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/Theme.UIControl">

            <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>
    MainActivity.java
    public class MainActivity extends AppCompatActivity {

        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main);
        }
    }
    Penulisan script sudah selesai, sekarang kita coba jalankan project

  3. Running Project


Categories: Java Android

2 Comments

  • Image placeholder

    Ceadefark

    16-11-2024 01:11:33

    If you want to dodge your own black mamba 2 male enhancement Testmax Male Enhancement Pills attacks, it can be said to be very dodgy donde comprar priligy mexico Weightlifters use Arimidex for weight training to reduce the effects of anabolic androgenic steroids which often interact with estrogen, which leads to gynecomastia, otherwise known as enlarged breasts in men

  • Image placeholder

    Jewspaway

    31-08-2024 18:52:36

    For people living in a typical hunter gatherer population, sodium is scarce, and hypertension is rare how to buy priligy as a child

  • Leave a comment

Popular Posts

1

Hello World Java Android

2

Login App dengan Java Programming

3
4

See All Popular

Berlangganan Berita

Kami akan mengirim informasi - informasi terbaru sekitar teknologi dan pemrograman untuk menambah refenrensi anda untuk menjadi programmer handal. Masukkan email anda kolom sebelah ->