2

I am thinking about building a student app, that would use Moodle data, and notify the user when a new file has been uploaded, and perhaps do something like checking your grades etc.

I'm quite new to android programming and can get easily confused with the technical terms. I've looked around the web and found that there is an API, but I dont really 100% know what that means. Which is weird since I've communicated with API's like the OpenWeatherMap one and uTorrent. Would Moodle's api do the same? Make it easier for me to get their data? Their descriptions are really technical and I can not understand much.

Nephilim
  • 494
  • 5
  • 25
  • Generally speaking if something has API you can interact with it. There are plenty repos on github that you can use in order to understand how to do it. [Searching on github](https://github.com/search?l=Java&q=moodle&type=Repositories&utf8=%E2%9C%93) – Alex Baranowski Jan 07 '17 at 16:46
  • @AlexBaranowski I still dont understand. Would I be able to just develop an app that generates a bunch of URL requests then parses the JSON to fit a GUI? – Nephilim Jan 09 '17 at 14:30
  • You can look on already working app - [Github](https://github.com/praveendath92/MDroid) - the author is using rest and gson [Gson on github](https://github.com/google/gson). Gson is library that can convert java objects to json and json to java object. The example usage can be find in MDroid repo [example gson (json) + rest](https://github.com/praveendath92/MDroid/blob/master/app/src/main/java/in/co/praveenkumar/mdroid/moodlerest/MoodleRestCourse.java). SO it's cleary possible to interact with Moodle via REST/JSON api :). – Alex Baranowski Jan 09 '17 at 18:59

1 Answers1

3

Please note that "API" in moodle does not automatically refer to webservices like you are used to communicate with.

See https://docs.moodle.org/32/en/Mobile_web_services and https://docs.moodle.org/32/en/Using_web_services and https://docs.moodle.org/dev/Web_service_API_functions

These docs might be interesting for you.

Beside the existing webservice methods, you can also create your own moodle plugin, which provides the methods required, some info can be found here https://docs.moodle.org/dev/Adding_a_web_service_to_a_plugin

Bearzi
  • 538
  • 5
  • 18
  • 1
    To clarify this further - as @Bearzi is quite correct - the Moodle API is geared towards developers building plugins to work within Moodle, not external applications. This means you'd have an additional step, which is to build a Moodle plugin which responds to your web service calls, uses the Moodle API to get the data you want, and then formats it to return to your mobile app in the format you're expecting. – Martin Greenaway Jan 10 '17 at 12:23