The available location-based services on mobile devices, such as smartphones, are growing exponentially. These services were provided mostly in outdoor and open area, due to easy positioning systems using Global Position System (GPS) in the past, while indoor positioning system has attracted attention recently. The methods and algorithms for indoor positioning system have been studied thoroughly in this thesis. IEEE 802.11 wireless technology standard (WLAN) seems to be one of the best choices. Being ubiquitous and the opportunity for indoor positioning system implementation without any new infrastructure is one of the main reasons for using this standard. The proposed method in this thesis is one of the scene analysis category subsets. One of the advantages of this method, in addition to using WLAN standard, is that positioning can be done without any knowledge about Access Point locations. Considering the fact that positioning issue can be modeled by a sparse problem, compressive sensing theory can be used for solving indoor positioning problem. Obstacles, such as human body, affect the received signal strength when using Omni-directional antennas, and therefore, user’s direction would affect RSSI. Therefore, the smartphones magnetometer is used for extracting user’s orientation information in order to reduce -minimization problem complexity in compressive sensing. The proposed method has been implemented partially on Smartphones with Android operating system, and the rest of system is implemented in PC, using MATLAB software. Simulation and implementation results demonstrate average positioning error improvement to less than 1.2 m. Keywords: Location based services (LBS), Indoor positioning system, Compressive sensing, Compass, Wireless Local Area Network (WLAN)