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 :
- 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.
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.
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:
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.
- Send request to server, obtain data and update your local database and display data to students.
Choose whichever you want!
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:
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.