Steemer Update - Features and bug fixes

in #utopian-io6 years ago

STEEMER-BANNER02.png

Repository
https://github.com/hispeedimagins/steem


steemer is and will remain the first native android app which is and will be forever completely free for the people to use.

Why free?

Because @steemit needs it. A quick way to interact with the blockchain. One that will not eat into the users rewards.


New Features


Claim Rewards

The user should be able to claim rewards available from within the app and hence this feature was added. When you launch the app it checks for any available rewards and if they are present, a dialog will be launched which will show the available rewards and a button to claim them.

Did not have any rewards available while writing this to show it in a screenshot. :(

How do you know if rewards are available?

Fetch a users profile.
Handy tip, just do this to retrieve any users profile via steemit

https://steemit.com/@hispeedimagins.json

yup, just adding .json at the end will return its JSON form. This works for articles too.

"reward_sbd_balance": "0.000 SBD",
"reward_steem_balance": "0.000 STEEM",
"reward_vesting_balance": "0.000000 VESTS",
"reward_vesting_steem": "0.000 STEEM",

If rewards are available then these values will not be 0.00.

If available, this is the request to make it retrieve them.

Screenshot (185).png

Note : we use reward_vesting_balance instead of reward_vesting_steem. Do not send the wrong value.

commit
  1. commit

Nonce value for users who are facing signing troubles

This might fox a lot of people. A nonce is something used to calculate the hash. It is used while calculating the hash. So when we sign the data and it is not canonical we have to retry signing the transaction.
What is canonical?

The signature is composed of two values, the r value and the s value. In your third input, the s value is greater than N/2, which is not allowed. Just add in some code that if s is greater than N/2, then s = N - s.
Or this link

So even if we sign the transaction again the same result will be obtained. To avoid this, we either introduce a nonce or change the value, hence in our case we change the value of the date by a certain value until we get the right signature.

ss2.png

If you seem to be taking too long in signing transactions then you can increase the value of nonce and get better performance

commit
  1. commit

Users following you will now be coloured in the accent colour

Users who are following you will have their names colured in the accent colour of the app.

ss1.png

How do we do it? We return from the main parsing class if someone is following you and then in the binder we colour the name.

commits
  1. commit - returning the follow status of the user

Bug Fixes and Performance improvements

Voting after opening an article from the notification would crash the app

After opening a notification if the user would try to vote on a comment/article the app would crash on the vote slider.
The reason for this was that for calculating the value of your vote I needed some variables which would not be loaded as they only load on the first launch of the app.

The solution was to first store those variables and update them on each vote, then retrieve them when the app starts without them and the rest of them would be got via steem.

val runs = GeneralRequestsFeedIntoConstants(applicationContext)
runs.RunThemAll()

This gets the variables from steem. Which is the reward pool available and the steem median price

lastvotingtime
voting power
vesting shares
delegated vesting shares
received vesting shares

These variables are stored

The functions for calculated we changed slightly and viola the app does not crash anymore.

commit
  1. commit

Time would show different and anyone who lost his mind figuring out a fix

The time which steem delivers is in the pattern

yyyy-MM-dd'T'HH:mm:ss
This is in GMT.
When you make this date into a date object you get the wrong date as you get this date as the local time which throws off calculations.
The fix is simple.
yyyy-MM-dd'T'HH:mm:ssZ
you add a small Z at the end of the pattern and to the time you add
+0000
when you now parse this, you will get the correct time which you change to your regional time.
The commit is in the static misc files. Am lost atm.

The app would crash sometimes when stale data would be present in the requests database.

The requests database stores these values for using while screen rotations or while loading the app from the background. The app would sometimes crash on startup when the data would be corrupted or stale.

The fix was to catch any errors while retrieving the data and not transmit the data ahead.

commits
  1. commit
Other bug fixes
  1. Fix a bug where while displaying the votes on a comment/post the app would crash
    This was due to bad json or corrupt json which needed to be caught gracefully.
    commit

  2. Fixed a bug where the app would crash sometimes while posting an article
    This needed many checks and a try catch block to display any error while signing or posting of an article or while uploading images.
    commit

  3. Fix a bug where the app would crash if the name was not present.
    Sometimes while opening someone else's blog the app would crash as the name value would be null.
    The required a check.
    commit

  4. Fixed a bug where the app would crash sometimes trying to post null comments, which is not allowed.
    A check to make sure that the data is not null.
    commit

  5. Some images would not be identified and rendered. The regex has been updated to support them.
    () have been removed and " is allowed now. Some conditions have been removed.
    commit

  6. Fixed a bug where if the user introduced a space in the username while signing in that would continue.
    A simple trim fixed this on login and a function for installed apps which will execute on launch after updating and will remove the space.
    commit

  7. The steem lib from where some code was translated used steemitdevimages instead of steemitimages. This has now been corrected by me.
    commit

  8. Fix a bug where app would sometimes crash while deleting drafts.
    This was due to incorrect id's being forwarded and then being used by the recycler view which throw an out of bounds exception.
    commit

  9. Fix a bug where while scrolling the floating date holder would move in the wrong direction in the end.
    Introduced a variable to negate the animation if it is downwards.
    commit

  10. This commit was to make the transactions sign faster. It is now merged with the nonce one.
    commit

More bugs and improvements

These are many small fixes clumped together. They add stability by

  1. checking for null contexts
  2. show correct icons
  3. null checks for drafts
  4. using the new date parsing function
    commit

GitHub account

https://github.com/hispeedimagins


Please note I forgot to comment on code and had to do it later here. comments

Also since this app was not open source when I started it, I did not comment much. Only after I have put it on Github have I started adding comments.


Want to contact me?

Discord server for steemer - https://discord.gg/GkNZCGu
My discord username - hispeedimagins#6619
email - [email protected]

Sort:  

Thank you for your contribution. A lot of fixes and a nice feature added. I can see a lot of commented code, wouldn't it be better to remove those. Also, some of the complex logic did not have comments, it's better to write comments for them.

Your contribution has been evaluated according to Utopian policies and 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.


Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]

Thank you :)
I will be removing a lot of commented code out, that was all for dev. Eep I may have missed those.

Hey @hispeedimagins
Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!

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

Vote for Utopian Witness!

Hi, @hispeedimagins I'm glad the app is receiving new updates and bug fixes. (y) friend

Congratulations! Your post has been selected as a daily Steemit truffle! It is listed on rank 12 of all contributions awarded today. You can find the TOP DAILY TRUFFLE PICKS HERE.

I upvoted your contribution because to my mind your post is at least 18 SBD worth and should receive 104 votes. It's now up to the lovely Steemit community to make this come true.

I am TrufflePig, an Artificial Intelligence Bot that helps minnows and content curators using Machine Learning. If you are curious how I select content, you can find an explanation here!

Have a nice day and sincerely yours,
trufflepig
TrufflePig