create account

Introducing steemconnect4j by hapramp

View this thread on: hive.blogpeakd.comecency.com
· @hapramp · (edited)
$176.84
Introducing steemconnect4j
## Repositories

| Repository | Link |
|-----|-----|
| `steemconnect4j` |  https://github.com/hapramp/steemconnect4j |
| Example Project | https://github.com/hapramp/SteemConnectSampleApp |

---

# 1. About steemconnect4j

<center>
  <img src="https://ipfs.busy.org/ipfs/QmXVGoj2vx4ojo98kLXxVeUioeJUjsEpCcBdUGWSyn3PHB"/>
  <p>A Java SDK for SteemConnect v2</p>
</center>


## 1.1. Need for a SteemConnect Java SDK

[SteemConnect](https://v2.steemconnect.com/) 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](https://github.com/steemit/steemconnect-sdk). But it is difficult to develop Java-based applications like [Android](https://developer.android.com/), [Jetty](http://www.eclipse.org/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](https://github.com/hapramp/steemconnect4j#initialize-steemconnect)
- [Getting login URL](https://github.com/hapramp/steemconnect4j#getting-login-url)
- [Getting user profile](https://github.com/hapramp/steemconnect4j#getting-user-profile)
- [Voting on a post](https://github.com/hapramp/steemconnect4j#vote)
- [Replying to a post via comment](https://github.com/hapramp/steemconnect4j#comment)
- [Getting link to sign transactions](https://github.com/hapramp/steemconnect4j#generate-hot-signing-link)
- [Revoking Token/Logging out](https://github.com/hapramp/steemconnect4j#logout)
- [Reblogging](https://github.com/hapramp/steemconnect4j#reblog)
- [Follow/Unfollow](https://github.com/hapramp/steemconnect4j#follow)
- [Ignoring other user(s)](https://github.com/hapramp/steemconnect4j#ignore)
- [Claining rewards](https://github.com/hapramp/steemconnect4j#claim-reward-balance)
- [Updating user's metadata](https://github.com/hapramp/steemconnect4j#update-user-metadata)

---

# 2. Tech

# 2.1. Technologies Used

| Task | Tech/Tool | Link(s) |
|-----|-----|-----|
| Build Tool | [Gradle](https://gradle.org/) | [Root config](https://github.com/hapramp/steemconnect4j/blob/master/build.gradle) [steemconnect4j config](https://github.com/hapramp/steemconnect4j/blob/master/steemconnect4j/build.gradle) |
| Test Coverage | [Jacoco](https://www.eclemma.org/jacoco/) | [Config](https://github.com/hapramp/steemconnect4j/blob/master/steemconnect4j/build.gradle#L27-L29) |
| Linting | [Checkstyle](https://github.com/checkstyle/checkstyle) | [Config file](https://github.com/hapramp/steemconnect4j/blob/master/config/checkstyle/checkstyle.xml) |
| Package Repository | [JitPack](https://jitpack.io/) | [Repository](https://jitpack.io/#hapramp/steemconnect4j) |

# 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 - 

![1.png](https://ipfs.busy.org/ipfs/QmQBEr9qXgMJwp5jAZXNmdUu8s6VnWH9xGzqv3mmJd9Ww4)

After this, just add `steemconnect4j` as project dependency and you are good to go - 

![2.png](https://ipfs.busy.org/ipfs/Qmc8uSLUeSNiMtN8pVeewb5puBZmCbiC9tgLLXmx3EfULL)

## 2.3. API Documentation

You can find all the documentation for the API in the project's [README file](https://github.com/hapramp/steemconnect4j/blob/master/README.md).

## 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.png](https://ipfs.busy.org/ipfs/QmXcCN4cvzCDQrKyZKDXse8rGkmiXGhAxFfm3Z4et9L1y5)

---

# 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 - 

<center>
  <img src="https://user-images.githubusercontent.com/10809719/41578179-93134d82-73ae-11e8-9ec4-763ee652f75d.gif" alt="Demo"/>
</center>

---

# 4. Future Plans

The SDK will be used in [HapRamp's Android app](https://github.com/hapramp/Hapramp-Android) 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](https://github.com/hapramp/steemconnect4j/issues/). 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 - 

1. Fork the project.
2. Clone your forked version of the project.
3. Checkout a new branch.
4. Make desired changes.
5. Commit your changes with a proper commit message.
6. Push your local branch.
7. Go to Github and create a pull request.
8. Done πŸŽ‰

## 5.2. Join the Conversation

If you wish to talk, please join HapRamp's Discord channel - https://discord.gg/r9vwcHe.

---

## Github Account

https://github.com/bxute

> Written by @bxute from @hapramp
πŸ‘  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
properties (23)
authorhapramp
permlinkintroducing-steemconnect4j
categoryutopian-io
json_metadata{"community":"busy","app":"busy/2.4.0","format":"markdown","users":["busy.org","dtube","dmania","bxute","hapramp"],"links":["https://github.com/hapramp/steemconnect4j","https://github.com/hapramp/SteemConnectSampleApp","https://v2.steemconnect.com/","/@busy.org","/@dtube","/@dmania","https://github.com/steemit/steemconnect-sdk","https://developer.android.com/","http://www.eclipse.org/jetty/","https://github.com/hapramp/steemconnect4j#initialize-steemconnect"],"tags":["utopian-io","development","steemconnect","steem","android"]}
created2018-06-19 17:13:27
last_update2018-06-19 18:03:39
depth0
children5
last_payout2018-06-26 17:13:27
cashout_time1969-12-31 23:59:59
total_payout_value133.125 HBD
curator_payout_value43.710 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length6,009
author_reputation3,171,518,084,944
root_title"Introducing steemconnect4j"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd0
post_id61,385,254
net_rshares84,201,612,905,596
author_curate_reward""
vote details (44)
@amosbastian ·
$0.04
Thanks for the amazing contribution, @hapramp (@bxute)! This is the kind of contribution I love to see on Utopian! Great work on creating something that provides a lot of value to the Steem community in general - this is definitely an easy staff pick for me!

I'm already looking forward to your future contributions!

Your contribution has been evaluated according to [Utopian policies and guidelines](https://join.utopian.io/guidelines), as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, [click here](https://review.utopian.io/result/3/1111111).

---- 
Need help? Write a ticket on https://support.utopian.io/. 
Chat with us on [Discord](https://discord.gg/uTyJkNm). 
[[utopian-moderator]](https://join.utopian.io/)
πŸ‘  , ,
properties (23)
authoramosbastian
permlinkre-hapramp-introducing-steemconnect4j-20180619t222932715z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"users":["hapramp","bxute"],"links":["https://join.utopian.io/guidelines","https://review.utopian.io/result/3/1111111","https://support.utopian.io/","https://discord.gg/uTyJkNm","https://join.utopian.io/"],"app":"steemit/0.1"}
created2018-06-19 22:29:33
last_update2018-06-19 22:29:33
depth1
children0
last_payout2018-06-26 22:29:33
cashout_time1969-12-31 23:59:59
total_payout_value0.032 HBD
curator_payout_value0.007 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length808
author_reputation174,473,586,900,705
root_title"Introducing steemconnect4j"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id61,415,336
net_rshares19,923,907,066
author_curate_reward""
vote details (3)
@fabien ·
That's awesome! We've added SteemConnect4J in the list of libraries here https://github.com/steemit/steemconnect/wiki/Libraries
πŸ‘  , ,
properties (23)
authorfabien
permlinkre-hapramp-introducing-steemconnect4j-20180619t212532555z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"community":"busy","app":"busy/2.4.0"}
created2018-06-19 21:25:33
last_update2018-06-19 21:25:33
depth1
children1
last_payout2018-06-26 21:25:33
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length127
author_reputation16,649,367,183,999
root_title"Introducing steemconnect4j"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id61,410,026
net_rshares6,725,118,694
author_curate_reward""
vote details (3)
@singhpratyush ·
Hooray πŸš€

Thanks, @fabien!
properties (22)
authorsinghpratyush
permlinkre-fabien-re-hapramp-introducing-steemconnect4j-20180620t050337898z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"community":"busy","app":"busy/2.4.0"}
created2018-06-20 05:03:39
last_update2018-06-20 05:03:39
depth2
children0
last_payout2018-06-27 05:03:39
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length26
author_reputation7,035,648,262,478
root_title"Introducing steemconnect4j"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id61,444,941
net_rshares0
@steemitboard ·
Congratulations @hapramp! You have completed the following achievement on Steemit and have been rewarded with new badge(s) :

[![](https://steemitimages.com/70x80/http://steemitboard.com/notifications/payout.png)](http://steemitboard.com/@hapramp) Award for the total payout received

<sub>_Click on the badge to view your Board of Honor._</sub>
<sub>_If you no longer want to receive notifications, reply to this comment with the word_ `STOP`</sub>



**Do not miss the last post from @steemitboard:**
[SteemitBoard World Cup Contest - Colombia vs England](https://steemit.com/steemitboard/@steemitboard/steemitboard-world-cup-contest-colombia-vs-england)

---
**Participate in the [SteemitBoard World Cup Contest](https://steemit.com/steemitboard/@steemitboard/steemitboard-world-cup-contest-collect-badges-and-win-free-sbd)!**
Collect World Cup badges and win free SBD
Support the Gold Sponsors of the contest: [@good-karma](https://v2.steemconnect.com/sign/account-witness-vote?witness=good-karma&approve=1) and [@lukestokes](https://v2.steemconnect.com/sign/account-witness-vote?witness=lukestokes.mhth&approve=1)

---

> Do you like [SteemitBoard's project](https://steemit.com/@steemitboard)? Then **[Vote for its witness](https://v2.steemconnect.com/sign/account-witness-vote?witness=steemitboard&approve=1)** and **get one more award**!
properties (22)
authorsteemitboard
permlinksteemitboard-notify-hapramp-20180702t203157000z
categoryutopian-io
json_metadata{"image":["https://steemitboard.com/img/notify.png"]}
created2018-07-02 20:31:57
last_update2018-07-02 20:31:57
depth1
children0
last_payout2018-07-09 20:31:57
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,345
author_reputation38,975,615,169,260
root_title"Introducing steemconnect4j"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id63,183,967
net_rshares0
@utopian-io ·
Hey @hapramp
**Thanks for contributing on Utopian**.
Congratulations! Your contribution was Staff Picked to receive a maximum vote for the development category on Utopian for being of significant value to the project and the open source community.

We’re already looking forward to your next contribution!

**Contributing on Utopian**
Learn how to contribute on <a href='https://join.utopian.io'>our website</a> or by watching <a href='https://www.youtube.com/watch?v=8S1AtrzYY1Q'>this tutorial</a> on Youtube.

**Want to chat? Join us on Discord https://discord.gg/h52nFrV.**

<a href='https://v2.steemconnect.com/sign/account-witness-vote?witness=utopian-io&approve=1'>Vote for Utopian Witness!</a>
πŸ‘  ,
properties (23)
authorutopian-io
permlinkre-introducing-steemconnect4j-20180620t172007z
categoryutopian-io
json_metadata"{"app": "beem/0.19.29"}"
created2018-06-20 17:20:09
last_update2018-06-20 17:20:09
depth1
children0
last_payout2018-06-27 17:20:09
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length700
author_reputation152,955,367,999,756
root_title"Introducing steemconnect4j"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id61,522,854
net_rshares6,180,027,102
author_curate_reward""
vote details (2)