The location accuracy will be most accurate when the phone has a clear view of the sky. While being indoors might not be perfect, the phone should in most cases get valid location information from a Wi-Fi or cellular network.