SlideShare a Scribd company logo
1 of 20
PORTAFOLIO DE EVIDENCIAS
Maria Lourdes Ramirez Villaseñor
20 DE ABRIL DE 2018
SAHORY ALEJANDRIA CASTAÑEDA RAMIREZ
PROGRAMACION 4G
Practica 1
Lista de Invitados
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:beckground="@android:color/darker_gray">
<TextView
android:text="Lista de Invitados"
android:layout_width="match_parent"
android:layout_height="127dp"
android:background="#4CAF50"
android:textSize="24sp" />
<TextView
android:text="Oswaldo"
android:layout_width="match_parent"
android:layout_height="127dp"
android:background="#4CAF50"
android:textSize="24sp" />
<TextView
android:text="Axel"
android:layout_width="match_parent"
android:layout_height="127dp"
android:background="#4CAF50"
android:textSize="24sp" />
<TextView
android:text="Elian"
android:layout_width="match_parent"
android:layout_height="127dp"
android:background="#4CAF50"
android:textSize="24" />
En estapráctica, aprendía haceruna listade invitadosenandroid,realmenteessorprendente,en
estaprimerapractica me di unaideade como usar LAYOUT.
Proyecto_2“Lista de Invitados”
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:src="@drawable/ocean"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:scaleType="centerCrop" />
<TextView
android:text="You're invited"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight=""
android:textColor="@android:color/white"
android:textSize="54sp"
android:background="#"/>
<TextView
android:text="Bonfire atthe beach"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:textColor="@android:color/white"
android:textSize="34sp"
android:background="#009688"/>
</LinearLayout>
En este proyectome enseñe aponerle colorde fondoala platilla,concódigosytambiénponerlos
temas.
Proyecto 3_
<?xml version="1.0"?>
-<LinearLayoutandroid:layout_height="match_parent"android:layout_width="match_parent"
android:orientation="vertical"xmlns:android="http://schemas.android.com/apk/res/android">
<ImageView android:layout_height="wrap_content"android:layout_width="wrap_content"
android:scaleType="centerCrop"android:layout_weight="1"
android:src="@drawable/fortachon"/>
<TextViewandroid:layout_height="wrap_content"android:layout_width="wrap_content"
android:layout_weight=""android:background="#009688" android:textSize="54sp"
android:textColor="@android:color/white"android:text="You're invited!"/>
<TextViewandroid:layout_height="wrap_content"android:layout_width="wrap_content"
android:layout_weight="0"android:background="#009688" android:textSize="34sp"
android:textColor="@android:color/white"android:text="Bonfire atthe beach"/>
</LinearLayout>
Proyecto4_RELATIVE LAYOUT
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="16dp">
<TextView
android:text="I'm in this corner"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_alignParentBottom="true"
android:layout_lignParentLeft="true" />
<TextView
android:text="No, up here"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_alignParentTop="true"
android:layout_lignParentLeft="true" />
<TextView
android:text="Wait, I'm here"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_alignParentBottom="true"
android:layout_lignParentLeft="true" />
<TextView
android:text="Actually, I'm here"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_alignParentTop="true"
android:layout_lignParentRight="true" />
</RelativeLayout>
En esta práctica aprendí como poner 4 textos diferentes en cuatro esquinas,y fondo blanco,mejore mi
practica con el “Layout”
Proyecto5_ RelativeLayout
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="16dp"
android:background="#f4F356">
<TextView
android:id="@+id/lyla_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:textSize="24sp"
android:text="Lyla"/>
<TextView
android:id="@+id/me_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_toRightOf="@id/lyla_text_view"
android:textSize="24sp"
android:text="Me"/>
<TextView
android:id="@+id/natalie_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="24sp"
android:text="Natalie"/>
<TextView
android:id="@+id/jennie_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:textSize="24sp"
android:text="Jennie"/>
<TextView
android:id="@+id/kagure_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:textSize="24sp"
android:text="Kagure"/>
<TextView
android:id="@+id/amy_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_toLeftOf="@id/jennie_text_view"
android:textSize="24sp"
android:text="Amy"/>
<TextView
android:id="@+id/omoju_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParent="true"
android:layout_above="@id/jennie_text_view"
android:layout_alignParentRight="true"
android:textSize="24sp"
android:text="Omoju"/>
<TextView
android:id="@+id/Ben_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:textSize="24sp"
android:text="Ben"/>
<TextView
android:id="@+id/kunal_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_toLeftOf="@id/Ben_text_view"
android:textSize="24sp"
android:text="Kunal"/>
</RelativeLayout>
Aquí aprendí lo mismo que en la prácticaanterior,pero ahora con color de fondo, para darl eun mejor
diseño..!
Practica 6_IMAGEN
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:layout_margin="10dp"
android:src="@drawable/hi"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:scaleType="centerCrop" />
<TextView
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:text="You're invited"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight=""
android:textColor="@android:color/white"
android:textSize="34sp"
android:background="#009688"/>
<TextView
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="10dp"
android:text="Bonfire at the beach"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0"
android:textColor="@android:color/white"
android:textSize="34sp"
android:background="#009688"/>
</LinearLayout>
Aquí aprendí en vez de color de fondo, poner una imagen de fondo que lancen un mensaje! Arrastrando la
imagen que tenemos guardada en PC mandándola a el programa android studio.
Practica_Constraintlayout en Android
<android.support.constraint.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="com.example.lap_c_pc06.prctica3.MainActivity"
android:background="#A9A9F5">
<ImageView
android:layout_width="119dp"
android:layout_height="160dp"
android:layout_marginBottom="344dp"
android:layout_weight="1"
android:scaleType="centerCrop"
android:src="@drawable/dg"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
android:layout_marginLeft="4dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Bienvenidos"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintHorizontal_bias="0.689"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.134"
tools:textSize="18sp"/>
<TextView
android:id="@+id/textView"
android:layout_width="164dp"
android:layout_height="25dp"
android:text="A laprogramación"
android:textSize="18sp"
app:layout_constraintEnd_toStartOf="@+id/textView2"
app:layout_constraintStart_toStartOf="parent"
tools:ignore="MissingConstraints"
tools:layout_editor_absoluteY="177dp"/>
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="ConAndroid"
android:textSize="18sp"
tools:ignore="MissingConstraints"
tools:layout_editor_absoluteX="258dp"
tools:layout_editor_absoluteY="177dp"/>
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="25dp"
android:layout_marginBottom="8dp"
android:text="Estudiantede Bachillerato"
android:textSize="18sp"
app:layout_constraintBottom_toTopOf="@+id/textView4"
tools:ignore="MissingConstraints"
tools:layout_editor_absoluteX="88dp"/>
<TextView
android:id="@+id/textView4"
android:layout_width="wrap_content"
android:layout_height="31dp"
android:text="Unmundofantásticote espera"
android:textSize="18sp"
tools:ignore="MissingConstraints"
tools:layout_editor_absoluteX="80dp"
tools:layout_editor_absoluteY="243dp"/>
<TextView
android:id="@+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="ConAndroid"
android:textSize="18sp"
tools:ignore="MissingConstraints"
tools:layout_editor_absoluteX="143dp"
tools:layout_editor_absoluteY="274dp"/>
<TextView
android:id="@+id/textView6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Estáspreparado?"
android:textSize="18sp"
tools:ignore="MissingConstraints"
tools:layout_editor_absoluteX="122dp"
tools:layout_editor_absoluteY="321dp"/>
<Button
android:id="@+id/button"
android:layout_width="63dp"
android:layout_height="36dp"
android:text="Off"
tools:ignore="MissingConstraints"
tools:layout_editor_absoluteX="161dp"
tools:layout_editor_absoluteY="369dp"/>
<TextView
android:id="@+id/textView7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Note arrepentirás"
android:textSize="18sp"
tools:ignore="MissingConstraints"
tools:layout_editor_absoluteX="88dp"
tools:layout_editor_absoluteY="455dp"/>
<Button
android:id="@+id/button2"
android:layout_width="73dp"
android:layout_height="40dp"
android:text="SALIR"
tools:layout_editor_absoluteX="295dp"
tools:layout_editor_absoluteY="455dp"
tools:ignore="MissingConstraints"/>
</android.support.constraint.ConstraintLayout>
Aprendí a poner una imagen en algún lado de la esquina,con botones y mensajes distintos queelijamos.
Practica_5 parimpar
package com.example.lap_c_pc06.practica5;
importandroid.support.v7.app.AppCompatActivity;
importandroid.os.Bundle;
importandroid.view.View;
importandroid.widget.EditText;
importandroid.widget.TextView;
publicclassMainActivityextendsAppCompatActivity{
publicEditTextnumero;
publicTextViewresultado;
@Override
protectedvoidonCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
numero= (EditText)findViewById((Integer) R.id.editText_numero);
resultado=(TextView)findViewById(R.id.textView_resultado);
}
publicvoidVerificar(Viewview)
{
intnum;
Stringrespuesta;
num=Integer.parseInt(numero.getText().toString());
if (num%2==0)
respuesta="NumeroPar";
else
respuesta="NumeroImpar";
resultado.setText(respuesta);
}
publicvoidBorrar(View view)
{
numero.setText("");
resultado.setText("");
}
}
<?xml version="1.0"encoding="utf-8"?>
<android.support.constraint.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="com.example.lap_c_pc02.practica5.MainActivity">
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Ingresaunnúmero"
android:textSize="24sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.058"/>
<EditText
android:id="@+id/editText_numero"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:ems="10"
android:inputType="numberDecimal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.503"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.151"/>
<Button
android:id="@+id/button"
android:layout_width="170dp"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:onClick="Verificar"
android:text="determinar"
android:textSize="24sp"
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.302"/>
<TextView
android:id="@+id/textView_resultado"
android:layout_width="127dp"
android:layout_height="49dp"
android:layout_marginBottom="8dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:text="Resultado"
android:textSize="24sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
<Button
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="Borrar"
android:text="BORRAR"
android:textSize="24sp"
tools:layout_editor_absoluteX="254dp"
tools:layout_editor_absoluteY="425dp"/>
</android.support.constraint.ConstraintLayout>
En esta actividad manejamos layouts y botones donde la app nos decía si el numero era par o impar.
Practica4_calculadora
package com.example.lap_c_pc06.practica4;
importandroid.support.v7.app.AppCompatActivity;
importandroid.os.Bundle;
importandroid.view.View;
importandroid.widget.EditText;
publicclassMainActivityextends AppCompatActivity{
public EditTextnumero1,numero2,resultado;
@Override
protectedvoidonCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
numero1=(EditText)findViewById(R.id.edit1);
numero2=(EditText)findViewById(R.id.edit2);
resultado=(EditText)findViewById(R.id.editres);
}
publicvoidoperacionsuma(View view)
{
floatsuma;
floatn1 = Float.parseFloat(numero1.getText().toString());
floatn2 = Float.parseFloat(numero2.getText().toString());
suma=n1 + n2;
resultado.setText(String.valueOf(suma));
}
publicvoidoperacionresta(Viewview)
{
floatresta;
floatn1 = Float.parseFloat(numero1.getText().toString());
floatn2 = Float.parseFloat(numero2.getText().toString());
resta= n1 - n2;
resultado.setText(String.valueOf(resta));
}
publicvoidoperacionmultiplicacion( Viewview)
{
floatmulti;
floatn1 = Float.parseFloat(numero1.getText().toString());
floatn2 = Float.parseFloat(numero2.getText().toString());
multi = n1 * n2;
resultado.setText(String.valueOf(multi));
}
publicvoidoperaciondivision(Viewview)
{
floatdivi;
floatn1 = Float.parseFloat(numero1.getText().toString());
floatn2 = Float.parseFloat(numero2.getText().toString());
divi = n1%n2;
resultado.setText(String.valueOf(divi));
}
}
Aprendi ahacer una calculadoracon“float”,“string”,etc.

Portafolio de evidencias