I have a question regarding my app. While I was doing search for sqlite database concepts and advantages, I found that SQLite is serverless or you don't have to deal with server when you using it.
My question is, if SQLite is serverless, how two or more devices can share information in my app between them without server?
By wanting to share anything between devices you are creating a server/client scenario. i.e. Something is served from one device to a client, the other device.
SQLite is probably not the ideal solution as there is no client-server aspect included, so you'd have to write you own server and client code, which would very likely not be at all simple.
Firebase could be the simplest solution as it's a single SDK and is hosted/served by Google. This link - Add Firebase to Your Android Project - may be of interest
Related
I am new to multi-device development in Delphi and I have a basic VCL background. I have worked with multiple projects that use locally stored databases for their functions etc.
Coding is a hobby and I want to learn more about mobile app development for personal usage. I am busy writing a simple application that serves as a scoring system for a card game that we invented. I am currently using SQLite local database to store data.
I am now looking for a way to have a single database that multiple devices can access so that any one of our android smartphones can run the application and interact with the data in that database.
At this stage, I don't really have extensive knowledge about what I am talking about and I want some advice regarding this problem. Is a single database the best solution? Is there perhaps a different approach?
I am familiar with basic FireDac syntax (TFDConnection, TFDQuery, and TFDTable), so I would prefer maybe keeping a FireDac infrastructure if possible.
I would prefer the solution to not be too complicated :)
I do hope that I presented the problem clearly. Please ask if something sounds unclear - I will try my best to elaborate.
I am using Delphi 10.3 (Community Edition)
There are many solutions to this problem. I won't expose all possibles but only the one I think is best:
You need a server somewhere in the cloud to keep data from different devices and you have to make your application communicate with that server. You can build server side with Delphi, or other tool.
I recommend a REST architecture over HTTPS using JSON format to send/receive data to/from devices.
Delphi has everything required to build both client (Your devices) and server side. Not sure for Community Edition. If not included in CE, you may use third party libraries to accomplish the same task.
You next step is to think about that solution, do some research by yourself, write some code and when you are stuck, ask another question on StackOverflow.
I would like build a mobile application in order to learn the technology.
I have chosen Ionic framework for the same, as it takes care of majority of settings for building the application. But, when coming to database for the app which I am trying to build, I am bit confused.
Some links as a result of googling suggest me to use SQLite and some pull me towards Firebase. My doubt is, are they related for comparison? I guess, SQLite and Firebase cannot be compared with. Please clarify.
Thanks
Manikandan J
SQLite is your phone's database and Firebase is an online database.
Using SQLite, you can create apps which do not support sharing with others. An example, pac man. Say you got a highscore of "20". But you cannot share this highscore with other people's phones because it is local (inside your phone).
Using Firebase, you can store data online, for example, registration details etc. Once people have registered they can login with their info using multiple platforms (depending on your target). You can make them share things with eachother and so on.
SQLite is more suitable fro developing offline android application. Firebase always required a server but SQLite did'nt require any server so for Firebase you should have internet required but in SQLite you can achieve your goal offline. So depending upon the conditions you can use one of this.
I'm building a new application for android and this would need to send and retreve data from an online database.
Firstly is this possible or is it a completely wrong approach?
Would i be able to tell my application to set certain data into the server and retreve other?
Does it create security risks by which anyone would be able to access the database?
It's my first time dealing with anything close to databases so i'm still learning.
Is there any website i can use which sets up an accessible SQL database?
Thanks for your help!
The Good approach for this is that you should create REST (Representational State Transfer) API on server and perform CRUD operations in your Android app using that API.
There are a lot of security problems with embedding direct database access into your app.
Usually,REST architecture is very useful to build client/server network applications. REST basically works on HTTP protocol and implementing REST is very simple compared to other methods like WSDL etc.
There are many good tutorials available on implementation of REST API that you can easily find by Googling it.
Here's one of them: http://www.androidhive.info/2014/01/how-to-create-rest-api-for-android-app-using-php-slim-and-mysql-day-12-2/
Yes, it is possible and it is not the wrong approach. Web services/REST API's are some things you should look at.
There are obvious security risks associated with having an outward facing web service or database. OWASP has a pretty good
web services guide that should get you started with the
security. You will need to address these risks prior to holding any sensitive/user information. There are plenty of guides online.
A couple of database hosting suggestions Amazon Web Services if you want it to be manage dfor you or create a VPS at Digital Ocean (or similar) website if you want to do it yourself.
Due to the open ended nature of this question there are numerous ways you can address these problems. I recommend spending a lot of time researching and analyzing them prior to starting the project and deciding on a technology.
This is not a wrong approach, most of the Android application send or receive data from online databases.
For connecting your Android app with the online database you can make of webservices , for instance you can create Rest Api for this.
For creating Rest Api using Asp.net web api visit this link
The answer for your last question would depend on the way your write your web services decide the security risk.
You can also use this reference
I have been searching for NoSQL databases. In my research on the Internet I have found that Cassandra DB is the most widely used NoSQL DB. I also want to use it in my Android App but did not find anything about its Android Version.
Is there an API like CouchDB has Ektorp for using it in Android?
Am I going in the right direction with the decision of Cassandra DB?
I need its Android API and tutorial to start with? I only found this link on StackOverflow but it did not help me.
Android cassandra client example
The typical approach is to use a web server to interface into cassandra whereby you send requests to server and it gives you an XML/JSON response, that is what this answer means by creating a RESTful service.
One of the applications that made it to datastax's next great developer competition finals was an android app that did exactly this, here is the project's code.
I am a newbie and I've read many topics related to my question, but I still have a few questions in mind for which I need your assistance. Any kind of information would be helpful.
My application: I have a web site to sell tickets and an app to sell the tickets both should access the same database (centralized Windows server).
I read many topics related to my question and understood, using jTDS would be the best idea for my requirements. But after reading the following topics, I am little bit confused whether I am moving in the right direction or not. So please help to find the right direction.
using an Android app to post entries to SQL Server
How can I use external JARs in an Android project?
My questions are:
Which is the best way to access SQL server from both my app and website?
What kind of security issues do I have to consider? As my app will be used worldwide, do I have to take a special care for security?
Any tutorial or advice will be appreciated.
You must run a webservice based on the REST or SOA to do that. REST is lightweight. I don't recommend using a JDBC connection. I am not sure jTDS would work on Android. If you are about to deploy a webservice you have to look after authentication and SQL injection.
Use a WebService to talk to the database, and the Android app will talk to the WebService. You don't want the clients to talk directly to the database. In the WebService you can do any authentication/security checks that you want. If you use stored procedures in your WebService, you don't have to worry about SQL Injection.