SlideShare a Scribd company logo
1 of 21
REPORTES DE PRÁCTICAS
 NOMBRE: EmmanuelMontoya Olivas
 GRUPO: 4J
 ESPECIALIDAD:PROGRAMACION
 MAESTRA: MARIA DE LOURDES RAMIREZ VILLASEÑOR
 ESCUELA: CETIS 100
 TURNO: MATUTINO
INDICE
1-Actividad 1: Hola cetis 100………………………………
2-Actividad 2:Lista de invitados…………………………….
3.-Actividad 2: Lista de invitados (Cuadros grandes)…
4-Actividad 2: Lista de invitado (Colores)………………
5-Actividad 3: Invitación……………………………………..
6-Actividad 3 (Invitación completa)………………………...
7-Actividad 3 (Invitación bordes)……………………………
8-Layout1..........................................................................
9-Layout2.........................................................................
10-Calculadora...................................................................
11-Par o impar....................................................................
12-15 botones............................................................
Act 1. Hola cetis 100
Código:
package com.example.holacetis100;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
public class MainActivity extends AppCompatActivity
Button btn_presionar;
TextView texto;
String Mensaje="Hola cetis 100";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); "
setContentView(R.layout.activity_main);
btn_presionar - (Button) findViewById(R.id.boton);
texto - (TextView) findViewById(R.id.textView);
btn_presionar.getOClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
texto.getText(Mensaje);
}
} " PALABRAS CLAVE SUBRAYADAS.
Vista del celular:
CONCLUSION:
Act 2. Lista de invitados
Código: Vista del celular:
<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="@string/lista_de_invitados"
Android:layout_width="wrap_content"
Android:layout_height="wrap_content"
Android:background="#4CAF50"
Android:textSize="24sp" />
<TextView
android:text="@string/Oswaldo"
Android:layout_width="match_parent"
Android:layout_height="wrap_content"
Android:background="#4CAF50"
Android:textSize="24sp" />
<TextView
android:text="@string/axel"
android:layout_width="wrap_content"
Android:layout_height="50dp"
Android:background="#4CAF50" PALABRAS CLAVE SUBRAYADAS.
Android:textSize="24sp" />
<TextView
android:text="@string/Elian"
Android:layout_width="wrap_content"Android:layout_height="wrap_content"
Android:background="#4CAF50"
Android:textSize="24sp />
</LinearLayout
CONCLUSION:
Act 2. Lista de invitados(Cuadros grandes)
Código: Vista del celular:
<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_weight="1.5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#4CAF50"
android:textSize="24sp" />
<TextView
android:text="Oswaldo"
android:layout_weight="1.5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#4CAF50"
android:textSize="24sp" />
<TextView
android:text="Axel"
android:layout_weight="1.5"
android:layout_width="match_parent" PALABRAS CLAVE SUBRAYADAS.
android:layout_height="50dp"
android:background="#4CAF50"
android:textSize="24sp" />
<TextView
android:text="Elian"
android:layout_weight="1.5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#4CAF50"
android;textSize=”24sp”/>
</LinearLayout
CONCLUSION:
Act 2. Lista de invitado (Colores)
Código: Vista del celular:
<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_weight="1.5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#4CAF50"
android:textSize="24sp" />
<TextView
android:text="Oswaldo"
android:layout_weight="1.5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#4CAF50"
android:textSize="24sp" />
<TextView
android:text="Axel"
android:layout_weight="1.5"
PALABRAS CLAVE SUBRAYADAS
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="#4CAF50"
android:textSize="24sp" />
<TextView
android:text="Elian"
android:layout_weight="1.5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="wrap_content"
android:background="#4CAF50"android:textSiz
e="24sp"/>
CONCLUSION:
Act 3. Invitación
Código: :
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="l"
android:background="@drawable/borde"
android:scaleType="fitXY"
android:src="@drawable/por_si_si" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:background="@drawable/borde"
android:text="Bienvenido a mi programa"
android:textColor="@android:color/black"
android:textSize="44sp" />
<TextView
android:layout_width="wrap_content" PALABRAS CLAVE SUBRAYADAS
android:layout_height="wrap_content"
android:layout_weight="20"
android:background="@drawable/borde"
android:text="Espero que le guste"
android:textColor="@android:color/black"
android:textSize="34sp" />
</LinearLayout>
CONCLUSION:
Act 3. (Invitación completa)
Código:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
Android:orientation="vertical"
android:layout_width="wrap_content"
Android:layout_height="wrap_content">
<ImageView
Android:layout_width="421dp"
Android:layout_height="453dp"
Android:layout_weight="1"
android:contentDescription="@string/todo"
Android:scaleType="centerCrop"
android:src="@drawable/por_si_no" />
<TextView
Android:layout_width="343dp"
Android: layout_height="wrap_content"
android:layout_weight="0"
android:background="#009688"
android:text="@string/you_re_invited"
android:textColor="@android:color/white"
android:textSize="54sp" />
<TextView
android:layout_width="314dp"
android:layout_height="wrap_content"
android:layout_weight="1" PALABRAS CLAVE SUBRAYADAS
android:background="#009688"
android:text="@string/bonfire_at_the_beach"
android:textColor="@android:color/white"
android:textSize="34sp" />
</LinearLayout
CONCLUSION:
Act. 3 (Invitación bordes)
Codigo: Vista del celular:
<ImageView
android:layout_width="match_parent"
android:layout_height="412dp"
android:layout_weight="2"
android:background="@drawable/borde"
android:scaleType="fitXY"
android:src="@drawable/f" />
<TextView
android:layout_width="401dp"
android:layout_height="wrap_content"
android:layout_weight="0"
android:background="@drawable/borde"
android:text="you're invited!"
android:textColor="@android:color/black"
android:textSize="44sp" />
<TextView
android:layout_width="399dp"
android:layout_height="41dp"
android:layout_weight="20"
android:background="@drawable/borde"
android:text="bonfire at the beach"
android:textColor="@android:color/black" PALABRAS CLAVE SUBRAYADAS
android:textSize="34sp" />
</LinearLayout>
CONCLUSION:
Layout1
Codigo:
Vista del celular:
CONCLUSION:
Layout 2
Codigo:
CONCLUSION:
Esta actividad me parecio dificil, pero con la ayuda de mis compañeros lo pude comprender
Calculadora
Codigo:
text
<?xml version="1.0" encoding="utf-8"?>
<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:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity"
android:orientation="vertical">
<TextView
android:id="@+id/textView2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Numero 1"
android:textSize="25sp"/>
<EditText
android:id="@+id/editnum1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:hint="Introduce el valor 1"
android:inputType="numberDecimal" />
<TextView
android:id="@+id/textView3"
android:layout_width="match_parent"
CONCLUSION:
Calculadora
android:layout_height="wrap_content"
android:text="Numero 2"
android:textSize="25sp"/>
<EditText
android:id="@+id/editnum2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="numberDecimal"
tools:hint="Introduce el valor 2" />
<Button
android:id="@+id/btnsuma"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="operacionSumar"
android:text="SUMA" />
<Button
android:id="@+id/btnresta"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="operacionResta"
android:text="RESTA" />
<Button
android:id="@+id/btnmultiplicacion"
android:layout_width="match_parent" PALABRAS CLAVE SUBRAYADA
android:layout_height="wrap_content"
android:onClick="operacionMultiplicacion"
Calculadora
android:text="MULTIPLICACION" />
<Button
android:id="@+id/btndivision"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="operacionDivision"
android:text="DIVISION" />
<TextView
android:id="@+id/textView4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Resultado"
android:textSize="25sp"/>
<EditText
android:id="@+id/editnum3" PALABRAS CLAVE SUBRAYADAS
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="numberDecimal"
tools:hint="Resultado aqui" />
</LinearLayout>
java
package com.example.calculadora;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
Calculadora
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.editnum1);
numero2 = (EditText) findViewById(R.id.editnum2);
resultado = (EditText) findViewById(R.id.editnum3);
}
public void operacionSuma(View view)
{
float suma;
float n1 = Float.parseFloat(numero1.getText().toString());
float n2 = Float.parseFloat(numero2.getText().toString());
suma = n1 + n2;
resultado.setText(String.valueOf(suma));
}
public void operacionResta(View view)
{
float resta;
float n1 = Float.parseFloat(numero1.getText().toString());
float n2 = Float.parseFloat(numero2.getText().toString());
resta = n1 - n2;
resultado.setText(String.valueOf(resta));
Par o impar
Codigo:
package com.example.myapplication;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
public class MainActivity extends AppCompatActivity {
public EditText numero;
public TextView resultado;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
numero=(EditText)findViewById(R.id.editText_num);
resultado=(TextView)findViewById(R.id.textView_resultado);
}
public MainActivity(View view){
int num;
String respuesta;
num=Integer.parseInt(numero.getText().toString());
if (num%2==0)
respuesta="Numeropar";
else
respuesta="Numeroimpar";
resultado.setText(respuesta);
}
}
CODIGO:
15 botones
<?xml version="1.0"encoding="utf-8"?>
<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:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".MainActivity">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<Button
android:id="@+id/button14"
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
CODIGO:
15 botones
android:id="@+id/button4"
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/button7"
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/button12"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Button" />
<Button
android:id="@+id/button11"
android:layout_width="match_parent"
15 botones
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/button6"
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/button3"
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" />
15 botones
android:id="@+id/button"
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" />
</LinearLayout>
</ScrollView>
</LinearLayout>
Maestra

More Related Content

More from AlanGodinez19 (20)

Actividad 1.v
Actividad 1.vActividad 1.v
Actividad 1.v
 
Actividad 1.5
Actividad 1.5Actividad 1.5
Actividad 1.5
 
1.3
1.31.3
1.3
 
1.2 diagnostico
1.2 diagnostico1.2 diagnostico
1.2 diagnostico
 
Java
Java Java
Java
 
Cracking
CrackingCracking
Cracking
 
Programa 14
Programa 14Programa 14
Programa 14
 
Programa 13
Programa 13Programa 13
Programa 13
 
Tienda departa
Tienda departaTienda departa
Tienda departa
 
Doc2 taxi
Doc2 taxiDoc2 taxi
Doc2 taxi
 
Doc1 gym
Doc1 gymDoc1 gym
Doc1 gym
 
Oficina d correos
Oficina d correosOficina d correos
Oficina d correos
 
Aeropuerto
AeropuertoAeropuerto
Aeropuerto
 
Ntaion
NtaionNtaion
Ntaion
 
Doc1 tienda d
Doc1 tienda dDoc1 tienda d
Doc1 tienda d
 
dOC
dOCdOC
dOC
 
Tabla SQA
Tabla SQATabla SQA
Tabla SQA
 
Trabajos dev
Trabajos devTrabajos dev
Trabajos dev
 
