• Welcome to SC4 Devotion Forum Archives.

LEX4J - Java LEX API Wrapper

Started by CasperVg, November 22, 2013, 08:20:15 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


Hi everyone,

After working on the new SC4Devotion LEX API, which allows easy access to the LEX functionality outside the SC4Devotion website for a fair bit, I decided to start building a Java LEX API Wrapper, which will abstract most of the lower level stuff (fetching the JSON, putting the results into Java beans, etc.) for you and allow you to focus on your LEX application only.

This is how you can get the profile for a user and print the full name:

        Auth auth = new Auth("username", "password");
        UserRoute route = new UserRoute(auth);
        User user = route.getUser();

Source-code is available at the Github repository and is licensed under the GPLv2 License. Everyone who wants to help and contribute is free to do so of course.

Documentation in the form of Javadoc is available through Github Pages:

v 0.5.0-beta: Click here to download

Usage instructions:
Add the "LEX4J.jar" and the dependencies in the /lib/ directory to your project. That's it ;)
Follow my SimCity 4 Let's play on YouTube


After some more testing and adding some extra features (it can grab the various LEX search categories now too) I have decided to release the first binary build (v0.5.0-beta) for people to experiment with.

It is available through a Github Release here: Click me!
Follow my SimCity 4 Let's play on YouTube


Version 0.7 of the LEX4J API Wrapper has been released. Changelog:

    v. 0.5 - Initial release
    v. 0.6 - Improved documentation for the search filters
    v. 0.7 - Switched to v2 LEX API, add support for new search query

You can also easily add LEX4J to your dependencies by adding this to your Maven pom.xml (or similar in Gradle, etc.)

Follow my SimCity 4 Let's play on YouTube


Version 4.0 of the LEX4J API wrapper has been released. It adds compatibility for the recently released LEX API v4.
Follow my SimCity 4 Let's play on YouTube