I have to develop a website and an android app, both using the same database. Which technologies should I use to achieve this in minimum given time?

Well, for backend programming, if you're more on the coding perspective, you can try the native PHP/mySQL combination for website and the usual, Java for Android, JSON for passing of data from your database to your mobile Android app. :)

Hope that helps.

PS. That's what I did when I tried to create an Android app that remotely accesses contacts, call logs and messages from one phone to another. We named it iKonek. I dunno if it still in Google Play.

Yes, you can use PHP and MySQL for making this app.

For the trial run, you can host a server on 000webhost.

On the Admin side:

Since the teachers need to modify the database, and they should not be aware of coding, you should choose from the following 2 methods :

  1. Make a web application where teachers can login and add questions with the help of an HTML interface, linked to the database through PHP code.
  2. Make a separate app or in-app feature in the same app for teachers to login and add questions with the help of XML interface. Obtain the data from the EditTexts, parse them to JSON object and send them to the server, where the PHP script receives the data and stores it in the database. Eg. You have a PHP script named addData.php on you server, then send the JSON object with the POST request. Receive the JSONObject from server and then store it in database.

Client side:

You want to fetch data from the server. If you want to notify the users, that their teacher has added some content then you can use Google Cloud Messaging.
You can create a PHP script on your server which receives related
parameters (those parameters which will be used to query data from database) from the GET request and returns JSONObject containing the newly added data from teacher. Now, use data and display the data to students.

There are two methods which you can use to fetch database:

  1. Use a SyncAdapter, which updates the local app database from the background and whenever the students open the app, data can be fetched directly from the local database.
  2. Send request to server, obtain data and update your local database and display data to students.

Choose whichever you want!

For networking:

Use the Volley library.

You have also asked about JSON Parsing.

Json parsing is just the process of extracting data bundled in the JSONObject and storing them in the primitive data types or in custom class objects as required.

Everytime you send a request, and receive a json object, you need to parse that object and use it as required.

Database query design:
(some insights...)
For fetching latest content:
You can send the STUDENT_ID, TEACHER_ID, CONTENT_ID, etc to the server. Using these, you can query the database to select only those content whose CONTENT_IDs are greater than the CONTENT_ID (the one sent from app).
And another thing which you can do is that only provide content to the student if the student with student_id=STUDENT_ID has subscribed for the teacher with teacher_id= TEACHER_ID.

Don't access database directly from any of web or app. Make a common interface for both and host a service to expose these interfaces as REST APIs. Use JSON for data exchange. This will save you when you need to change database design in case you want to scale and add more features. It will also make things easier when you migrate from one db to another (say from MySQL to Dynamo Db). You can always change the implementation behind the interfaces. To add new features you will add new interfaces but will not remove old ones, so that the older version of the app won't break. If you are willing to remove some older interfaces, deprecate it over one/two year.

You’ll need to write an API which both the web app and mobile app talk to. Depending on how your backend is already set up, if you’re using a language like PHP or Ruby on Rails, there are a lot of gems and tools you can use to get your API set up.

One thing I recommend: when building an API, you’ll want to make sure you provide a way to authenticate against it (which will protect your user’s data as well as fight againt spam). This is commonly done by setting up some kind of token-based auth system whereby you send a token up with every request and verify that the token is valid.

You can definitely use the same database to run a mobile application and a website. The current state of the art, is creating a set of web services (REST API) to hide the implementation (provide Abstraction) of the database from both the Website and the Mobile Apps.

After you define and build your API you can test it and see that it works. You can then make your website and mobile apps connect to the API to get and save data.

There are a few services that make this a little bit easier if you don’t want to do it all yourself. Take a look at Parse Server (open source) and Firebase (Not open source but run by Google).

Best of luck!

I guess the “fast and easy” answer is: Whichever one you’re most comfortable with and adept at using is a good choice. It is difficult to recommend one database over another without knowing more about the requirements, etc.

Off the cuff, I’d say MySQL is a good choice if you want to host the database externally. MySQL is perhaps the most “universal” contender. It works well, is easy to use and popular enough to make finding help with problems pretty easy.

On the other hand, if you’re looking to embed the database on a phone or something, you might want to look at SQLite for many of the same reasons.

We generally develop an API. An API is a backend part that is usually developed in server side language say NodeJS. The API connects with the database and send response as JSON object. The client can now make http request to an API from any mobile device as they all support to make http requests. The API processes the request and returns the response to the client in JSON format. Client interprets the JSON and render the information to client. Web APIs are generally the RESTful APIs and they do not require the backend and front end to be written in same language. So API written in java could be accessible to a app written in swift or objective c or android

Well that depends on your use case.

for on the device storage Sqlite is used, and on top of that you might want to use ORMs like GreenDao or Room persistence library from Google.

In case you want to share the data across users/devices Firebase might come handy, other alternatives are Mongodb. They are not traditional RDBMS but they provide good features like listeners on a data node that I feel is very useful, again it depends on the type of application you want to build.

And of course you can always have a server side RDBMS setup like MySQL, Postgress etc. Alongside server side application to interact with it, this server side application can expose a API for your Android application.

Can you be more specific about your requirement?

Do you want a link between your App and the website? or else the site itself should turn into a an app?

If it is the first case,

You need a link (URL redirection) to open the site inside the app. Nothing but it is your custom browser. Chrome provides the API for that.

In other case,

You have to turn your existing website to a Progressive Web App . That needs another complete development.

Why not doing like Uber and use the same as them?!

They used PostgreSQL. Now they switched to MySQL Why Uber Engineering Switched from Postgres to MySQL

But you must ask why they use a relational database instead of document database like MongoDB.

I think maybe they have to many relations to manage between entities. Now will you have too many relations between entities to manage?!

Akshay Narula's answer to I want my Android app to fetch data from an external WebApp. How should I go about it?