How to run database on Android?

Asked

Viewed 1,783 times

1

I’m making an application that connects to a database that is in sao paulo, it serves as a ratchet, checking by QRCODE users card if they are registered or not. It’s just that the company I’m working for makes a lot of trips and controls entry to various places. I received the advice of a friend of mine, that the best would be to download the bank to the tablets instead of connecting to the bank through an internet. The truth is, I’m a little scared about it, because the Internet can make me look bad. But I don’t know methods to run a database on a system android(tablets), someone would know how and if I really should do this?

Note: The internet can be 3G in some places instead of WI-FI

  • Why not use a webservice? Just have a webservice to get the information, your QR-CODE returns a int and you check along with the webservice.

  • But with the webservice, you will need an internet connection?

  • @Rogerscorrêa - I would think about the possibility of downloading the database even to the devices and update when there is connection available, to receive the new data registered.

  • Gave a searched and with a rooteado tablet it is possible to install Mysql. Not pretty or recommended, but in your situation you can help: http://architects.dzone.com/articles/your-own-mysql-database-server

  • 1

    Yes with webservices you need internet! Search for Android Sqlite. Remembering that an experienced user can change this "local bank" by releasing access to any QR-Code, weigh the 2 points.

  • Interesting, but I’ll leave it to the last case.

  • I don’t think that would solve it. Because I would need to be online in the same way.

  • You’d need it, but it would be a small requisition. Your problem in using local bank is that the user changes this data and if you want to block the user from having access to the site, how would you? Would the person have to download their updated list always? And if not downloaded? So it is critical you do this with need to internet connection.

Show 3 more comments

2 answers

2

Hello, your android application could consume a web service, that’s more than common.

Here a tutorial of web service Rest http://www.techrepublic.com/blog/software-engineer/calling-restful-services-from-your-android-app/

Here’s a tutorial on Soap web service http://programmerguru.com/android-tutorial/android-webservice-example/

You could also use sqlite on android, but I think it would be more difficult to download the database of your customers, even unviable. Finally follows links with tutorial application using sqlite(built-in on android, already comes with it)

tutorial sqlite http://www.klebermota.eti.br/2011/02/17/introducao-ao-sqlite-do-android-criando-e-usando-um-banco-de-dados-baseado-em-sqlite3/

another sqlite tutorial http://www.mobiltec.com.br/blog/index.php/android-persistencia-de-dados-usando-sqlite/

I hope to have cooperated!

  • Paul, you say use both, for example, when you don’t have a stable internet use local?

  • It would be a solution, so when the internet was ok you could send the information that is stored locally, so your app could check if it is connected and has data to send, then it could do. would be a way to resolve with contingency!

1

If the problem is internet recommend you to use the same local bank (Android Sqlite), however, as said in the comment an experienced user can change the bank releasing access to other unregistered QR-Code.

You have 2 ways to hinder access to this bank:

  • Encrypt the data
  • Direct database checksum in the app.

With this, even the user changing the bank and discovering the encryption used he will still need to change the app that should be protected with proguard!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.