Ejercicio no.3 empresa
Ejercicio no.3 empresaEjercicio no.3 empresa
Ejercicio no.3 empresa
 
Ejercicio no2 tienda de computo
Ejercicio no2 tienda de computoEjercicio no2 tienda de computo
Ejercicio no2 tienda de computo
 

Maestra

  • 1. REPORTES DE PRÁCTICAS  NOMBRE: EmmanuelMontoya Olivas  GRUPO: 4J  ESPECIALIDAD:PROGRAMACION  MAESTRA: MARIA DE LOURDES RAMIREZ VILLASEÑOR  ESCUELA: CETIS 100  TURNO: MATUTINO
  • 2. INDICE 1-Actividad 1: Hola cetis 100……………………………… 2-Actividad 2:Lista de invitados……………………………. 3.-Actividad 2: Lista de invitados (Cuadros grandes)… 4-Actividad 2: Lista de invitado (Colores)……………… 5-Actividad 3: Invitación…………………………………….. 6-Actividad 3 (Invitación completa)………………………... 7-Actividad 3 (Invitación bordes)…………………………… 8-Layout1.......................................................................... 9-Layout2......................................................................... 10-Calculadora................................................................... 11-Par o impar.................................................................... 12-15 botones............................................................
  • 3. Act 1. Hola cetis 100 Código: package com.example.holacetis100; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.TextView; public class MainActivity extends AppCompatActivity Button btn_presionar; TextView texto; String Mensaje="Hola cetis 100"; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); " setContentView(R.layout.activity_main); btn_presionar - (Button) findViewById(R.id.boton); texto - (TextView) findViewById(R.id.textView); btn_presionar.getOClickListener(new View.OnClickListener() { @Override public void onClick(View v) { texto.getText(Mensaje); } } " PALABRAS CLAVE SUBRAYADAS. Vista del celular: CONCLUSION:
  • 4. Act 2. Lista de invitados Código: Vista del celular: <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="@string/lista_de_invitados" Android:layout_width="wrap_content" Android:layout_height="wrap_content" Android:background="#4CAF50" Android:textSize="24sp" /> <TextView android:text="@string/Oswaldo" Android:layout_width="match_parent" Android:layout_height="wrap_content" Android:background="#4CAF50" Android:textSize="24sp" /> <TextView android:text="@string/axel" android:layout_width="wrap_content" Android:layout_height="50dp" Android:background="#4CAF50" PALABRAS CLAVE SUBRAYADAS. Android:textSize="24sp" /> <TextView android:text="@string/Elian" Android:layout_width="wrap_content"Android:layout_height="wrap_content" Android:background="#4CAF50" Android:textSize="24sp /> </LinearLayout CONCLUSION:
  • 5. Act 2. Lista de invitados(Cuadros grandes) Código: Vista del celular: <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_weight="1.5" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="#4CAF50" android:textSize="24sp" /> <TextView android:text="Oswaldo" android:layout_weight="1.5" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="#4CAF50" android:textSize="24sp" /> <TextView android:text="Axel" android:layout_weight="1.5" android:layout_width="match_parent" PALABRAS CLAVE SUBRAYADAS. android:layout_height="50dp" android:background="#4CAF50" android:textSize="24sp" /> <TextView android:text="Elian" android:layout_weight="1.5" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="#4CAF50" android;textSize=”24sp”/> </LinearLayout CONCLUSION:
  • 6. Act 2. Lista de invitado (Colores) Código: Vista del celular: <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_weight="1.5" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="#4CAF50" android:textSize="24sp" /> <TextView android:text="Oswaldo" android:layout_weight="1.5" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="#4CAF50" android:textSize="24sp" /> <TextView android:text="Axel" android:layout_weight="1.5" PALABRAS CLAVE SUBRAYADAS android:layout_width="match_parent" android:layout_height="50dp" android:background="#4CAF50" android:textSize="24sp" /> <TextView android:text="Elian" android:layout_weight="1.5" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_height="wrap_content" android:background="#4CAF50"android:textSiz e="24sp"/> CONCLUSION:
  • 7. Act 3. Invitación Código: : <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <ImageView android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="l" android:background="@drawable/borde" android:scaleType="fitXY" android:src="@drawable/por_si_si" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="0" android:background="@drawable/borde" android:text="Bienvenido a mi programa" android:textColor="@android:color/black" android:textSize="44sp" /> <TextView android:layout_width="wrap_content" PALABRAS CLAVE SUBRAYADAS android:layout_height="wrap_content" android:layout_weight="20" android:background="@drawable/borde" android:text="Espero que le guste" android:textColor="@android:color/black" android:textSize="34sp" /> </LinearLayout> CONCLUSION:
  • 8. Act 3. (Invitación completa) Código: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" Android:orientation="vertical" android:layout_width="wrap_content" Android:layout_height="wrap_content"> <ImageView Android:layout_width="421dp" Android:layout_height="453dp" Android:layout_weight="1" android:contentDescription="@string/todo" Android:scaleType="centerCrop" android:src="@drawable/por_si_no" /> <TextView Android:layout_width="343dp" Android: layout_height="wrap_content" android:layout_weight="0" android:background="#009688" android:text="@string/you_re_invited" android:textColor="@android:color/white" android:textSize="54sp" /> <TextView android:layout_width="314dp" android:layout_height="wrap_content" android:layout_weight="1" PALABRAS CLAVE SUBRAYADAS android:background="#009688" android:text="@string/bonfire_at_the_beach" android:textColor="@android:color/white" android:textSize="34sp" /> </LinearLayout CONCLUSION:
  • 9. Act. 3 (Invitación bordes) Codigo: Vista del celular: <ImageView android:layout_width="match_parent" android:layout_height="412dp" android:layout_weight="2" android:background="@drawable/borde" android:scaleType="fitXY" android:src="@drawable/f" /> <TextView android:layout_width="401dp" android:layout_height="wrap_content" android:layout_weight="0" android:background="@drawable/borde" android:text="you're invited!" android:textColor="@android:color/black" android:textSize="44sp" /> <TextView android:layout_width="399dp" android:layout_height="41dp" android:layout_weight="20" android:background="@drawable/borde" android:text="bonfire at the beach" android:textColor="@android:color/black" PALABRAS CLAVE SUBRAYADAS android:textSize="34sp" /> </LinearLayout> CONCLUSION:
  • 11. Layout 2 Codigo: CONCLUSION: Esta actividad me parecio dificil, pero con la ayuda de mis compañeros lo pude comprender
  • 12. Calculadora Codigo: text <?xml version="1.0" encoding="utf-8"?> <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:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity" android:orientation="vertical"> <TextView android:id="@+id/textView2" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="Numero 1" android:textSize="25sp"/> <EditText android:id="@+id/editnum1" android:layout_width="match_parent" android:layout_height="wrap_content" android:ems="10" android:hint="Introduce el valor 1" android:inputType="numberDecimal" /> <TextView android:id="@+id/textView3" android:layout_width="match_parent" CONCLUSION:
  • 13. Calculadora android:layout_height="wrap_content" android:text="Numero 2" android:textSize="25sp"/> <EditText android:id="@+id/editnum2" android:layout_width="match_parent" android:layout_height="wrap_content" android:ems="10" android:inputType="numberDecimal" tools:hint="Introduce el valor 2" /> <Button android:id="@+id/btnsuma" android:layout_width="match_parent" android:layout_height="wrap_content" android:onClick="operacionSumar" android:text="SUMA" /> <Button android:id="@+id/btnresta" android:layout_width="match_parent" android:layout_height="wrap_content" android:onClick="operacionResta" android:text="RESTA" /> <Button android:id="@+id/btnmultiplicacion" android:layout_width="match_parent" PALABRAS CLAVE SUBRAYADA android:layout_height="wrap_content" android:onClick="operacionMultiplicacion"
  • 14. Calculadora android:text="MULTIPLICACION" /> <Button android:id="@+id/btndivision" android:layout_width="match_parent" android:layout_height="wrap_content" android:onClick="operacionDivision" android:text="DIVISION" /> <TextView android:id="@+id/textView4" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="Resultado" android:textSize="25sp"/> <EditText android:id="@+id/editnum3" PALABRAS CLAVE SUBRAYADAS android:layout_width="match_parent" android:layout_height="wrap_content" android:ems="10" android:inputType="numberDecimal" tools:hint="Resultado aqui" /> </LinearLayout> java package com.example.calculadora; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.EditText;
  • 15. Calculadora 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.editnum1); numero2 = (EditText) findViewById(R.id.editnum2); resultado = (EditText) findViewById(R.id.editnum3); } public void operacionSuma(View view) { float suma; float n1 = Float.parseFloat(numero1.getText().toString()); float n2 = Float.parseFloat(numero2.getText().toString()); suma = n1 + n2; resultado.setText(String.valueOf(suma)); } public void operacionResta(View view) { float resta; float n1 = Float.parseFloat(numero1.getText().toString()); float n2 = Float.parseFloat(numero2.getText().toString()); resta = n1 - n2; resultado.setText(String.valueOf(resta));
  • 16. Par o impar Codigo: package com.example.myapplication; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.EditText; import android.widget.TextView; public class MainActivity extends AppCompatActivity { public EditText numero; public TextView resultado; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); numero=(EditText)findViewById(R.id.editText_num); resultado=(TextView)findViewById(R.id.textView_resultado); } public MainActivity(View view){ int num; String respuesta; num=Integer.parseInt(numero.getText().toString()); if (num%2==0) respuesta="Numeropar"; else respuesta="Numeroimpar"; resultado.setText(respuesta); } } CODIGO:
  • 17. 15 botones <?xml version="1.0"encoding="utf-8"?> <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:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" tools:context=".MainActivity"> <ScrollView android:layout_width="match_parent" android:layout_height="match_parent"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <Button android:id="@+id/button14" 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 CODIGO:
  • 18. 15 botones android:id="@+id/button4" 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/button7" 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/button12" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="Button" /> <Button android:id="@+id/button11"
  • 19. android:layout_width="match_parent" 15 botones 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/button6" 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/button3" 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"
  • 20. android:text="Button" /> 15 botones android:id="@+id/button" 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" /> </LinearLayout> </ScrollView> </LinearLayout>