android number format for germany
is there a public algorithm that formats German phone numbers (mobile and landlines)? I saw there is a method t开发者_Python百科o format phone numbers PhoneNumberUtils.getFormatTypeForLocale(Locale locale)
but this is only for NANP countries, see here.
Maybe libphonenumber can do what you want?
Like most android documentation PhoneNumberUtils very poorly created. Try Locale.GERMANY as method input. If the locale format is unavaible like you mentioned, you have to write your own method. Maybe extending PhoneNumberUtils and overriding that method is a good practice. Good luck anyway :).
Edit: aspartame's answer seems more logical to me.
精彩评论