Lasalle-App Tecnología Móvil.

Slides:



Advertisements
Similar presentations
Android Form Elements. Views Provide common UI functionality Form elements: text area, button, radio button, checkbox, dropdown list, etc. Date and time.
Advertisements

Cosc 4730 Android TabActivity and ListView. TabActivity A TabActivity allows for multiple “tabs”. – Each Tab is it’s own activity and the “root” activity.
ANDROID – INTERFACE AND LAYOUT L. Grewe. Interfaces: Two Alternatives Code or XML  You have two ways you can create the interface(s) of your Application.
Package org.androidtown.database.query; import android.app.Activity; import android.content.Context; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase;
Mobile Programming Lecture 6
CHAP 10. 고급 위젯. © 2012 생능출판사 All rights reserved 어댑터 뷰 어댑터 뷰 (AdapterView) 는 배열이나 파일, 데이터 베이스에 저장된 데이터를 화면에 표시할 때 유용한 뷰.
로봇 전화번호부 4/4 UNIT 12 로봇 SW 콘텐츠 교육원 조용수. 학습 목표 뷰 홀더 패턴을 사용할 수 있다. 토스트를 사용할 수 있다. 클릭 이벤트를 처리할 수 있다. 2.
1/29/ Android Programming: FrameLayout By Dr. Ramji M. Makwana Professor and Head, Computer Engineering Department A.D. Patel.
ListView.
Android - Broadcast Receivers
Import import android.graphics.Bitmap; import android.widget.ImageView;
로봇 모니터링 1/2 UNIT 20 로봇 SW 콘텐츠 교육원 조용수. 학습 목표 Message Queue Handler 2.
1 Introducing Activity and Intent. 2 Memory LinearLayout, weight=2 LinearLayout, weight=1 TextView ListView.
Copyright© Jeffrey Jongko, Ateneo de Manila University Custom ListAdapters.
ListView and ExpandableListView
Android and s Ken Nguyen Clayton state University 2012.
아주대학교 LifecareScienceLAB Android Seminar 3 rd class Android Software Development 2011/05/04 – p.m. 06:00 – 팔달관 409 호 아주대학교.
Android 基本 I/O. 基本 I/O 介面元件 在此節中主要介紹常見的 I/O 使用者介 面元件 – Button, TextView, 以及 EditText , 學習者可以學會: – Android 的視窗表單設計 res/layout/main.xml – Android SDK –
CMPE419 Mobile Application Development Asst.Prof.Dr.Ahmet Ünveren SPRING Computer Engineering Department Asst.Prof.Dr.Ahmet Ünveren
CMPE419 Mobile Application Development Asst.Prof.Dr.Ahmet Ünveren SPRING Computer Engineering Department Asst.Prof.Dr.Ahmet Ünveren
Lab7 – Appendix.
Lecture 3 Zablon Ochomo Android Layouts Lecture 3 Zablon Ochomo
Android Introduction Hello World
CS499 – Mobile Application Development
Android Layouts 8 May 2018 S.RENUKADEVI/AP/SCD/ANDROID LAYOUTS 1.
Android N Amanquah.
UNIT 11 로봇 전화번호부 3/4 로봇 SW 콘텐츠 교육원 조용수.
GUI Programming Fundamentals
Further android gui programming
Mobile Software Development for Android - I397
Android Introduction Hello World.
Android Notifications
Tashkent Weather ANDROID CLUB 2015.
Android Widgets 1 7 August 2018
Android Introduction Hello Views Part 1.
Android – Read/Write to External Storage
HNDIT2417 Mobile Application Development
Android Introduction Hello Views Part 2.
CIS 470 Mobile App Development
CS323 Android Model-View-Controller Architecture
Android Programming Lecture 6
CIS 470 Mobile App Development
CIS 470 Mobile App Development
CIS 470 Mobile App Development
CIS 470 Mobile App Development
Android Sensor Programming
CMPE419 Mobile Application Development
CA16R405 - Mobile Application Development (Theory)
CMPE419 Mobile Application Development
BMI Android Application will take weight and height from the users to calculate Body Mass Index (BMI) with the information, whether user is underweight,
Android Developer Fundamentals V2 Lesson 4
滑動 建國科技大學 資管系 饒瑞佶.
CIS 470 Mobile App Development
CIS 470 Mobile App Development
CIS 470 Mobile App Development
CIS 470 Mobile App Development
CMPE419 Mobile Application Development
Adding Components to Activity
Korea Software HRD Center
CMPE419 Mobile Application Development
CMPE419 Mobile Application Development
BLP 4216 MOBİL UYGULAMA GELİŞTİRME-2
CMPE419 Mobile Application Development
Android Play YouTuBe 建國科技大學 資管系 饒瑞佶 2017/10 V1.
Android Sensor Programming
Android Sensor Programming
CIS 694/EEC 693 Android Sensor Programming
Android Sensor Programming
CIS 694/EEC 693 Android Sensor Programming
CIS 694/EEC 693 Android Sensor Programming
Presentation transcript:

