Free public WiFi is available in almost all main tourist areas, and is fairly quick in major cities.
Most hotels, guest houses, and restaurants in Sri Lanka are offering free WiFi. In some places the internet can be terribly slow, but it’s enough for checking emails and Facebook and so on.
To be sure to always stay connected, though, it’s better to buy a SIM-card at the airport or at a local store when you get to the city.
Phone SIM-cards are easy to buy. Having a local SIM-card with a local number is great, you get cheap local rates, and it is convenient for calling accommodations to book a room, and taxis/ tuk-tuk.
You’ll be connected around the island. The speed might vary though, nevertheless, its reliable. As you travel out, it depends on your operator, but all the towns have good connectivity. Dialog and Mobitel are the most reliable. Dialog have free SIM-cards available to travellers at the airport, and 1300 LKR (7 USD) will get you 9GB of data and 350 LKR (2 USD) for local calls. To top it up, simply head to any little convenience shop. Etisalat and Airtel are a good option too but the connection goes 2G around less fancied areas.
Anyway it's better than looking for mobile shops in the country.
You can check this option while reserving.