Localization is an important task in various fields. Especially, a robust and accurate localization system is required for a mobile device to be used in AR (augmented reality) or MR (mixed reality) applications. In this paper, we present an accurate visual-inertial odometry algorithm based on both point and line features. This algorithm utilizes a sliding window non-linear optimization-based method to reduce the computational cost. We implemented our proposed algorithm on a smartphone. Also, we show that our proposed algorithm works well in indoor and outdoor environments in real-time.