Live data from Hacker News

Google's phone number handling library

code.google.com

1–10 of 44 posts

Re: Google's phone number handling library

#2
Not entirely sure how this made front page, but it is a super handy lib.

I don't understand why Android includes this lib in their source but makes it internal so you have to provide your own copy if you want to use it in your app: https://android.googlesource.com/platform/external/libphonen...

Re: Google's phone number handling library

#4

Not entirely sure how this made front page, but it is a super handy lib. I don't understand why Android includes this lib in their source but makes it internal so you have to provide your own copy if you want to use it in your app: https://android.googlesource.com/platform/external/libphonen...

The reason it's internal is because system code takes priority over third party libraries given the same package name. If there were any changes to the library, you could never use the newest version because it would be dominated by the system version. This is what happened to the Apache HttpClient and why there is a fully repackaged version[1] for people who want to use a newer client than the one in the Android System.

[1] https://code.google.com/p/httpclientandroidlib/

Re: Google's phone number handling library

#5

Not entirely sure how this made front page, but it is a super handy lib. I don't understand why Android includes this lib in their source but makes it internal so you have to provide your own copy if you want to use it in your app: https://android.googlesource.com/platform/external/libphonen...

>> Not entirely sure how this made front page, but it is a super handy lib.

Sad that nowadays a statement like that isn't even considered ironic :). A cross-platform library handling an ugly necessity of development has to fight for its life in a sea of "growth hacking 101" links and the like.

Re: Google's phone number handling library

#6

Not entirely sure how this made front page, but it is a super handy lib. I don't understand why Android includes this lib in their source but makes it internal so you have to provide your own copy if you want to use it in your app: https://android.googlesource.com/platform/external/libphonen...

I would speculate that the reason why is so that Google doesn't have to maintain several versions of the library within the Android platform.

If Google is the only consumer, then Google only has to test internally that they didn't break something with an update. If tons of apps are consumers then they need to either test with many more apps, or worse just simulate buggy old behaviour for apps to keep things consistent (see Windows/Win32/etc).

If apps house their own copy of the library, then that version is static for that app's context, which likely means it won't break randomly in the future. That's good for the app developer (better back and forward compatibility), better for Google (less testing, less maintaining compatibility), and less headaches for consumers (as apps won't break as often when updating Android).

This reminds me of one of my favourite quotes: "If something in software doesn't make sense, then assume it is there for compatibility reasons." Which I think is a Raymond Chen quote that I've mangled.

Post reply on HN