<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: mushokuuuu</title>
    <description>The latest articles on DEV Community by mushokuuuu (@mushokuuuu).</description>
    <link>https://dev.to/mushokuuuu</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2227730%2F711670cb-b0d1-40fe-bfcc-0de5a756542e.png</url>
      <title>DEV Community: mushokuuuu</title>
      <link>https://dev.to/mushokuuuu</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mushokuuuu"/>
    <language>en</language>
    <item>
      <title>Build Gradle file suppport</title>
      <dc:creator>mushokuuuu</dc:creator>
      <pubDate>Wed, 16 Apr 2025 07:43:03 +0000</pubDate>
      <link>https://dev.to/mushokuuuu/build-gradle-file-suppport-imc</link>
      <guid>https://dev.to/mushokuuuu/build-gradle-file-suppport-imc</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dependencies {
    implementation 'androidx.appcompat:appcompat:1.3.1'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
    implementation 'com.google.android.material:material:1.4.0'
    implementation 'androidx.recyclerview:recyclerview:1.2.1'
    implementation 'androidx.viewpager:viewpager:1.0.0'
    implementation 'androidx.fragment:fragment:1.3.6'
    implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
    implementation 'androidx.sqlite:sqlite:2.1.0'
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Dependencies required for a SQLite application in android studio&lt;/p&gt;

</description>
      <category>android</category>
      <category>java</category>
      <category>xml</category>
    </item>
    <item>
      <title>Database and Fragments 101 for Android Dev</title>
      <dc:creator>mushokuuuu</dc:creator>
      <pubDate>Wed, 16 Apr 2025 07:41:07 +0000</pubDate>
      <link>https://dev.to/mushokuuuu/database-and-fragments-101-for-android-dev-2kf9</link>
      <guid>https://dev.to/mushokuuuu/database-and-fragments-101-for-android-dev-2kf9</guid>
      <description>&lt;p&gt;//activity_ticket_printing.xml&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:padding="16dp"&amp;gt;

    &amp;lt;TextView
        android:id="@+id/ticket_details"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:textSize="18sp" /&amp;gt;

    &amp;lt;Button
        android:id="@+id/back_button"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="Back" /&amp;gt;
&amp;lt;/LinearLayout&amp;gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;//TicketPrintingActivity.java&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class TicketPrintingActivity extends AppCompatActivity {

    private TextView ticketDetailsTextView;
    private Button backButton;

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

        ticketDetailsTextView = findViewById(R.id.ticket_details);
        backButton = findViewById(R.id.back_button);

        // Retrieve ticket details from intent
        Intent intent = getIntent();
        String name = intent.getStringExtra("name");
        String age = intent.getStringExtra("age");
        String date = intent.getStringExtra("date");
        String time = intent.getStringExtra("time");
        String seatType = intent.getStringExtra("seatType");

        // Display ticket details
        String ticketDetails = "Name: " + name + "\nAge: " + age + "\nDate: " + date + "\nTime: " + time + "\nSeat Type: " + seatType;
        ticketDetailsTextView.setText(ticketDetails);

        backButton.setOnClickListener(v -&amp;gt; finish());
    }
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;//fragment_past_bookings.xml&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:padding="16dp"&amp;gt;

    &amp;lt;ListView
        android:id="@+id/past_bookings_list"
        android:layout_width="match_parent"
        android:layout_height="match_parent" /&amp;gt;
&amp;lt;/LinearLayout&amp;gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;//PastBookingsFragment.java&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class PastBookingsFragment extends Fragment {

    private ListView pastBookingsListView;
    private ArrayAdapter&amp;lt;String&amp;gt; adapter;
    private ArrayList&amp;lt;String&amp;gt; pastBookings;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_past_bookings, container, false);

        pastBookingsListView = view.findViewById(R.id.past_bookings_list);
        pastBookings = new ArrayList&amp;lt;&amp;gt;();

        // Retrieve past bookings from SQLite database
        SQLiteDatabase db = getActivity().openOrCreateDatabase("TravelBookingDB", Context.MODE_PRIVATE, null);
        Cursor cursor = db.rawQuery("SELECT * FROM bookings", null);
        while (cursor.moveToNext()) {
            String bookingDetails = "Name: " + cursor.getString(0) + "\nAge: " + cursor.getString(1) + "\nDate: " + cursor.getString(2) + "\nTime: " + cursor.getString(3) + "\nSeat Type: " + cursor.getString(4);
            pastBookings.add(bookingDetails);
        }
        cursor.close();

        adapter = new ArrayAdapter&amp;lt;&amp;gt;(getActivity(), android.R.layout.simple_list_item_1, pastBookings);
        pastBookingsListView.setAdapter(adapter);

        return view;
    }
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;//fragment_profile.xml&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:padding="16dp"&amp;gt;

    &amp;lt;TextView
        android:id="@+id/username_text"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:textSize="18sp" /&amp;gt;

    &amp;lt;Button
        android:id="@+id/logout_button"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="Logout" /&amp;gt;
