



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Document of mobile application development using Android studio - Lab assignments
Typology: Assignments
1 / 7
This page cannot be seen from the preview
Don't miss anything!




<androidx.constraintlayout.widget.ConstraintLayout xmlns: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" tools:context=".MainActivity">
android:id="@+id/e1" android:layout_weight="3" android:textAlignment="center" android:textSize="30dp" tools:ignore="TouchTargetSizeCheck,SpeakableTextPresentCheck" />
android:textAlignment="center" android:textSize="30dp" tools:ignore="TouchTargetSizeCheck,SpeakableTextPresentCheck" />
package com.example.play_cards_lab4; import androidx.appcompat.app.AppCompatActivity;
import java.io.Serializable; import java.util.*; import java.lang.Math; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.TableRow; import android.widget.TextView; import android.widget.Toast; public class MainActivity extends AppCompatActivity { public int[] cards={ 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 }; public ArrayList
TextView e1=findViewById(R.id. e1 ); TextView e2=findViewById(R.id. e2 ); TextView e3=findViewById(R.id. e3 ); TextView e4=findViewById(R.id. e4 ); TextView e5=findViewById(R.id. e5 ); e1.setText(String. valueOf (test.get( 0 ))); e2.setText(String. valueOf (test.get( 1 ))); e3.setText(String. valueOf (test.get( 2 ))); e4.setText(String. valueOf (test.get( 3 ))); e5.setText(String. valueOf (test.get( 4 ))); for(int i= 0 ;i<test.size();i++) { ssum+=test.get(i); } Button reply=findViewById(R.id. button3 ); reply.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Intent i=new Intent(getApplicationContext(),MainActivity.class); i.putExtra("ssum",ssum); i.putIntegerArrayListExtra("list", (ArrayList