Database over internet - android

How can I make a database over internet, so I can update the database and all the devices that have the app will get that update to. Am I supposed to use mySQL database for that like in php? =) I have google'd and all that stuff but can't find a good answer.
I hope you know what I mean! Thanks! :)
(Sorry for bad english!)

first you have to decide where you want your data to be stored. You can store them locally on the device or on a server accessible through the Internet. I assume that you want them to be stored centrally through the Internet, in that case you can either connect to the database directly or through an interface. For most of my work I usually put up some scripts to handle HTTP-request (I like using the web technologies) on a server and connect toward this. If you make a PHP or other script you can call this by sending a request for either getting data or setting data.

Your question doesn't make sense. A database isn't inherently tied to the internet. Instead, you have a database on a machine, and provide an interface to it. One way to do this is to do something like write a Rails web interface using a REST based communication mechanism, and then have your apps interface with your database using HTTP requests. This is probably the most commonly done thing, and there are lots of libraries for things like rails, PHP, etc...

Related

How Can I Create a Database Accessed By windows and Android

I have been looking and searching for this whole day, so i want to create a database which can be accessed by both computer and smartphone, is there a way to do it, and how ?
Sorry For Beginner Question, Thanks in Advance
Ok, the first thing you should do is to define the type of database
that you want. You can build SQL or No-SQL database. For the most
part I would suggest no-sql so something like MongoDB could do, but you can always do mySQL. As
for accessing that db with anything actually, you need application
layer around it. You see, database acts as just a huge data
container thus it should not be used for any other logic.
Now, lets talk about application layer. To be more precise - about posting/updating/retrieving data from db. You should research something about RESTApi or GraphQL concepts as they are used to make communication between your app and your db which is hosted on a server (I deliberately did not talk about how you can build an app because I assumed you already know this one).
THE POINT: The most important concept to wrap your head around is how you can access the db you make not the type or tech used to build it. (Even though this is important too)
Good luck!
The better way to do this its creating a web service, so your app will talk to this web service, the web service will talk to your database and retrieve the results to your app (this can be done using HTTP protocol's APIs like Volley for android) and its a secure way to do it.
You can connect your application direct to your database granting external access, but this is a specif configuration according to your database (mysql, ms sql, etc.) and its not recommended.
You can think in the same way to the computer(s) that will access your database, except if this computer(s) is in the same network which the computer that your database is hosted in, in this last case, the program in this computer (which will access the database) can access it directly (you need to setup the database to permit this and this setting is diferent according to your database).

Connecting Android, Webservices and database

What I'm trying to do is connect a Java Android app with a FireBird database that is stored in an enterprise server.
I realised i need to use some kind of webserver to avoid connecting to the database directly.
In other words, something like this:
Android app -> WebServer -> Database
My problem is that although there are plenty of examples none of them let me do it.
Where can I find a full example of making the webserver, retrieve data (images, datasets, etc.) and how to connect my clients to it.
And obviously if there is a better way to do what I need that I'm not aware of.
Thanks in advance.

heroku android beginning

Hi I am currently making a simple application in android that would connect to my database in Heroku and I was just wondering how I would use java code to connect to that database and fetch, and data to and from it?
Could someone give me advice on how to start. I was looking at this code for starters https://github.com/heroku/devcenter-java-database but I am still confused on how to fully understand the code. Do I need a .pom file and what is it for? And where are the values of "DATABASE_URL" and how would I be able to connect to my database that I made in Heroku etc.
Thank you for the help
Generally you wouldn't have a mobile phone connect directly to your database. You'd need to allow access to your db from the internet, its considered a bad idea for security. Instead you write a webservice that sits between your db and your client. The webservice reads the database, packages it up into some data format like XML or JSON, and sends it to the client who parses those values and does something with them (display, calculations, etc).
#Gabe Sechan is right. you need to build a API. your app will query the API and the API will get the data from db and sent back to Android via JSON...
To learn more abour API have a look here :
http://www.andrewhavens.com/posts/20/beginners-guide-to-creating-a-rest-api/
or a list of tutorials
http://blog.mashape.com/list-of-40-tutorials-on-how-to-create-an-api/
Hope this helps u buddy.

Which database type is applicable to Android application for contents available in server?

I am trying to develop a real-time Android application where all contents are stored in server. So, they are available whenever a connection to Internet is available. Also, the application provides communication between users and conversations are stored in the server as well. Nothing is locally stored.
However, I am still cannot decide which database type I can use. I intended to use SQLite but I am not sure if I can really use it or not.
Could you please guide me to the proper database type to my application.
Appreciate your time and efforts.
As its upto you which database you use.
you may Install Lamp (For Linux) or WAMP(for window) . This is a nice database tool and very easy to handle and easy linked with PHP for various database function
I recently developed something similar to what you are talking about and here is what I would suggest you to go for.
Use SQL server to manage the data on your desktop and create a web-service in .Net on Visual Studio.
(Note that as others have already mentioned, it really does not matter what is the database you are using in your server end, because eventually the data is going to come to the Android application from the server in form of either xml or json in the web-service., regardless of what database you are using. So it is totally your wish which database you want to use.)
Then connect to the web-service in your application and set/get data from the remote Database, using SOAP.
Link on how to make a web-service in .NET (does not include the implementation in Android).
Links on how to connect your service with Android : this, this and this.

How do I connect to an online database in Android?

really having difficulty. New to Android development. How do I connect to an online database? Php, Java or? Php not working, dunno what to do with the php file, it wont work. How do i put in on the server side if i have to on myphpadmin? Is java a better way? I want to do a login screen and also populate listviews, add multiple data etc. to the database. Can't figure out how to reference the actual database on myphpadmin server, must i use the database password and username of the databe or reference the database html?
Also how do i check if i do connect to the database?
Please I'd appreciate any help at all.
Lookup tutorials on RESTful Web Service, you can implement this on Java Servlet, PHP, or ASP.NET. The idea is that the Web Service layer serves as the middleman between your app, and the database. Or, if you prefer, add another layer of application server logic between the Web Service and the database.
Once you have the Web Service implemented correctly, you can expose CRUD methods to your app as you see fit. e.g. PUT request to create a database entry, GET to retrieve it, POST to update it, and DELETE to delete it.
Of course, you need to add some kind of authentication logic, to limit or allow certain Web Services method to certain authorized users.

Categories

Resources