You can use something called Dash: Offline API Documentation
for Mac. For Windows and Linux you have an alternative called Zeal
.
Both of them are very similar. And you can get offline documentation for most of the APIs out there like Java, android, Angular, HTML5 etc .. almost everything.
I have also written a post on How to install Zeal on Ubuntu 14.04