Location isalways null

I am building a speedometer application and to do that I am using location getSpeed() command. I have more or less followed this tutorial : https://www.youtube.com/watch?v=ua4jY0lBvCA&list=…