Titulo
|
Proy01 Lista de Invitados
|
Código
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> android:background="@android:color/darker_gray"/> <TextView android:text="Lista de Invitados" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="#4CAF50" android:textSize="24sp"/> <TextView android:text="Oswaldo" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="#4CAF50" android:textSize="24sp"/> <TextView android:text="Axel" android:layout_width="wrap_content" android:layout_height="50dp" android:background="#4CAF50" android:textSize="24sp"/> <TextView android:text="Elian" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="#4CAF50" android:textSize="24sp"/> </LinearLayout> |
Captura
|
|
Conclusión
|
Al ser el primer programa tuve dificultades para
comprender el código, pero con esta actividad supe cómo se hacía para hacer
que un texto abarcara toda la pantalla aunque esta se gire.
|
Proy02 Lista de Invitados
|
|
Código
|
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@android:color/darker_gray"> <TextView android:text="Lista de Invitados" android:layout_width="match_parent" android:layout_weight="1" android:background="#4CAF50" android:textSize="24sp"/> <TextView android:text="Oswaldo" android:layout_width="match_parent" android:layout_weight="1" android:background="#4CAF50" android:textSize="24sp"/> <TextView android:text="Axel" android:layout_width="match_parent" android:layout_weight="1" android:background="#4CAF50" android:textSize="24sp"/> <TextView android:text="Elian" android:layout_width="match_parent" android:layout_weight="1" android:background="#4CAF50" android:textSize="24sp"/> </LinearLayout> |
Captura
|
|
Conclusión
|
Este programa sirvió para dar proporción a los elementos de la aplicación para que sin importar el tamaño del móvil sea visible. |
Titulo
|
Proy03 Insertar Imagen
|
Código
|
<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/palmeras" 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="match_parent" android:layout_height="wrap_content" android:layout_weight="" android:TextColor="@android:color/blue" android:textSize="54sp" android:background="#009688"/> <TextView 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> |
Captura
|
|
Conclusión
|
Este programa sirvió para saber cómo insertar imágenes
|
Titulo
|
Proy04 Relative Layout
|
Código
|
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:paradding="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_alignParentLeft="true"/> <TextView android:text="No, up here" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_alignParentTop="true" android:layout_alignParentLeft="true"/> <TextView android:text="wait, I'm here" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_alignParentBottom="true" android:layout_alignParentRight="true"/> <TextView android:text="Actually, I'm here" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_alignParentTop="true" android:layout_alignParentRight="true"/> </RelativeLayout> |
Captura
|
|
Conclusión
|
Este programa sirvió para saber cómo Ajustar la alineación
del texto.
|
Titulo
|
Proy05 Relative Layout
|
Código
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <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/ben_text_view" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:textSize="24sp" android:textAlignment="center" android:text="Ben"/> <TextView android:id="@+id/Kunal_text_view" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_toLeftOf="@id/ben_text_view" android:textSize="24sp" android:text="Kunal"/> <TextView android:id="@+id/kagure_text_view" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:textSize="24sp" android:text="Kagure"/> <TextView android:id="@+id/omoju_text_view" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_above="@id/jennie_text_view" android:layout_alignParentRight="true" android:textSize="24sp" android:text="Omoju"/> <TextView android:id="@+id/amy_text_view" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_toLeftOf="@id/jennie_text_view" android:layout_alignParentBottom="true" android:textSize="24sp" android:text="Amy"/> </RelativeLayout> |
Captura
|
|
Conclusión
|
Este programa sirvió para poder poner un texto al lado,
arriba o debajo de otro texto
|
Titulo
|
Proy06 imagen
|
Código
|
<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="match_parent" android:layout_height="wrap_content" android:layout_weight="1" android:scaleType="centerCrop" android:layout_margin="20dp"/> <TextView android:text="You're Invited!" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="" android:TextColor="@android:color/blue" android:layout_marginLeft="20dp" android:layout_marginRight="20dp" android:textSize="54sp" android:background="#009688"/> <TextView 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" android:layout_margin="20dp"/> </LinearLayout>
|
Captura
|
|
Conclusión
|
Este programa sirvió para poder poner una imagen y un
texto con márgenes blancos.
|
Titulo
|
Practica2
|
Código
|
<LinearLayout 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:id="@+id/botones" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" tools:context="com.example.lab_c_pc_39.myapplication_scrollnoseque.MainActivity"> <ScrollView android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:layout_weight="1"> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:layout_weight="1"> <Button android:id="@+id/button1" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="Button"/> <Button android:id="@+id/button2" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="Button"/> <Button android:id="@+id/button3" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="Button" /> <Button android:id="@+id/button4" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="Button"/> <Button android:id="@+id/button5" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="Button"/> <Button android:id="@+id/button6" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="Button" /> <Button android:id="@+id/button7" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="Button"/> <Button android:id="@+id/button8" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="Button"/> <Button android:id="@+id/button9" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="Button"/> <Button android:id="@+id/button10" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="Button" /> <Button android:id="@+id/button11" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="Button"/> <Button android:id="@+id/button12" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="Button"/> <Button android:id="@+id/button13" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="Button"/> <Button android:id="@+id/button14" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="Button"/> <Button android:id="@+id/button15" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="Button"/> <Button android:id="@+id/button16" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="Button"/> <Button android:id="@+id/button17" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="Button android:layout_weight="1"/> <Button android:id="@+id/button18" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="Button"/> <Button android:id="@+id/button19" android:layout_width="match_parent" android:layout_height="wrap_conten" android:text="Button"/> <Button android:id="@+id/button20" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="Button"/> </LinearLayout> </ScrollView> <HorizontalScrollView android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1"> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal"> <Button android:id="@+id/button21" android:layout_width="wrap_content" android:layout_height="match_parent" android:text="Button" /> <Button android:id="@+id/button22" android:layout_width="wrap_content" android:layout_height="match_parent" android:text="Button" /> <Button android:id="@+id/button23" android:layout_width="wrap_content" android:layout_height="match_parent" android:text="Button" /> <Button android:id="@+id/button24" android:layout_width="wrap_content" android:layout_height="match_parent" android:text="Button" /> <Button android:id="@+id/button25" android:layout_width="wrap_content" android:layout_height="match_parent" android:text="Button" /> <Button android:id="@+id/button26" android:layout_width="wrap_content" android:layout_height="match_parent" android:text="Button" /> <Button android:id="@+id/button27" android:layout_width="wrap_content" android:layout_height="match_parent" android:text="Button" /> <Button android:id="@+id/button28" android:layout_width="wrap_content" android:layout_height="match_parent" android:text="Button" /> <Button android:id="@+id/button29" android:layout_width="wrap_content" android:layout_height="match_parent" android:text="Button" /> <Button android:id="@+id/button30" android:layout_width="wrap_content" android:layout_height="match_parent" android:text="Button" /> <Button android:id="@+id/button31" android:layout_width="wrap_content" android:layout_height="match_parent" android:text="Button" /> <Button android:id="@+id/button32" android:layout_width="wrap_content" android:layout_height="match_parent" android:text="Button" /> <Button android:id="@+id/button33" android:layout_width="wrap_content" android:layout_height="match_parent" android:text="Button" /> <Button android:id="@+id/button34" android:layout_width="wrap_content" android:layout_height="match_parent" android:text="Button" /> <Button android:id="@+id/button35" android:layout_width="wrap_content" android:layout_height="match_parent" android:text="Button" /> <Button android:id="@+id/button36" android:layout_width="wrap_content" android:layout_height="match_parent" android:text="Button" /> <Button android:id="@+id/button37" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_weight="1" android:text="Button" /> <Button android:id="@+id/button38" android:layout_width="wrap_content" android:layout_height="match_parent" android:text="Button" /> <Button android:id="@+id/button39" android:layout_width="wrap_content" android:layout_height="match_parent" android:text="Button" /> <Button android:id="@+id/button40" android:layout_width="wrap_content" android:layout_height="match_parent" android:text="Button" /> </LinearLayout> </HorizontalScrollView> </LinearLayout> |
Captura
|
|
Conclusión
|
Este programa se me ha dificultado un poco porque no
sabia como hacer que un se deslizara horizontalmente y verticalmente en una misma
pantalla.
|
Titulo
|
Practica4
|
Código
|
<?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_pc40.nose.MainActivity"> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <TextView android:id="@+id/textView" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="Numero1" android:textColor="#000000" android:textSize="30sp" /> <EditText android:id="@+id/num1" android:layout_width="match_parent" android:layout_height="wrap_content" android:ems="10" android:hint="Ingresa un numero" android:inputType="numberDecimal" android:textColor="@android:color/darker_gray" android:textSize="18sp" /> <TextView android:id="@+id/textView2" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="Numero2" android:textColor="#000000" android:textSize="30sp" /> <EditText android:id="@+id/num2" android:layout_width="match_parent" android:layout_height="wrap_content" android:ems="10" android:hint="Ingresa un numero" android:inputType="numberDecimal" android:textColor="@android:color/darker_gray" android:textSize="18sp" /> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <Button android:id="@+id/sum" android:layout_width="match_parent" android:layout_height="wrap_content" android:backgroundTint="@android:color/holo_green_dark" android:onClick="suma" android:text="Suma" /> <Button android:id="@+id/res" android:layout_width="match_parent" android:layout_height="wrap_content" android:backgroundTint="@android:color/holo_green_dark" android:onClick="res" android:text="Resta" /> <Button android:id="@+id/mul" android:layout_width="match_parent" android:layout_height="wrap_content" android:backgroundTint="@android:color/holo_green_dark" android:onClick="mult" android:text="Multiplicacion" /> <Button android:id="@+id/div" android:layout_width="match_parent" android:layout_height="wrap_content" android:backgroundTint="@android:color/holo_green_dark" android:onClick="div" android:text="Division" /> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <TextView android:id="@+id/textView3" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="Resultado" android:textColor="@android:color/black" android:textSize="30sp" /> <EditText android:id="@+id/r" android:layout_width="match_parent" android:layout_height="wrap_content" android:ems="10" android:inputType="numberDecimal" android:textColor="@android:color/black" android:textSize="24sp" /> </LinearLayout> </LinearLayout> </LinearLayout> </android.support.constraint.ConstraintLayout>
package com.example.lap_c_pc39.MyApplication;
import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.EditText; public class MainActivity extends AppCompatActivity { public EditText numero1, numero2, resultado; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); numero1=(EditText)findViewById(R.id.num1); numero2=(EditText)findViewById(R.id.num2); resultado=(EditText)findViewById(R.id.r); } public void suma (View view) { float n1= Float.parseFloat(numero1.getText().toString()); float n2= Float.parseFloat(numero2.getText().toString()); float sum= n1 + n2; resultado.setText(String.valueOf(sum)); } public void res (View view) { float n1= Float.parseFloat(numero1.getText().toString()); float n2= Float.parseFloat(numero2.getText().toString()); float sum= n1 - n2; resultado.setText(String.valueOf(sum)); } public void mult (View view) { float n1= Float.parseFloat(numero1.getText().toString()); float n2= Float.parseFloat(numero2.getText().toString()); float sum= n1 * n2; resultado.setText(String.valueOf(sum)); } public void div (View view) { float n1= Float.parseFloat(numero1.getText().toString()); float n2= Float.parseFloat(numero2.getText().toString()); float sum= n1 / n2; resultado.setText(String.valueOf(sum)); |
Captura
|
|
Conclusión
|
Este programa fue un poco mas avanzado que los anteriores
pues este ya realizaba acciones.
|










No hay comentarios.:
Publicar un comentario