I think that generally there are two pre-requsites to answered prayer:
1. You are doing God's will.
2. What you are praying for is God's wil. In other words you are praying in accord to God's will.
That does not mean necessarily that you cannot be blessed with material things, but many pray for material things, and other things that are not in God's will. It's God's will that you be saved, and you do His will. If you don't put His requests first then you should not be surprised if you don't get your requests filled.
I can't speak for God, but this is outlined by Jesus' example of prayer.
After this manner therefore pray ye: Our Father which art in heaven, Hallowed be thy name. Thy kingdom come. Thy will be done in earth, as it is in heaven. Give us this day our daily bread. And forgive us our debts, as we forgive our debtors. And lead us not into temptation, but deliver us from evil: For thine is the kingdom, and the power, and the glory, for ever. Amen. For if ye forgive men their trespasses, your heavenly Father will also forgive you: But if ye forgive not men their trespasses, neither will your Father forgive your trespasses.
(Matthew 6:9-15 KJV)