5

Click here to load reader

Aplicacion android

Embed Size (px)

Citation preview

Page 1: Aplicacion android

UNIVERSIDAD TECNONOLÓGICA DEL ESTADO DE ZACATECAS UNIDAD ACADÉMICA DE PINOS

TECNOLOGÍAS DE LA INFORMACIÓN Y COMUNICACIÓN

Materia

Desarrollo de Aplicaciones III

Tema

Aplicación de agenda.

Nombre completo del Alumno : Enrique Reyes Correa

Grado: 5 Grupo: “B”

Maestro: Eloy Contreras de Lira

Fecha de entrega : 24/03/2014

Page 2: Aplicacion android

UNIVERSIDAD TECNONOLÓGICA DEL ESTADO DE ZACATECAS UNIDAD ACADÉMICA DE PINOS

TECNOLOGÍAS DE LA INFORMACIÓN Y COMUNICACIÓN

En la página principal colocamos el código donde se llaman llamar los

métodos de INSERTAR, ELIMINAR Y MODIFICAR

package proyectagenda.com;

import android.app.Activity;

import android.content.Intent;

import android.os.Bundle;

import android.view.View;

public class AgendaAndroidActivity extends Activity {

/** Called when the activity is first created. */

@Override

public void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.bienvenida); }

public void agregar(View b) {

Intent it=new Intent(this,Nuevo.class);

startActivity(it); }

public void eliminar(View b) {

Intent it=new Intent(this,EliminarContacto.class);

startActivity(it); }

public void modificar(View b) {

Intent it=new Intent(this,Modificar1.class);

startActivity(it); }

public void buscar(View b) {

Intent it=new Intent(this,buscar.class);

startActivity(it); } }

Page 3: Aplicacion android

UNIVERSIDAD TECNONOLÓGICA DEL ESTADO DE ZACATECAS UNIDAD ACADÉMICA DE PINOS

TECNOLOGÍAS DE LA INFORMACIÓN Y COMUNICACIÓN

En el layout en el que estamos se contiene lo de pagina principal que en este

caso es la bienvenida y contiene el siguiente código:

<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

android:orientation="vertical"

android:layout_width="fill_parent"

android:layout_height="fill_parent"

android:background="#AAC1E2"

<LinearLayout

xmlns:android="http://schemas.android.com/apk/res/android"

android:layout_width="fill_parent"

android:layout_height="126dp"

android:gravity="center"

android:orientation="vertical" >

<TextView

android:id="@+id/txBienvenida"

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:gravity="center"

android:textStyle="bold"

android:textSize="25sp"

android:textColor="#000000" android:text="Welcome :)"/>

</LinearLayout>

<TableLayout

xmlns:android="http://schemas.android.com/apk/res/android"

Page 4: Aplicacion android

UNIVERSIDAD TECNONOLÓGICA DEL ESTADO DE ZACATECAS UNIDAD ACADÉMICA DE PINOS

TECNOLOGÍAS DE LA INFORMACIÓN Y COMUNICACIÓN

android:layout_width="fill_parent"

android:layout_height="fill_parent"

android:layout_weight="1" >

<TableRow

android:layout_weight="1"

android:gravity="center"

android:paddingLeft="20px"

android:paddingRight="20px"

android:paddingBottom = "10px" >

<LinearLayout

xmlns:android="http://schemas.android.com/apk/res/android"

android:layout_width="fill_parent"

android:layout_height="fill_parent"

android:layout_weight="1"

android:gravity="center"

android:orientation="vertical"

android:paddingRight="20px" >

<Button

android:layout_width="136dp"

android:layout_height="104dp"

android:layout_weight="0.06"

android:background="@drawable/adduser"

android:onClick="agregar"

android:padding="20px"

Page 5: Aplicacion android

UNIVERSIDAD TECNONOLÓGICA DEL ESTADO DE ZACATECAS UNIDAD ACADÉMICA DE PINOS

TECNOLOGÍAS DE LA INFORMACIÓN Y COMUNICACIÓN

android:drawingCacheQuality="low">

</Button>

<TextView

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:gravity="center"

android:text="Agregar contacto"

android:textColor="#000000"

android:textStyle="bold" />

</LinearLayout>

<LinearLayout

xmlns:android="http://schemas.android.com/apk/res/android"

android:layout_width="fill_parent"

android:layout_height="fill_parent"

android:layout_weight="1"

android:gravity="center"

android:orientation="vertical"

android:paddingLeft="20px" >

<Button

android:layout_width="138dp"

android:layout_height="109dp"

android:layout_weight="0.50"

android:background="@drawable/buscar"

android:onClick="buscar" /> <TextView