Skip to content
This repository has been archived by the owner on Apr 21, 2021. It is now read-only.

open-education-api/sdk-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 

Repository files navigation

OpenOnderwijsAPI-java

Deprecation notice

This SDK is outdated and will not be maintained. Please use the API specification.


Importing the library into your project

  • If you want to be sure that you are using the latest library, build the project yourself as described at the bottom.
  • There's also a library jar available in the Library folder named oda.jar.
  • Import the library jar (oda.jar, or the one that you have built) into your project.

Using the client

There's an Android demo included, there you can see, how you should use the library.

  • For the communication with the API, create a new OnderWijsDataAPI object: OnderwijsDataAPI apiClient = new OnderwijsDataAPI("http://your.api.url");
  • Now you can get the different sub-APIs for getting different data. Getting the sub-API for persons: apiClient.getPersonsClient()
  • Use the get(...), getById(...) and the getList(...) methods to fetch the data from the sub-API. All of them have a callback, which can return with a success or failure method.
  • With get(url, params, handler) you fetch data of a single object. The url is the resource url of the object. Use entity.getResourceUrl() to get this. You can also use getById(id, params, handler), which uses the object's id instead of its URL. Remember: this is not always a number! The params is a Params type of object. You can create this the following way:
    Params params = new Params();
    params.setPage(1); //adds the &page=1 parameter to the query
    params.setEndDate(new Date()) //sets now as the ending date of the listing
    params.put("sort","name"); // you can also add custom parameters
  • getList(params, handler) works the same way as get, only it returns a list of objects.

Questions, bugs, enhancements

For questions about usage, or if you found a bug, you can use the Issues section of the repository. Also, pull requests for enhancements are welcome :)

Using the repository as a submodule in your project

  • Copy the URL of this repository.
  • In your command window, go to the directory, where you want to place the downloaded sources.
  • Enter git submodule add https://github.com/repository_url, where the last part is the URL you copied.
  • Git now downloads the repository to the directory, where you currently are.
  • You are now using this repository as a submodule :)

If you want to change the code

Building the project

  1. Open the project using eclipse.
  2. Install the FatJar plugin using this URL from the update manager: http://kurucz-grafika.de/fatjar
  3. Right-click on your project, and select Build Fat Jar
  4. Using the default settings build your .jar. Always build your project before creating the fat jar, or the changes will not be available in the fat jar.

License

This Java API client uses the following libraries:

Retrofit by Square, Inc.

google-gson

About

Java SDK for the Open Education API.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages