Repositories
Repository | Link |
---|---|
steemconnect4j | https://github.com/hapramp/steemconnect4j |
Example Project | https://github.com/hapramp/SteemConnectSampleApp |
1. About steemconnect4j
A Java SDK for SteemConnect v2
1.1. Need for a SteemConnect Java SDK
SteemConnect has now become a standard for authentication in Steem based decentralized applications. A lot of popular Steem apps like @busy.org, @dtube, @dmania, etc. are now using SteemConnect for authenticating users.
Developing web apps using SteemConnect is simple, thanks to the steemconnect-sdk for JS. But it is difficult to develop Java-based applications like Android, Jetty, etc. on the top of SteemConnect.
In order to make this process convenient, I developed this SDK which can be used by anyone to develop SteemConnect based Java apps.
1.2. Introduction
steemconnect4j is an SDK for using SteemConnect v2 (SC2) API in Java-based projects like Android, Jetty, etc. It provides simple methods to interact with the Steem blockchain using access token received from the SteemConnect API.
1.3. Current Features
As of now, steemconnect4j offers the following features -
- Initialization using all possible parameters
- Getting login URL
- Getting user profile
- Voting on a post
- Replying to a post via comment
- Getting link to sign transactions
- Revoking Token/Logging out
- Reblogging
- Follow/Unfollow
- Ignoring other user(s)
- Claining rewards
- Updating user's metadata
2. Tech
2.1. Technologies Used
Task | Tech/Tool | Link(s) |
---|---|---|
Build Tool | Gradle | Root config steemconnect4j config |
Test Coverage | Jacoco | Config |
Linting | Checkstyle | Config file |
Package Repository | JitPack | Repository |
2.2. Using with Gradle
In order to add the SDK to a Gradle based project, make sure that you have JitPack in repositories for your root config -
After this, just add steemconnect4j
as project dependency and you are good to go -
2.3. API Documentation
You can find all the documentation for the API in the project's README file.
2.4. Testing, Coverage, and Linting using Travis CI
Travis CI is used to ensure that all the tests pass and a considerable amount of code is covered under tests. It uses hard checks on checkstyle so that even warnings turn into errors while CI build.
Here is what the Travis configuration looks like -
3. Example Implementation
To test the proper functioning of the SDK, I developed an Android application that authenticates a user and displays their information in the app.
3.1. Code and Repository
The application's source code is open source on Github - https://github.com/hapramp/SteemConnectSampleApp.
Minimum SDK version for the project is 17 and targetted SDK version is 27.
3.2. Demo
Enough talk! See it in action -
4. Future Plans
The SDK will be used in HapRamp's Android app for authentication and other actions like voting, commenting, etc. I aim to resolve all the bugs present in the SDK during this process.
I am also working on improving the test coverage for the code and wish to take it to decent numbers.
5. How to contribute?
The project is open to contributions in any way possible. If you find a bug, please open an issue in the project's issue tracker. For submitting code patches, feel free to open pull requests on Github.
5.1. Creating a Pull Request
Here's the basic flow for contributing to the project -
- Fork the project.
- Clone your forked version of the project.
- Checkout a new branch.
- Make desired changes.
- Commit your changes with a proper commit message.
- Push your local branch.
- Go to Github and create a pull request.
- Done 🎉
5.2. Join the Conversation
If you wish to talk, please join HapRamp's Discord channel - https://discord.gg/r9vwcHe.