&amp;lt;/LinearLayout&amp;gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;//ProfileFragment.java&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class ProfileFragment extends Fragment {

    private usernameTextView;
    private Button logoutButton;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_profile, container, false);

        usernameTextView = view.findViewById(R.id.username_text);
        logoutButton = view.findViewById(R.id.logout_button);

        // Retrieve username from shared preferences or intent
        SharedPreferences sharedPreferences = getActivity().getSharedPreferences("UserPrefs", Context.MODE_PRIVATE);
        String username = sharedPreferences.getString("username", "Guest");
        usernameTextView.setText("Username: " + username);

        logoutButton.setOnClickListener(v -&amp;gt; {
            // Handle logout logic here
            SharedPreferences.Editor editor = sharedPreferences.edit();
            editor.clear();
            editor.apply();

            // Navigate back to login/signup activity
            Intent intent = new Intent(getActivity(), LoginSignupActivity.class);
            startActivity(intent);
            getActivity().finish();
        });

        return view;
    }
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>android</category>
      <category>xml</category>
      <category>java</category>
    </item>
    <item>
      <title>A comprehensive how to on Tab layout for android</title>
      <dc:creator>mushokuuuu</dc:creator>
      <pubDate>Wed, 16 Apr 2025 07:35:34 +0000</pubDate>
      <link>https://dev.to/mushokuuuu/a-comprehensive-how-to-on-tab-layout-for-android-54f0</link>
      <guid>https://dev.to/mushokuuuu/a-comprehensive-how-to-on-tab-layout-for-android-54f0</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;//activity_main.xml
&amp;lt;androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"&amp;gt;

    &amp;lt;com.google.android.material.appbar.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"&amp;gt;

        &amp;lt;com.google.android.material.tabs.TabLayout
            android:id="@+id/tab_layout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" /&amp;gt;
    &amp;lt;/com.google.android.material.appbar.AppBarLayout&amp;gt;

   Pager
        android:id="@+id/view_pager"
        android:layout_width="match_parent"
        android:layout_height="match_parent" /&amp;gt;
&amp;lt;/androidx.coordinatorlayout.widget.CoordinatorLayout&amp;gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;//MainActivity.java
public class MainActivity extends AppCompatActivity {

    private TabLayout tabLayout;
    private ViewPager viewPager;

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

        tabLayout = findViewById(R.id.tab_layout);
        viewPager = findViewById(R.id.view_pager);

        tabLayout.addTab(tabLayout.newTab().setText("Purchase Tickets"));
        tabLayout.addTab(tabLayout.newTab().setText("Profile"));
        tabLayout.addTab(tabLayout.newTab().setText("Past Bookings"));

        final PagerAdapter adapter = new PagerAdapter(getSupportFragmentManager(), tabLayout.getTabCount());
        viewPager.setAdapter(adapter);
        viewPager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(tabLayout));

        tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
            @Override
            public void onTabSelected(TabLayout.Tab tab) {
                viewPager.setCurrentItem(tab.getPosition());
            }

            @Override
            public void onTabUnselected(TabLayout.Tab tab) {}

            @Override
            public void onTabReselected(TabLayout.Tab tab) {}
        });
    }
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;//PagerAdapter.java
public class PagerAdapter extends FragmentPagerAdapter {

    private int numOfTabs;

    public PagerAdapter(FragmentManager fm, int numOfTabs) {
        super(fm);
        this.numOfTabs = numOfTabs;
    }

    @Override
    public Fragment getItem(int position) {
        (position) {
            case 0:
                return new PurchaseTicketsFragment();
            case 1:
                return new ProfileFragment();
            case 2:
                return new PastBookingsFragment();
            default:
                return null;
        }
    }

    @Override
    public int getCount() {
        return numOfTabs;
    }
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;//fragment_purchase_tickets.xml
&amp;lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:padding="16dp"&amp;gt;

    &amp;lt;EditText
        android:id="@+id/name"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="Name" /&amp;gt;

    &amp;lt;EditText
        android:id="@+id/age"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="Age"
        android:inputType="number" /&amp;gt;

    &amp;lt;DatePicker
        android:id="@+id/date_picker"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" /&amp;gt;

    &amp;lt;TimePicker
        android:id="@+id/time_picker"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:timePickerMode="spinner" /&amp;gt;

    &amp;lt;Spinner
        android:id="@+id/seat_type_spinner"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:entries="@array/seat_types" /&amp;gt;

