ttdyce / NHentai-API-Java

NHentai API implementation in Java, a extended project from NHViewer

Home Page:https://ttdyces.blogspot.com/2020/05/nhviewer-third-party-android-client-for.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NHentai-API-Java

NHentai API implementation in Java, a extended project from NHViewer

The project include functions/API I used in NHViewer

Usage

App.java should be a great demo of the API

The API use callback methods to operate, here is a example to get index comic list

NHAPI api = new NHAPI();
api.getComicList(new ResponseCallback() {
    @Override
    public void onReponse(String response) {
        JsonArray array = new JsonParser().parse(response).getAsJsonArray();
        Gson gson = new Gson();
        
        for (JsonElement jsonElement : array) {
            Comic c = gson.fromJson(jsonElement, Comic.class);
            list.add(c);
        }

    }
});

for (Comic comic : list) {
    System.out.println(comic.getTitle());
}

About

NHentai API implementation in Java, a extended project from NHViewer

https://ttdyces.blogspot.com/2020/05/nhviewer-third-party-android-client-for.html

License:MIT License


Languages

Language:Java 100.0%