0

I am new with Android and I have project, the project is for supermarkets customers can pay for foods by only scan the QR code, it is university project not real one, the problem is I want a database which contain information about the item (name price ...) and contain QR code for each Item so we can print this QR code and put it in the item in the demo, so can I found database contain these or I need to create one?

And for QR code I found API for QR generator but who can I attach each QR code with the rest of information (name, price)? Do you have any another solution for this project ? I use Android Studio.

halfer
  • 19,824
  • 17
  • 99
  • 186
sarah
  • 31
  • 2
  • 7
  • Some kind of unique id must be associated with each product and also stored in database. That unique id must be used to generate qr code for each product. – Saurav Kumar Sep 18 '19 at 19:43
  • you need to break this down into steps. 1) do you k now how to connect to a db? 2) do you know how to post information to the databse? 3) do you know how to create a custom QR code? this is what I would do. each item in the database will have an ID. when you create a QR code, have that QR code reach a specific item by their ID. you can use DeepLinks (google this). With a custom scheme you will be able to scan the QR code, load the app, make a request to your API to retrive the information from the QR. – letsCode Sep 18 '19 at 19:57

1 Answers1

0

First item: You have to learn how to use Gradle. Gradle is a project manager. It allow you to install libraries in your project.

Second item: the origin of the data: The native database in android is SQLite. These days android has nice libraries to store data one is called Room and the other Realm. Room allow you to abstract from SQL queries. You can use Room or Realm by data models and interfaces.

Third item: "A QR code is like a graphic representation of a String", so for your QR code in your dat base you should have a simple varchar column, and do not worry about the qr code belong from "a graphic".

Fourth item: please, try to read: Android QRCode Scanner Library to find some qr code reader library which adapt better to your app.

So can I found database contain these or I need to create one? you need to create one, try to find some good example easy to adapt to your project.

who can I attach each QR code with the rest of information (name, price)? you can attach each QR code with the id of the product so this part will be more stable as the time goes by.

Do you have any another solution for this project ? I don't know the whole process you only describe the part when you pick up the Qr. The "right" payment process depends on which payment gateway your country have. I hope you have a good professor.

Final advice item: Pay special attention on permissions: https://developer.android.com/reference/android/Manifest.permission#CAMERA. Even though you are not going to take pictures, you will use the camera to read wild QRs.

halfer
  • 19,824
  • 17
  • 99
  • 186