LaSalleApp La Salle School Application ENTER User Password Iniciar Sesión Lista de estudiantes Boletín de calificaciones "> LaSalleApp La Salle School Application ENTER User Password Iniciar Sesión Lista de estudiantes Boletín de calificaciones ">

Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lasalle-App Tecnología Móvil.

Similar presentations


Presentation on theme: "Lasalle-App Tecnología Móvil."— Presentation transcript:

1 Lasalle-App Tecnología Móvil

2 String Code <?xml version="1.0" encoding="utf-8"?>
<resources> <string name="app_name">LaSalleApp</string> <string name="line1">La Salle</string> <string name="line2">School Application</string> <string name="button1">ENTER</string> <string name="txtuser">User</string> <string name="txtpass">Password</string> <string name="button2">Iniciar Sesión</string> <string name="txtlista">Lista de estudiantes</string> <string name="txtnotas">Boletín de calificaciones</string> </resources>

3 Main Design Code <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android=" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" <TextView android:textAppearance="?android:attr/textAppearanceLarge" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="100dp" android:layout_marginTop="150dp" android:layout_gravity="center_horizontal" /> android:textAppearance="?android:attr/textAppearanceMedium" android:textSize="35dp" <Button /> </LinearLayout>

4 Login Design Code <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android=" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" android:minWidth="25px" android:minHeight="25px" android:paddingLeft="10dp" android:paddingRight="10dp"> <TextView android:textAppearance="?android:attr/textAppearanceLarge" android:layout_height="wrap_content" android:layout_marginTop="150dp" /> <EditText android:inputType="text Address" /> /> android:inputType="textPassword" /> <Button /> </LinearLayout>

5 Lista Design Code <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android=" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" <ImageButton android:layout_width="150dp" android:layout_height="150dp" android:layout_gravity="center_horizontal" android:foregroundTintMode="src_over" android:scaleType="centerCrop" /> <TextView android:textAppearance="?android:attr/textAppearanceLarge" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="10dp" /> <ListView android:minWidth="25px" android:minHeight="25px" /> </LinearLayout>

6 Notas Design Code <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android=" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" android:minWidth="25px" android:minHeight="25px"> <TextView android:textAppearance="?android:attr/textAppearanceLarge" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:textSize="30dp" /> <GridView android:layout_width="fill_parent" android:layout_height="fill_parent" android:columnWidth="120dp" android:numColumns="auto_fit" android:verticalSpacing="10dp" android:horizontalSpacing="10dp" android:stretchMode="columnWidth" android:gravity="center" /> </LinearLayout>

7 Agregando la funcionalidad

8 Agregar el servicio web

9 Main Design Code using Android.App; using Android.Widget;
using Android.OS; using Android.Content; namespace LaSalleApp { [Activity(Label = "LaSalleApp", MainLauncher = true)] public class MainActivity : Activity Button btnenter; protected override void OnCreate(Bundle savedInstanceState) base.OnCreate(savedInstanceState); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); btnenter = (Button)FindViewById(Resource.Id.button1); btnenter.Click += Btnenter_Click; } private void Btnenter_Click(object sender, System.EventArgs e) Intent i = new Intent(this, typeof(ActivityLogin)); StartActivity(i);

10 Login Design Code using System; using System.Collections.Generic;
using System.Linq; using System.Text; using Android.App; using Android.Content; using Android.OS; using Android.Runtime; using Android.Views; using Android.Widget; namespace LaSalleApp { [Activity(Label = "ActivityLogin")] public class ActivityLogin : Activity EditText , pass; Button btnlogin; protected override void OnCreate(Bundle savedInstanceState) base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.Login); = (EditText)FindViewById(Resource.Id.editText1); pass = (EditText)FindViewById(Resource.Id.editText2); btnlogin = (Button)FindViewById(Resource.Id.button1); btnlogin.Click += Btnlogin_Click; } private void Btnlogin_Click(object sender, EventArgs e) com.somee.escuelasolis.LaSalleWS servicio = new com.somee.escuelasolis.LaSalleWS(); if(servicio.login( .Text,pass.Text)) Intent i = new Intent(this, typeof(ActivityLista)); //pasamos el valor del al siguiente activity Intent.PutExtra(" ", .Text); StartActivity(i); else Toast.MakeText(this, "No valido", ToastLength.Short).Show();

