A parser that looks for "credit" and "debit" breaks on the first card SMS it meets: "Rs.499 spent on HDFC Bank Credit Card" contains the word "Credit" and is a spend. Most of what I learned writing a parser for bank SMS in India looks like that: the formats are easy to match, and the words are what mislead you.
I'm building DailyBudget, an Android budget app that reads bank SMS on the phone and turns them into one number: what you can spend today. It has no INTERNET permission, so all of this runs on the device. It reads HDFC Bank, SBI, ICICI Bank, Axis Bank, Kotak, PNB, Bank of Baroda and Canara Bank by SMS, plus FamPay through app notifications.
Short version: read new SMS with a BroadcastReceiver on SMS_RECEIVED and old ones with a ContentResolver query on the inbox, filter by the bank's DLT sender ID, then parse with one small regex spec per bank (amount, direction, merchant, reference).…