The British physicist Robert Hooke wrote down a law as a Latin anagram in 1676. He published the solution, now called Hooke's law in 1679. The Hooke's law describes the extension/compression of an elastic material exerted by a force in form of F = - k x in general. High school students learn the Hooke's law by hanging different objects with a spring in laboratory. In this paper, we show the on-board sensors of the smartphones can measure the period of the series and parallel springs. We demonstrate the smartphone can be used for doing the physics experiment easily.