In my app, I have an sqlite db table that has a "phone number" column.
I get the phone number by querying the devices content providers (sometiemes ContactsContract.PhoneLookup.CONTENT_FILTER_URI and sometimes android.provider.CallLog.Calls.CONTENT_URI) and it seems that in some of the cases I get phone numbers with country code, and sometimes without (it seems inconsistent).
Because of that, when I query my own db, I sometimes do not get results (for example, I stored 99887766 and queried for +199887766).
So, I would like to remove the country code before storing a number in my db table.
I've google it and got to libphonenumber, but I can't figure out how to use it to do what I want (I can't seem to get my devices correct locale (I always get "US") + it seems that this lib makes network transactions; a thing I don't want to do)
So here are my questions:
- Is there a way to do what I want (using libphonenumber or in any other way)?
- Is there a way to do what I want without making internet transactions.