Hi there, I'd concur with @Monsieur_Ghislain... public transportation is convenient, safe and clean. I'd also wait to be in Barcelona and see whether it's worth to rent a bicycle. Again, let me emphasize "safe", and this includes all the different public transportations: tram, bus and metro.
Here you have a general map of Barcelona indicating the bicycle lanes, in all there are 150 miles.
For info, Estació Bicing (red dots) are the different places in town where you can pickup/drop a bicycle of the City Hall service called Bicing (http://www.bicing.cat, only available in Catalan and Spanish). Unfortunately Bicing is not intented for tourists, you have to be a resident of the city in order to suscribe to this bicycle sharing system. If anything I included this map for you to have a general idea on the bicyle lane network of the city.
Note too that Barcelona is not flat, from the sea level at the bottom of Las Ramblas boulevard, the city gradually increases its slope towards the Tibidabo, located at the top of the Collserola Hills (1800 feet). Having said that, note the height of the urban limits of the city (just before the hills) would be around 700 feet. Overall it might not sound a lot but when you're commuting by biclycle day in day out -in all kind of weather- it's something to take into account! Regardless, there are a lot of Barcelonans using the bicycle as their main mean of transportation.
But again, doing some touring across the city on a bicycle on the week end is something quite a lot of people do. Some suggeted routes can be found here: timeout.com/barcelona/sport-and-fitness/disc…
Edited: 8:23 am, August 22, 2013