Another valuable technique that many professional writers use is to carry around a small notebook and jot down interesting things that happen, that they see, that someone says, etc. Reviewing this can often spark ideas.
Personally, I find that I get ideas most often when I just sit down to write for 45 minutes or so. Often at the start I can't think of anything! However, if I just start writing about how I can't think of anything, before you know it I'm onto something.
Finally, I have sometimes gotten ideas from my dreams. However, I find it frustrating to try to capture too much from dreams -- I can never seem to recreate the whole story.