Posts

Showing posts from February, 2024

Adapters-App List

Image
 Output: Activity main xml  <ListView         android:id="@+id/listview"         android:layout_width="0dp"         android:layout_height="0dp"         app:layout_constraintBottom_toBottomOf="parent"         app:layout_constraintEnd_toEndOf="parent"         app:layout_constraintStart_toStartOf="parent"         app:layout_constraintTop_toTopOf="parent" /> Main Java public class MainActivity extends AppCompatActivity {     ListView listview;     @Override     protected void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         setContentView(R.layout.activity_main);         // 1- AdapterView: ListView         listview = findViewById(R.id.listview);         // 2- Data Sourc...

French Teacher App

Image
 Output: Resource Link: https://drive.google.com/drive/folders/1vp4TVMTACXblVQM-HGPc1UrqWZoAoRV6?usp=drive_link Designing the Layout <TextView         android:id="@+id/textView"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:text="French Teacher App"         android:textColor="@color/white"         android:textSize="32sp"         app:layout_constraintBottom_toBottomOf="parent"         app:layout_constraintEnd_toEndOf="parent"         app:layout_constraintHorizontal_bias="0.629"         app:layout_constraintStart_toStartOf="parent"         app:layout_constraintTop_toTopOf="parent"         app:layout_constraintVertical_bias="0.311" />     <Button       ...

Widgets

 Activity_main.xml  <CheckBox         android:id="@+id/checkbox1"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_marginTop="4dp"         android:layout_marginEnd="296dp"         android:text="Cheese"         app:layout_constraintEnd_toEndOf="parent"         app:layout_constraintTop_toTopOf="parent" />      <CheckBox         android:id="@+id/checkbox2"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:text="Tomato"         app:layout_constraintStart_toStartOf="@+id/checkbox1"         app:layout_constraintTop_toBottomOf="@+id/checkbox1" />     <Bu...

APP Resources

Image
  Set Background Image: https://drive.google.com/drive/folders/1vp4TVMTACXblVQM-HGPc1UrqWZoAoRV6?usp=drive_link Solid Color Shapes Here's an example of drawing a rounded rectangle with a border in  res/layout/drawable/solid_color_shape.xml : <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android= "http://schemas.android.com/apk/res/android" android:shape= "rectangle" > <corners android:radius= "4dp" /> <stroke android:width= "4dp" android:color= "#C1E1A6" /> <solid android:color= "#118C4E" /> <padding android:left= "20dp" android:top= "20dp" android:right= "20dp" android:bottom= "20dp" /> </shape> and then applied to a TextView using the  background  property: <TextView android:layout_width= "wrap_content" android:layout_height= "wrap_c...

Lucky Number App

Image
 Output: Resource Link:  https://drive.google.com/drive/folders/1vp4TVMTACXblVQM-HGPc1UrqWZoAoRV6?usp=drive_link Main XML: <TextView         android:id="@+id/textView"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:text="Welcome to Lucky Number"         android:textColor="@color/white"         android:textSize="32sp"         app:layout_constraintBottom_toBottomOf="parent"         app:layout_constraintEnd_toEndOf="parent"         app:layout_constraintStart_toStartOf="parent"         app:layout_constraintTop_toTopOf="parent"         app:layout_constraintVertical_bias="0.099" />     <EditText         android:id="@+id/edit_text"         android:layou...

Layout App

 Main Activity  public class MainActivity extends AppCompatActivity {     @Override     protected void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         setContentView(R.layout.activity_main);         // Intents: facilitates communication bet. different components of an app,         //          as well as bet. different applications.         // types of intents:         // 1- Explicit Intents         Button btn = findViewById(R.id.btn);         btn.setOnClickListener(new View.OnClickListener() {             @Override             public void onClick(View v) {                 goToSecondActivity();             }...