0

How the read time is calculated for a passage of text in android studio app. (Using java) same as medium article. Sample image shown as below.

I have used textview to show the texts.enter image description here

sejn
  • 2,040
  • 6
  • 28
  • 82

1 Answers1

1

Medium uses a hardcoded value (265 WPM) -- they take the number of words and divide by 265:

Read time is based on the average reading speed of an adult (roughly 265 WPM). We take the total word count of a post and translate it into minutes, with an adjustment made for images. For posts in Chinese, Japanese and Korean, it's a function of number of characters (500 characters/min) with an adjustment made for images.

https://help.medium.com/hc/en-us/articles/214991667-Read-time#:~:text=At%20the%20top%20of%20each,an%20adjustment%20made%20for%20images.

baumannalexj
  • 766
  • 1
  • 9
  • 20
  • Yes, I too found this. So for one min the word is 265. How the calculation will be used here? – sejn Jan 14 '21 at 18:24
  • 1 word / (265 words/min) = 1/265 min – baumannalexj Jan 14 '21 at 19:29
  • 1
    1/265 = 0.004 min for 1 word, or 0.23 seconds for 1 word. Does that help @sejn ? – baumannalexj Jan 15 '21 at 21:13
  • Able to set, but I have added as float only returns one decimal point. So the value less than one minutes are returning zero (0.0) values – sejn Jan 18 '21 at 07:39
  • Since read-times make sense as integers, can you use `Math.round(...)`? 265/2 = 132.5, 0-132 words would display as `0 min read`, 133-265 words would display as `1 min read` – baumannalexj Jan 18 '21 at 18:40
  • Need if the word is more than 100 will show 1 min read. In my case if the text is 267 it shows 1 min as well as if it is 417 it shows 1 min. But is it correct. If the count is 417 it will approximately 2.5 mins. – sejn Jan 19 '21 at 14:03