Ultrasonic Ranging and Indoor Localization for Mobile Devices