Opportunistic Internet of Things (OppIoT) is a paradigm, technology, and system that promotes the opportunistic exploitation of interactions between loT devices to achieve increased connectivity, reliability, network capacity, and overall network lifetime. The increased demand for identifying such opportunistic exploitation is illustrated by loT scenarios, where the goal is to recognize when an opportunity for communication is possible, thereby allowing for data forwarding and routing. In an OppIoT system, devising a routing scheme is a challenging task due to the difficulty in guaranteeing the existence of connectivity between devices (nodes) and in identifying an intermediate node as a packet forwarder towards its destination. Considering that opportunistic networks (oppNets) are a subclass of OppIoT and considering IoT scenarios where the opportunistic exploitation of IoT devices is possible even in case the device's presence is uncertain or may change over time, this paper proposes a novel routing scheme for OppNets (called Location Prediction-based Forwarding for Routing using Markov Chain (LPFR-MC)) that can also be used in IoT scenarios. The proposed LPFR-MC scheme considers the node's present location and the angle formed by it and the corresponding source (resp. destination) to predict the node's next location or region using a Markov chain and to determine the probability of a node moving towards the destination. Simulation results are provided, showing that the proposed LPFR-MC outperforms the existing traditional protocols in terms of message delivery probability, hop count, number of messages dropped, message overhead ratio, and average buffer time.