todas las apps
TRANSCRIPT
![Page 1: Todas las apps](https://reader035.vdocuments.pub/reader035/viewer/2022062523/58ee709d1a28ab8f068b45e1/html5/thumbnails/1.jpg)
Tutorial de como hacer operaciones fáciles en eclipse ( Java)
CARLO SAMUEL GUTIÉRREZ RODRÍGUEZYAMARY SANCHEZ RAMOS
EMILIANO GONZÁLEZ MÉNDEZJUAN ALBERTO GARCÍA VÁZQUEZ
CETIS 109MARGARITA ROMERO ALVARADO
4°D PROGRAMACIÓN
![Page 2: Todas las apps](https://reader035.vdocuments.pub/reader035/viewer/2022062523/58ee709d1a28ab8f068b45e1/html5/thumbnails/2.jpg)
Primero abrimos eclipse
![Page 3: Todas las apps](https://reader035.vdocuments.pub/reader035/viewer/2022062523/58ee709d1a28ab8f068b45e1/html5/thumbnails/3.jpg)
Le damos a file/new/Android Application Project
![Page 4: Todas las apps](https://reader035.vdocuments.pub/reader035/viewer/2022062523/58ee709d1a28ab8f068b45e1/html5/thumbnails/4.jpg)
En esta ventana solo pondremos como queremos que se llame el programa
![Page 5: Todas las apps](https://reader035.vdocuments.pub/reader035/viewer/2022062523/58ee709d1a28ab8f068b45e1/html5/thumbnails/5.jpg)
En estas ventanas solo le daremos siguiente
En estas solo le daremos finish
![Page 6: Todas las apps](https://reader035.vdocuments.pub/reader035/viewer/2022062523/58ee709d1a28ab8f068b45e1/html5/thumbnails/6.jpg)
Aparecerá esta pantaña y borraremos lo que dice «Hi world»
![Page 7: Todas las apps](https://reader035.vdocuments.pub/reader035/viewer/2022062523/58ee709d1a28ab8f068b45e1/html5/thumbnails/7.jpg)
Luego arrastramos donde dice TextView a la pantalla del celular
Despues le damos click y aparecerá esto en la parte inferior derecha
Nos posicionamos en Id y después de @+id/(aquí le pondremos solamente) “tv1”, y donde dice text alado le pondremos “Dame el primer numero” y guardar.
Nota: Esto se hace 2 veces.
![Page 8: Todas las apps](https://reader035.vdocuments.pub/reader035/viewer/2022062523/58ee709d1a28ab8f068b45e1/html5/thumbnails/8.jpg)
Luego nos vamos a la pestaña que dice Text Fields/Plain text, y lo ponemos alado de donde pusimos el TextView.
Nos vamos ala parte donde dice en Properties y nos situamos en Id y le ponemos “@+id/et1” nada más.
Nota: Esto se hace 2 veces.
![Page 9: Todas las apps](https://reader035.vdocuments.pub/reader035/viewer/2022062523/58ee709d1a28ab8f068b45e1/html5/thumbnails/9.jpg)
Nos vamos a la parte donde dice Button y lo arrastramos a la pantalla.
En Id “le pondremos dividir” y luego en Text “Dividir” y buscamos la opción donde dice On Click y le pondremos “dividir”.
![Page 10: Todas las apps](https://reader035.vdocuments.pub/reader035/viewer/2022062523/58ee709d1a28ab8f068b45e1/html5/thumbnails/10.jpg)
Otra vez hacemos lo mismo con TextView, también cambiamos el Id por “tv3” y Text ponemos “Resultado”
![Page 11: Todas las apps](https://reader035.vdocuments.pub/reader035/viewer/2022062523/58ee709d1a28ab8f068b45e1/html5/thumbnails/11.jpg)
Luego iremos ala parte superior izquierda y selecionamos la pestaña que dice src/com.example.divisiondedosnumeros/le damos doble click en MainActivity.java
Aparecerá esta pantalla
![Page 12: Todas las apps](https://reader035.vdocuments.pub/reader035/viewer/2022062523/58ee709d1a28ab8f068b45e1/html5/thumbnails/12.jpg)
A la mitad de estos corchetes pondremos el siguiente código
![Page 13: Todas las apps](https://reader035.vdocuments.pub/reader035/viewer/2022062523/58ee709d1a28ab8f068b45e1/html5/thumbnails/13.jpg)
import android.os.Bundle;import android.app.Activity;import android.view.Menu;import android.view.View;import android.widget.EditText;import android.widget.TextView; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); }@Override public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } public void dividir View view) { EditText et1=(EditText)findViewById(R.id.et1); EditText et2=(EditText)findViewById(R.id.et2); TextView tv3=(TextView)findViewById(R.id.tv3); int nro1=Integer.parseInt(et1.getText().toString()); int nro2=Integer.parseInt(et2.getText().toString()); int dividir=nro1/nro2; tv3.setText(String.valueOf(dividir)); }}
Código
![Page 14: Todas las apps](https://reader035.vdocuments.pub/reader035/viewer/2022062523/58ee709d1a28ab8f068b45e1/html5/thumbnails/14.jpg)
Así aparecerá el código
![Page 15: Todas las apps](https://reader035.vdocuments.pub/reader035/viewer/2022062523/58ee709d1a28ab8f068b45e1/html5/thumbnails/15.jpg)
Le damos click derecho ala carpeta y nos saldrá esto y luego le damos a “Run As/Android Application” Aparecerá
esta pantalla y le damos a OK
![Page 16: Todas las apps](https://reader035.vdocuments.pub/reader035/viewer/2022062523/58ee709d1a28ab8f068b45e1/html5/thumbnails/16.jpg)
Abrirá esta pantalla que es el emulador y del Android, y dejamos que carge.
Y se abrirá automáticamente la aplicación y listo.
![Page 17: Todas las apps](https://reader035.vdocuments.pub/reader035/viewer/2022062523/58ee709d1a28ab8f068b45e1/html5/thumbnails/17.jpg)
Conclusión
Carlos Samuel Gutierrez Rodriguez 4°DM PG.
En el mundo de la programación se pueden hacer cosas tanto complicadas como sencillas y este es un buen ejemplo de un programa sencillo, útil y practico.