Android application Centralised Database Query - java

I am creating android application for my college notifications, I want to all the students to use same database through internet.What should I do.

Very simple approach would be:
Host the database in a public server. Then fetch data from & post data to database via web services. (basically you will be creating your own api)
use that api from your android app.

Related

Read and display SQL table from network on Android application using SQLite [duplicate]

I am developing an application which is associated with a website. My application home screen contains login and register buttons. In user registration, all field values have to be stored in SQL Server.
Is it possible to connect to SQL Server from a mobile Android application? If so how?
On your website, I would create services that expose just the information you will need in your Android application. Never pass SQL strings. As Robin said, that's a major security issue. Then just consume these services in your app.
That sounds like a security disaster waiting to happen. How are you going to prevent people doing unauthorised transactions against the database?
I don't know a single company that intentionally exposes their SQL database directly to the world, i.e. without forcing everything to go through a web interface.

Manage entities/user data in Rest Jax-RS Web Service without persisting them to database

I am new to writing JavaEE REST Jax rs web service and I am seeking for a solution to hold/manage all data passed between users/pages and my rest web service without storing them immediately to database?
I am transporting entities/dtos in JSON and only when user clicks on save button in the page, the data shall be stored in the database on application server. What options do I have here? Any ideas? Design pattern or so?
I read the REST services shall be stateless, so what's best practice on this?
You can use java cache systems like JCS or google guava
Java cache system
Google guava
or if you are using client/server model DB you can use in memory database like SqLite for cache
Sqlite

Connecting SpringMVC app to MBaaS for Android Application

I'm trying to create native Android app with MBaaS e.g. on parse.com where clients could enter some data. The thing is that I would also like to create some admin side web app (e.g. in Java SpringMVC) which could read that user related info from MBaaS service. Is it possible to connect SpringMVC app to MBaaS service? If not, what are my options?
Parse.com has REST API to access your data, so you can write separate web application with admin interface and fetch data from Parse.com via REST API.
But remember that Parse.com won't host your Java application. You'll need to host it on your own.

How to access SQL database with Web App and Android App

What is the best way to have a SQL database that can both be accessed by an android device via java code and by a web app via php code?
In my mind I imagined a MySQL database somewhere on the cloud that is accessed in all the normal ways by the web app using mysqli_connect and then somehow the same database calls are made in Java inside the android app.
But after some research it appears this may not be the way to do it. What is the way to do this correctly?
EDIT: It was suggested my question was too broad. What I want then is a database of some basic financial information which is stored on the cloud which is then able to be accessed via a web app written in the LAMP stack and via an android app (with java code).
It is a really simple problem but I am not sure what the best practice for such a problem is in android (I come from a web dev background)
The standard way to access a database for mobile application is different than a normal web page/application.
Mobile devices should never run queries in the database; What you do is create a web service that does all the queries in the database and then sends back HTTP responses in xml, JSON format to the mobile device for consumption.
At the same time you can create a web client that interacts with the web service the same way your mobile app does. This way if you get erroneous data you can debug the web service without having to recompile the code in the mobile app.
Do a Google search for restful web service

Android Quiz Application where users create the quiz content by a web form

I am developing an android quiz application for teachers where the teacher can login into a web interface and create questions, which can then be deployed to an android application.
My question is what database should i use? i am thinking that the data will have to be sorted on a mysql database when entered to the website.
Is it possible to connect to an external database on a android application? Is this the best method ?
In order to use an external storage for your android application, you will need to create you own web service.
If you create an XML web service, you can then make calls to your service and parse the response with an XmlPullParser.
Take a look at http://developer.android.com/training/basics/network-ops/xml.html for parsing XML.

Categories