Without any doubt, location is one of the most important and key requirements of most mobile and wireless networks. Localization is necessary to provide a physical context to sensor readings for services such as intrusion detection, inventory, and supply chain management. It is also a fundamental task for sensor network services such as geographic routing and coverage area management. Over the last few decades, localization technologies have undergone significant progress and they now play a crucial role for many locations and context-aware services and applications such as navigation, robotics, patient monitoring, and emergency response systems. This work studies the topic of localization using Radio-Frequency (RF) technologies for several applications. We study the localization concept in the context of range-free, range-based and machine learning algorithms, presented in three chapters of this thesis. We aim at addressing the heterogeneity problem in Range-free localization algorithms where the non-uniform distribution of nodes and different transmission power are the main cause of heterogeneity. Our two proposed approaches improve the localization accuracy in heterogeneous networks using a joint route discovery and localization approach, and elliptical range estimation algorithm. The joint route discovery and localization algorithm deploys a variable range route discovery that improves the connectivity of nodes in a heterogeneous network and then performs a hop-length estimation for localization of nodes. In our other approach, we introduced an elliptical range-estimation, which is based on studying the shape and geometry of path between nodes in a heterogeneous network. The simulation results confirm the improvement of localization accuracy compared with popular range-free methods such as DV-hop, ZBLM, and EZBLM. In the next part of the thesis, we investigate the main challenges and problems of Range-based algorithms using RF technologies such as BLE, WiFi, XBee, and DSRC (IEEE802.11p). Mainly the fading characteristics of the wireless channel, i.e. path loss exponent, multipath fading, and shadowing, with unknown distribution, are the main issues with range-based methods. In the third chapter, we introduce several approaches to address these issues. First, we investigate the diversity concept to reduce the impact of the multipath fading on the received signal strength (RSS). We show that by using time diversity or transmitting beacon signals at different time slots, spatial diversity or using multiple antennas for transmitting beacons, and frequency diversity or transmitting beacons at different channels or bands, we can reduce the impact of multipath fading. We investigate these concepts by experimentation using BLE and WiFi in indoor environments. The experiment results demonstrate an improvement in ranging by leveraging the time diversity and averaging over the RSS samples at different time slots. Similar to time diversity, having multiple copies of a signal from different antennas can improve the ranging accuracy. The ranging accuracy significantly improves by using the frequency diversity by deploying WiFi beacons working in 2.4GHz and 5GHz bands. More specifically, a sub-meter accuracy was achieved using 5GHz for short distances, and for larger distances, 2.4GHz showed more accurate ranging. Besides the diversity concept, we introduce an algorithm based on multi-range beaconing where beacons are allowed to change their transmission power and range. We have shown that the multi-range beaconing is robust against multipath fading and can estimate the distance accurately even in the presence of deep fading. As the last part of the range-based localization algorithm, we focus on the application of RF technologies such as DSRC for ranging and localization in vehicular environments. Due to the dynamic of the environment, multipath fading and shadowing can significantly degrade the ranging performance. To address the localization accuracy, we introduced parametric and non-parametric (learning-based) approaches to estimating the distance and noise profile. The non-parametric algorithm leverages a learning approach and the mobility of devices (e.g. the vehicle) for estimating the distance of a transmitter and receiver device. The results demonstrate that by having enough RSS samples, we can reach an average ranging error of 1 meter. One of the main concern of this approach is the convergence time. We address this issue by using a filtering scheme and trilateration. Furthermore, we introduced a novel parametric algorithm to estimate the path loss exponent and shadowing distribution in a network of beacons using centroid localization algorithm. For the parametric approach, we also studied different parameters such as beacon configuration having direct impact on localization accuracy. The last chapter of the thesis leverages the power of artificial intelligence and machine learning frameworks as a new and interesting approach to solve the localization problem. We present a survey of existing work in this area and propose a supervised learning model for RSS-based localization in vehicular environments. The performance of the proposed approach shows a significant improvement in localization accuracy and convergence time for ranging.