    &amp;lt;!-- Add other fields using checkboxes, radio buttons, context menus, and popup menus here --&amp;gt;

    &amp;lt;Button
        android:id="@+id/submit_button"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="Submit" /&amp;gt;
&amp;lt;/LinearLayout&amp;gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;//PurchaseTicketsFragment.java
public class PurchaseTicketsFragment extends Fragment {

    private EditText nameEditText, ageEditText;
    private DatePicker datePicker;
    private TimePicker timePicker;
    private Spinner seatTypeSpinner;
    private Button submitButton;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_purchase_tickets, container, false);

        nameEditText = view.findViewById(R.id.name);
        ageEditText = view.findViewById(R.id.age);
        datePicker = view.findViewById(R.id.date_picker);
        timePicker = view.findViewById(R.id.time_picker);
        seatTypeSpinner = view.findViewById(R.id.seat_type_spinner);
        submitButton = view.findViewById(R.id.submit_button);

        submitButton.setOnClickListener(v -&amp;gt; submitTicket());

        return view;
    }

    private void submitTicket() {
        String name = nameEditText.getText().toString();
        String age = ageEditText.getText().toString();
        String date = datePicker.getDayOfMonth() + "/" + (datePicker.getMonth() + 1) + "/" + datePicker.getYear();
        String time = timePicker.getHour() + ":" + timePicker.getMinute();
        String seatType = seatTypeSpinner.getSelectedItem().toString();

        // Handle ticket submission logic here
        // Navigate to ticket printing activity
        Intent intent = new Intent(getActivity(), TicketPrintingActivity.class);
        intent.putExtra("name", name);
        intent.putExtra("age", age);
        intent.putExtra("date", date);
        intent.putExtra("time", time);
        intent.putExtra("seatType", seatType);
        startActivity(intent);
    }
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;//activity_login_signup.xml&lt;br&gt;
//LoginSignupActivity.java&lt;/p&gt;

</description>
      <category>java</category>
      <category>xml</category>
      <category>android</category>
    </item>
    <item>
      <title>how to implement login signup page for android dev</title>
      <dc:creator>mushokuuuu</dc:creator>
      <pubDate>Wed, 16 Apr 2025 07:29:01 +0000</pubDate>
      <link>https://dev.to/mushokuuuu/how-to-implement-login-signup-page-for-android-dev-3ih5</link>
      <guid>https://dev.to/mushokuuuu/how-to-implement-login-signup-page-for-android-dev-3ih5</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class LoginSignupActivity extends AppCompatActivity {

    private EditText usernameEditText, passwordEditText;
    private Button loginButton, signupButton;
    private SQLiteDatabase db;


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

        usernameEditText = findViewById(R.id.username);
        passwordEditText = findViewById(R.id.password);
        loginButton = findViewById(R.id.login_button);
        signupButton = findViewById(R.id.signup_button);

        // Initialize SQLite database
        db = openOrCreateDatabase("TravelBookingDB", MODE_PRIVATE, null);
        db.execSQL("CREATE TABLE IF NOT EXISTS users(username VARCHAR, password VARCHAR);");

        loginButton.setOnClickListener(v -&amp;gt; login());
        signupButton.setOnClickListener(v -&amp;gt; signup());
    }

    private void login() {
        String username = usernameEditText.getText().toString();
        String password = passwordEditText.getText().toString();
        Cursor cursor = db.rawQuery("SELECT * FROM users WHERE username=? AND password=?", new String[]{username, password});
        if (cursor.getCount() &amp;gt; 0) {
            // Login successful, navigate to next activity
            Intent intent = new Intent(LoginSignupActivity.this, MainActivity.class);
            startActivity(intent);
        } else {
            // Login failed, show error message
            Toast.makeText(this, "Invalid username or password", Toast.LENGTH_SHORT).show();
        }
        cursor.close();
    }

    private void signup() {
        String username = usernameEditText.getText().toString();
        String password = passwordEditText.getText().toString();
        db.execSQL("INSERT INTO users(username, password) VALUES(?, ?);", new Object[]{username, password});
        Toast.makeText(this, "Signup successful", Toast.LENGTH_SHORT).show();
    }
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:padding="16dp"&amp;gt;

    &amp;lt;EditText
        android:id="@+id/username"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="Username" /&amp;gt;

    &amp;lt;EditText
        android:id="@+id/password"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="Password"
        android:inputType="textPassword" /&amp;gt;

    &amp;lt;Button
        android:id="@+id/login_button"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="Login" /&amp;gt;

    &amp;lt;Button
        android:id="@+id/signup_button"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="Signup" /&amp;gt;
&amp;lt;/LinearLayout&amp;gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>login</category>
      <category>java</category>
      <category>xml</category>
      <category>android</category>
    </item>
  </channel>
</rss>