11 Lista Design Code using System; using System.Collections.Generic;
using System.Linq; using System.Text; using Android.App; using Android.Content; using Android.OS; using Android.Runtime; using Android.Views; using Android.Widget; namespace LaSalleApp { [Activity(Label = "ActivityLista")] public class ActivityLista : Activity string ; ListView lista; List<com.somee.escuelasolis.Alumno> alumnos; protected override void OnCreate(Bundle savedInstanceState) base.OnCreate(savedInstanceState); // Create your application here SetContentView(Resource.Layout.Lista); = Intent.GetStringExtra(" "); com.somee.escuelasolis.LaSalleWS servicio = new com.somee.escuelasolis.LaSalleWS(); alumnos = servicio.AlumnoByTutor( ).ToList(); lista = (ListView)FindViewById(Resource.Id.listView1); lista.Adapter = new AdapterAlumno(this, alumnos); lista.ItemClick += Lista_ItemClick; } private void Lista_ItemClick(object sender, AdapterView.ItemClickEventArgs e) Intent i = new Intent(this, typeof(ActivityNotas)); i.PutExtra("carnet", alumnos[e.Position].Carnet); StartActivity(i);

12 AdapterAlumno Code using System; using System.Collections.Generic;
using System.Linq; using System.Text; using Android.App; using Android.Content; using Android.OS; using Android.Runtime; using Android.Views; using Android.Widget; using Java.Lang; namespace LaSalleApp { class AdapterAlumno : BaseAdapter Activity Context; List<com.somee.escuelasolis.Alumno> Lista = new List<com.somee.escuelasolis.Alumno>(); public override int Count => Lista.Count; public AdapterAlumno(Activity Context,List<com.somee.escuelasolis.Alumno> Lista) this.Lista = Lista; this.Context = Context; } public override Java.Lang.Object GetItem(int position) throw new NotImplementedException(); public override long GetItemId(int position) return position; public override View GetView(int position, View convertView, ViewGroup parent) var item = Lista[position]; View view = convertView; // re-use an existing view, if one is available if (view == null) // otherwise create a new one view = Context.LayoutInflater.Inflate(Android.Resource.Layout.SimpleListItemActivated2, null); view.FindViewById<TextView>(Android.Resource.Id.Text1).Text = item.Nombre+" "+item.Nombre; view.FindViewById<TextView>(Android.Resource.Id.Text2).Text = item.Carnet; return view;

13 Notas Design Code using System; using System.Collections.Generic;
using System.Linq; using System.Text; using Android.App; using Android.Content; using Android.OS; using Android.Runtime; using Android.Views; using Android.Widget; namespace LaSalleApp { [Activity(Label = "ActivityNotas")] public class ActivityNotas : Activity GridView grid; int id; List<com.somee.escuelasolis.Nota> Notas; protected override void OnCreate(Bundle savedInstanceState) base.OnCreate(savedInstanceState); // Create your application here SetContentView(Resource.Layout.Notas); id = Intent.GetIntExtra("carnet",0); com.somee.escuelasolis.LaSalleWS servicio = new com.somee.escuelasolis.LaSalleWS(); Notas=servicio.NotasByAlumno(id).ToList(); grid = (GridView)FindViewById(Resource.Id.gridView1); grid.Adapter = new AdapterNota(Notas, this); }

14 AdapterNota Code using System; using System.Collections.Generic;
using System.Linq; using System.Text; using Android.App; using Android.Content; using Android.OS; using Android.Runtime; using Android.Views; using Android.Widget; using Java.Lang; using LaSalleApp.com.somee.escuelasolis; namespace LaSalleApp { class AdapterNota : BaseAdapter List<com.somee.escuelasolis.Nota> Lista=new List<com.somee.escuelasolis.Nota>(); Activity Context; public AdapterNota(List<Nota> lista, Activity context) Lista = lista; Context = context; } public override int Count => Lista.Count(); public override Java.Lang.Object GetItem(int position) throw new NotImplementedException(); public override long GetItemId(int position) return position; public override View GetView(int position, View convertView, ViewGroup parent) var item = Lista[position]; View view = convertView; // re-use an existing view, if one is available if (view == null) // otherwise create a new one view = Context.LayoutInflater.Inflate(Resource.Layout.ItemNota, null); view.FindViewById<TextView>(Resource.Id.textView1).Text = item.Asignatura; view.FindViewById<TextView>(Resource.Id.textView2).Text = item.Cal.ToString(); return view;


Download ppt "Lasalle-App Tecnología Móvil."

Similar presentations


Ads by Google