Este documento presenta los pasos para crear una aplicación en Android que realiza operaciones aritméticas básicas. Explica cómo insertar widgets como radio buttons, text views y text fields, y cómo escribir código Java para recuperar los valores ingresados y realizar sumas y restas dependiendo de la opción seleccionada. Advierta que es importante revisar cuidadosamente la acción del botón para evitar errores que impidan la ejecución del programa.
I mashed together two great slidshare presentations: http://www.slideshare.net/babineals/tessellating-patterns and http://www.slideshare.net/katjankows/tessellation-3555687
This talk will present a novel technique for the rendering of surfaces covered with fallen deformable snow featured in Batman: Arkham Origins. Scalable from current generation consoles to high-end PCs, as well as next-generation consoles, the technique allows for visually convincing and organically interactive deformable snow surfaces everywhere characters can stand/walk/fight/fall, is extremely fast, has a low memory footprint, and can be used extensively in an open world game. We will explain how this technique is novel in its approach of acquiring arbitrary deformation, as well as present all the details required for implementation. Moreover, we will share the results of our collaboration with NVIDIA, and how it allowed us to bring this technique to the next level on PC using DirectX 11 tessellation.
I mashed together two great slidshare presentations: http://www.slideshare.net/babineals/tessellating-patterns and http://www.slideshare.net/katjankows/tessellation-3555687
This talk will present a novel technique for the rendering of surfaces covered with fallen deformable snow featured in Batman: Arkham Origins. Scalable from current generation consoles to high-end PCs, as well as next-generation consoles, the technique allows for visually convincing and organically interactive deformable snow surfaces everywhere characters can stand/walk/fight/fall, is extremely fast, has a low memory footprint, and can be used extensively in an open world game. We will explain how this technique is novel in its approach of acquiring arbitrary deformation, as well as present all the details required for implementation. Moreover, we will share the results of our collaboration with NVIDIA, and how it allowed us to bring this technique to the next level on PC using DirectX 11 tessellation.
1. OPERACIONES ARITMETICAS
CETIS 109
YAMARY SÁNCHEZ RAMOS
EMILIANO GONZÁLEZ MÉNDEZ
CARLOS SAMUEL GUTIÉRREZ RODRÍGUEZ
JUAN ALBERTO DE JESÚS GARCÍA VÁZQUEZ
4° DM PROGRAMACION
MARGARITA ROMERO ALVARADO
2. PASO 1:
• Primero empezamos un nuevo
Android Aplication Proyect y
ponemos el nombre que
gusten.
3. PASO 2:
Insertamos un relative layout
Después radio group y
automáticamente aparecerán 3
radio button, borramos 1
porque solo ocuparemos 2
después agregamos un botón
que se llame CALCULAR,
después agregamos tres
textview
Se llamaran DAME UN
NUMERO, DAME OTRO
NUMERO y resultado, y por su
puesto 2 textfields debajo de
los 2 primeros textview.
4. PASO 3:
• Debemos ir a Package
Explorer para poder abrir
MainActivity en el cual se
encuentra nuestro código
5. package com.example.programa5;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.RadioButton;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle
savedInstanceState) {
super.onCreate(savedInstan
ceState);
setContentView(R.layout.acti
vity_main);
}
@Override
public boolean
onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds
items to the action bar if it is present.
getMenuInflater().inflate(R.m
enu.main, menu);
return true;
}
public void operar(View view) {
EditText
et1=(EditText)findViewById(R.id.et1);
EditText
et2=(EditText)findViewById(R.id.et2);
TextView
tv3=(TextView)findViewById(R.id.tv3);
RadioButton
radio0=(RadioButton)findViewById(R.id.radio0);
RadioButton
radio1=(RadioButton)findViewById(R.id.radio1);
int
nro1=Integer.parseInt(et1.getText().toString());
int
nro2=Integer.parseInt(et2.getText().toString());
if (radio0.isChecked()==true) {
int suma=nro1+nro2;
String resu=String.valueOf(suma);
tv3.setText(resu);
} else
if (radio1.isChecked()==true) {
int resta=nro1-nro2;
String resu=String.valueOf(resta);
tv3.setText(resu);
}
}
}
7. PASO 5:
• Ahora guardamos todos los cambios
para poder hacer el siguiente paso
8. PASO 6:
• Por ultimo corremos el programa yendo
a la carpeta que esta en package
Explorer y le damos Run As y en nuestra
primera opción para poder abrir el
emulador y correr nuestra aplicación
para poder hacer las pruebas y LISTO!!
Terminamos.
9. CONCLUSIÓN:
• Existe un error en la acción del
botón que hay que prestarle
mucha acción porque ese
simple error puede perjudicar
todo el programa y no correrá y
se cerrara automáticamente.
Carlos Samuel Gutiérrez Rodríguez 4DM