If you're a beginner, I would use a giant map. You can perform pixel operations on the bitmap to find collisions. This will be the most hard job, but not impossible.
Gravity calculation itself is not so hard. Just use standard physics equations, translate them to the movement of your bitmaps, and you should be fine.
It'll be collision detection that attempts to kill you :P