Lasalle-App Tecnología Móvil

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>

Main Design Code <?xml version="1.0" encoding="utf-8"?> <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/holo_blue_dark"> <TextView android:text="@string/line1" android:textAppearance="?android:attr/textAppearanceLarge" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/textView1" android:textSize="100dp" android:layout_marginTop="150dp" android:layout_gravity="center_horizontal" /> android:text="@string/line2" android:textAppearance="?android:attr/textAppearanceMedium" android:id="@+id/textView2" android:textSize="35dp" <Button android:text="@string/button1" android:id="@+id/button1" /> </LinearLayout>

Login Design Code <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" android:minWidth="25px" android:minHeight="25px" android:background="@android:color/holo_purple" android:paddingLeft="10dp" android:paddingRight="10dp"> <TextView android:text="@string/txtuser" android:textAppearance="?android:attr/textAppearanceLarge" android:layout_height="wrap_content" android:id="@+id/textView1" android:layout_marginTop="150dp" /> <EditText android:inputType="textEmailAddress" android:id="@+id/editText1" android:drawableLeft="@android:drawable/sym_def_app_icon" /> android:text="@string/txtpass" android:id="@+id/textView2" /> android:inputType="textPassword" android:id="@+id/editText2" android:drawableLeft="@android:drawable/ic_menu_view" /> <Button android:text="@string/button2" android:id="@+id/button1" android:drawableLeft="@android:drawable/ic_lock_lock" /> </LinearLayout>

Lista Design Code <?xml version="1.0" encoding="utf-8"?> <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/holo_blue_dark"> <ImageButton android:src="@android:drawable/sym_def_app_icon" android:layout_width="150dp" android:layout_height="150dp" android:id="@+id/imageButton1" android:layout_gravity="center_horizontal" style="@style/XamarinDesignerCustomAppliedTheme" android:foregroundTintMode="src_over" android:background="@android:color/background_light" android:scaleType="centerCrop" /> <TextView android:text="@string/txtlista" android:textAppearance="?android:attr/textAppearanceLarge" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/textView1" android:layout_marginTop="10dp" /> <ListView android:minWidth="25px" android:minHeight="25px" android:id="@+id/listView1" /> </LinearLayout>

Notas Design Code <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" android:minWidth="25px" android:minHeight="25px"> <TextView android:text="@string/txtnotas" android:textAppearance="?android:attr/textAppearanceLarge" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/textView1" 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" android:id="@+id/gridView1" /> </LinearLayout>

Agregando la funcionalidad

Agregar el servicio web http://escuelasolis.somee.com/lasalle/LaSalleWS.asmx

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);

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 email, pass; Button btnlogin; protected override void OnCreate(Bundle savedInstanceState) base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.Login); email = (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(email.Text,pass.Text)) Intent i = new Intent(this, typeof(ActivityLista)); //pasamos el valor del email al siguiente activity Intent.PutExtra("email", email.Text); StartActivity(i); else Toast.MakeText(this, "No valido", ToastLength.Short).Show();

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 email; 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); email = Intent.GetStringExtra("email"); com.somee.escuelasolis.LaSalleWS servicio = new com.somee.escuelasolis.LaSalleWS(); alumnos = servicio.AlumnoByTutor(email).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);

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;

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); }

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;