-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
empezando con android
- Loading branch information
Showing
42 changed files
with
1,692 additions
and
293 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
84 changes: 84 additions & 0 deletions
84
ClienteSocketAndroid/app/src/main/java/Modelos/Alquiler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
/* | ||
* To change this license header, choose License Headers in Project Properties. | ||
* To change this template file, choose Tools | Templates | ||
* and open the template in the editor. | ||
*/ | ||
package Modelos; | ||
|
||
import java.io.Serializable; | ||
import java.time.LocalDate; | ||
import java.time.LocalTime; | ||
|
||
/** | ||
* | ||
* @author DAM2 | ||
*/ | ||
public class Alquiler implements Serializable { | ||
|
||
public int id; | ||
public Pista p; | ||
public Usuario usu; | ||
public LocalTime horaInicio, horaFin; | ||
public LocalDate dia; | ||
|
||
public Alquiler(Pista p, Usuario usu, LocalTime horaInicio, LocalTime horaFin, LocalDate dia) { | ||
this.p = p; | ||
this.usu = usu; | ||
this.horaInicio = horaInicio; | ||
this.horaFin = horaFin; | ||
this.dia = dia; | ||
} | ||
|
||
public Alquiler() { | ||
|
||
} | ||
|
||
public int getId() { | ||
return id; | ||
} | ||
|
||
public void setId(int id) { | ||
this.id = id; | ||
} | ||
|
||
public Pista getP() { | ||
return p; | ||
} | ||
|
||
public void setP(Pista p) { | ||
this.p = p; | ||
} | ||
|
||
public Usuario getUsu() { | ||
return usu; | ||
} | ||
|
||
public void setUsu(Usuario usu) { | ||
this.usu = usu; | ||
} | ||
|
||
public LocalTime getHoraInicio() { | ||
return horaInicio; | ||
} | ||
|
||
public void setHoraInicio(LocalTime horaInicio) { | ||
this.horaInicio = horaInicio; | ||
} | ||
|
||
public LocalTime getHoraFin() { | ||
return horaFin; | ||
} | ||
|
||
public void setHoraFin(LocalTime horaFin) { | ||
this.horaFin = horaFin; | ||
} | ||
|
||
public LocalDate getDia() { | ||
return dia; | ||
} | ||
|
||
public void setDia(LocalDate dia) { | ||
this.dia = dia; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
|
||
package Modelos; | ||
|
||
import java.io.Serializable; | ||
|
||
/** | ||
* | ||
* @author DAM2 | ||
*/ | ||
public class Pista implements Serializable { | ||
|
||
public int id, num; | ||
public String tipo; | ||
|
||
public Pista(int id, int num, String tipo) { | ||
this.id = id; | ||
this.num = num; | ||
this.tipo = tipo; | ||
} | ||
|
||
public Pista() { | ||
|
||
} | ||
|
||
public int getId() { | ||
return id; | ||
} | ||
|
||
public void setId(int id) { | ||
this.id = id; | ||
} | ||
|
||
public int getNum() { | ||
return num; | ||
} | ||
|
||
public void setNum(int num) { | ||
this.num = num; | ||
} | ||
|
||
public String getTipo() { | ||
return tipo; | ||
} | ||
|
||
public void setTipo(String tipo) { | ||
this.tipo = tipo; | ||
} | ||
|
||
} |
27 changes: 27 additions & 0 deletions
27
ClienteSocketAndroid/app/src/main/java/Modelos/Protocolo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package Modelos; | ||
|
||
public interface Protocolo { | ||
final String LOG = "LOG"; | ||
|
||
final String INSERTAR_USUARIO = "INSERTARUSUARIO"; | ||
final String INSERTAR_ALQUILER = "INSERTARALQUILER"; | ||
final String INSERTAR_PISTAS = "LISTARPISTAS"; | ||
|
||
final String ACTUALIZAR_USUARIO = "ACTUALIZARUSUARIO"; | ||
final String ACTUALIZAR_ALQUILER = "ACTUALIZARALQUILER"; | ||
final String ACTUALIZAR_PISTAS = "LISTARPISTAS"; | ||
|
||
final String BORRAR_USUARIO = "BORRARUSUARIO"; | ||
final String BORRAR_ALQUILER = "BORRARALQUILER"; | ||
final String BORRAR_PISTAS = "BORRARPISTAS"; | ||
|
||
final String LISTAR_USUARIO = "LISTARUSUARIO"; | ||
final String LISTAR_ALQUILER = "LISTARALQUILER"; | ||
final String LISTAR_PISTA = "LISTARPISTA"; | ||
|
||
final String LISTAR_USUARIOS = "LISTARUSUARIOS"; | ||
final String LISTAR_ALQUILERES = "LISTARALQUILERES"; | ||
final String LISTAR_PISTAS = "LISTARPISTAS"; | ||
|
||
final String SALIR = "SALIR"; | ||
} |
178 changes: 178 additions & 0 deletions
178
ClienteSocketAndroid/app/src/main/java/Modelos/Usuario.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,178 @@ | ||
/* | ||
* To change this license header, choose License Headers in Project Properties. | ||
* To change this template file, choose Tools | Templates | ||
* and open the template in the editor. | ||
*/ | ||
package Modelos; | ||
|
||
import java.io.Serializable; | ||
import java.time.LocalDate; | ||
|
||
public class Usuario implements Serializable{ | ||
private int id; | ||
private String usuario; | ||
private String contrasena; | ||
private boolean admin; | ||
private String correoRecuperacion; | ||
private String nombre; | ||
private String apellidos; | ||
private int tlf; | ||
private String sexo; | ||
private LocalDate nacimiento; | ||
private String pais; | ||
private String comunidadAutonoma; | ||
private String provincia; | ||
private String ciudad; | ||
private String domicilio; | ||
|
||
public Usuario(){ | ||
|
||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "Usuario:\n" + "id=" + id + "\n, usuario=" + usuario + "\n, contrase\u00f1a=" + contrasena + "\n, admin=" + admin + "\n" | ||
+ ", correoRecuperacion=" + correoRecuperacion + "\n, nombre=" + nombre + "\n, apellidos=" + apellidos + "\n" | ||
+ ", tlf=" + tlf + "\n, sexo=" + sexo + "\n, nacimiento=" + nacimiento + "\n, pais=" + pais + "\n" | ||
+ ", comunidadAutonoma=" + comunidadAutonoma + "\n, provincia=" + provincia + "\n, ciudad=" + ciudad + "\n, domicilio=" + domicilio; | ||
} | ||
|
||
public Usuario(int id, String usuario, String contrasena, boolean admin, String correoRecuperacion, String nombre, String apellidos, int tlf, String sexo, LocalDate nacimiento, String pais, String comunidadAutonoma, String provincia, String ciudad, String domicilio) { | ||
this.id = id; | ||
this.usuario = usuario; | ||
this.contrasena = contrasena; | ||
this.admin = admin; | ||
this.correoRecuperacion = correoRecuperacion; | ||
this.nombre = nombre; | ||
this.apellidos = apellidos; | ||
this.tlf = tlf; | ||
this.sexo = sexo; | ||
this.nacimiento = nacimiento; | ||
this.pais = pais; | ||
this.comunidadAutonoma = comunidadAutonoma; | ||
this.provincia = provincia; | ||
this.ciudad = ciudad; | ||
this.domicilio = domicilio; | ||
} | ||
|
||
public int getId() { | ||
return id; | ||
} | ||
|
||
public void setId(int id) { | ||
this.id = id; | ||
} | ||
|
||
public String getUsuario() { | ||
return usuario; | ||
} | ||
|
||
public void setUsuario(String usuario) { | ||
this.usuario = usuario; | ||
} | ||
|
||
public String getContrasena() { | ||
return contrasena; | ||
} | ||
|
||
public void setContrasena(String contrasena) { | ||
this.contrasena = contrasena; | ||
} | ||
|
||
public boolean getAdmin() { | ||
return admin; | ||
} | ||
|
||
public void setAdmin(boolean admin) { | ||
this.admin = admin; | ||
} | ||
|
||
public String getCorreoRecuperacion() { | ||
return correoRecuperacion; | ||
} | ||
|
||
public void setCorreoRecuperacion(String correoRecuperacion) { | ||
this.correoRecuperacion = correoRecuperacion; | ||
} | ||
|
||
public String getNombre() { | ||
return nombre; | ||
} | ||
|
||
public void setNombre(String nombre) { | ||
this.nombre = nombre; | ||
} | ||
|
||
public String getApellidos() { | ||
return apellidos; | ||
} | ||
|
||
public void setApellidos(String apellidos) { | ||
this.apellidos = apellidos; | ||
} | ||
|
||
public int getTlf() { | ||
return tlf; | ||
} | ||
|
||
public void setTlf(int tlf) { | ||
this.tlf = tlf; | ||
} | ||
|
||
public String getSexo() { | ||
return sexo; | ||
} | ||
|
||
public void setSexo(String sexo) { | ||
this.sexo = sexo; | ||
} | ||
|
||
public LocalDate getNacimiento() { | ||
return nacimiento; | ||
} | ||
|
||
public void setNacimiento(LocalDate nacimiento) { | ||
this.nacimiento = nacimiento; | ||
} | ||
|
||
public String getPais() { | ||
return pais; | ||
} | ||
|
||
public void setPais(String pais) { | ||
this.pais = pais; | ||
} | ||
|
||
public String getComunidadAutonoma() { | ||
return comunidadAutonoma; | ||
} | ||
|
||
public void setComunidadAutonoma(String comunidadAutonoma) { | ||
this.comunidadAutonoma = comunidadAutonoma; | ||
} | ||
|
||
public String getProvincia() { | ||
return provincia; | ||
} | ||
|
||
public void setProvincia(String provincia) { | ||
this.provincia = provincia; | ||
} | ||
|
||
public String getCiudad() { | ||
return ciudad; | ||
} | ||
|
||
public void setCiudad(String ciudad) { | ||
this.ciudad = ciudad; | ||
} | ||
|
||
public String getDomicilio() { | ||
return domicilio; | ||
} | ||
|
||
public void setDomicilio(String domicilio) { | ||
this.domicilio = domicilio; | ||
} | ||
|
||
} |
Oops, something went wrong.