With the prevalence of WiFi devices (e.g., smartphones), many new business opportunities are being spawned by exploiting the routes or locations of users. Nevertheless, most current approaches based on received signal strength indicator (RSSI) usually assume that the targeted (tracked) devices have the transmission characteristics similar to the devices used for system training. This is far from the reality and may lead to considerable errors. We propose a robust localization approach which automatically infers a customized signal-strength-to-distance function for every device on-the-fly, and simultaneously estimates the location of it. This is achieved by first approximating the function with a set of piecewise linear functions, for each targeted device, and the parameters of the linear functions are updated, with an Expectation Maximum (EM) algorithm, when more and more RSSI data of the device are available. Specifically, during the expectation step of the EM algorithm, the location of the targeted device is estimated. Whereas in the maximization step of the algorithm, the parameters of the linear functions customized for that device are updated. As the approach is capable of learning the parameters during localization, training process or system calibration is unnecessary and thus the system setup time can be shortened. This feature is practical for meeting the special needs of the exhibition industry: extremely tight schedules for setting up the site from scratch and extremely large venues. With our testbeds, experimental results show that the mean localization error can be kept about 1.7 meters for different mobile devices with different transmission characteristics. A real-world test at Hong Kong Convention and Exhibition Centre (HKCEC) was also conducted and various mobile devices can be tracked accurately with little setup time.