I can't figure this out at all. I did:
int num = ((month-1)*30+day)%134;
//a,b,c are just for the Log
String a = String.valueOf(num);
String b = String.valueOf(month);
String c = String.valueOf(day);
num ++;// don't want zero
String stringnum = String.valueOf(num);
month is todays month, day is today (i.e. december 31st = 12,31). In ANdroid this is taken from CALENDAR.
Now this program was working fine until today. Jan 1st. What happens is the DB searches for a string of index num, taken from the date. The problem isnt in the DB, its in this code.
Jan 1st is month=0, day = 1, naturally, but after mod 134 I get, courtesy of LogCat:
01-01 12:07:38.554: VERBOSE/variables(6917): -29,0,1
But 1mod134 != -29. I can't understand where -29 comes from.
Sorry. I figured it out almost immediately after posting. month = 0, so month -1 = -1. I assumed month would start from 1 and go to 12, not zero to 11. Sorry for wasting anybody's time!