Git Product home page Git Product logo

carcontrol's Introduction

¡Hola! 👋, bienvenido a mis repositorios.

banner

Apasionado de la tecnología y la informática. Aprendiendo continuamente programación y realizando pequeños proyectos. A los 9 años comenzó mi pasión con pequeños programas en Basic en un Commodore 16. Desde entonces no he podido parar de aprender.Me encanta "picar código" y las nuevas tecnologías.

Técnico Superior en Desarrollo de Aplicaciones Multiplataforma.

Repositorios

En este GitHUb, podrás encontrar los trabajos que he ido realizando durante el curso del Ciclo Superior DAM; así como proyectos libres

Lenguajes y plataformas, practicándolos y mejorando: 👨‍💻

HTML5 Java CSS3 JavaScript php Android Swift C

Bases de datos : 📂

MySQL Oracle php

PORTFOLIO.

Algunas apps y webs que he creado o en las que he participado.

  1. VETS WebImagen

Estadísticas y otros datos

Top Langs Anurag's GitHub stats

carcontrol's People

Contributors

jsenen avatar

Watchers

 avatar

carcontrol's Issues

Solución relación 1:N COCHES:REPOSTAJES

LA relación entre los coches guardados y los repostases realizados ha pasado por incluir una clase foránea en Fuel.class con el id de Cars.class.
`@Entity(tableName = "repostajes",
foreignKeys = @foreignkey(entity = Cars.class,
parentColumns = "register",
childColumns = "idFuelCar"))

public class Fuel {
@PrimaryKey
@nonnull
private String idFuelCar;
@ColumnInfo
private float price;
@ColumnInfo
private float litres;
Y una clase intermedia CarsWithFuel entre las dos claves:public class CarsWithFuel {

@Embedded
public Cars cars;

@Relation(entity = Fuel.class, parentColumn = "register", entityColumn = "idFuelCar", projection = {"litres"})

public List<Float> litresByCar;

}
Finalmente en el FuelDAO se ha añadido la consulta según la matricula recibida.@dao
public interface FuelDAO {

@Query("SELECT * FROM repostajes WHERE idFuelCar = :matricula")
List<Fuel>  getFuelByCar(String matricula);

@Query("SELECT * FROM repostajes")
List<Fuel> getAll();`

Con los cambios pertinentes en el Adapter del RecycledView, se le pasa con un intent la matrícula para que la recoja la activity:
`Intent intent = getIntent();
matricula = intent.getStringExtra("register");
if (matricula == null)
return;
fuelList = new ArrayList<>();

    // Cargo los detalles de la tarea
    final AppDatabase db = Room.databaseBuilder(this, AppDatabase.class, DATABASE_NAME)
            .allowMainThreadQueries().build();
    fuelList = db.fuelDAO().getFuelByCar(matricula);`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.