Complicated Question. Depends on age & gender of the person. To improve/maintain bone mineral density, adults need daily, total calcium of ~1, 200 mg, ~2, 000 iu vitamin d, protein, 1 g/kg body wt., & adequate weight-bearing exercises. Fast-walking is the best form of exercise. In the absence of current bone loss or expecting bone loss (disease, medication, surgery), pharmacological therapies are not essential for most.
Exercise too. One of the biggest determinants of bone mineral density is lean body mass. Exercise is important for building lean body mass. Exercise is also important for putting load on your bones. This load is important for bone mass as bone strengthens as stresses are put upon it. Weight-bearing physical activity such as walking or running is better for building/ maintaining bone than non-weight-bearing activities such as swimming.