You need to find out how many days between days, for example, Friday (constant number 6, Calendar.FRIDAY ) and Monday (constant number 2, Calendar.MONDAY ).
I write a repeating alarm clock under the android, in the database are the numbers for which days the alarm clock should be played, say 246 (Mon, Wed, Fri). If today is Friday, we need to set the alarm on Mon, therefore the difference in days is 3 days. How to learn it programmatically?