How to detect and get the button positions/locations (x, y) on the phone screen?

HoughCircles or TemplateMatching should work (depending on the needs).