Next-generation mobile networks (5G) are defined to provide access in the framework of heterogeneous systems where it is crucial to have “always on” and “everywhere connectivity” capabilities. This is of fundamental importance even in 4G mobile systems, down to 3G and also Wi-Fi and WiMAX. In order to guarantee access to users with handheld devices equipped with multiple radio interfaces, an automated and reconfigurable tool for selecting the best network to be connected with is needed. This should be achieved by avoiding service outages. Current vertical handovers, i.e., switching from a network to another, are essentially based on power received levels and often do not avoid temporary service outages. We propose in this paper a procedure to access mobile networks by sensing multiple performance parameters related to networks available in the considered area. We target at maximizing the probability of accessing the wireless medium despite the technology used. We develop an algorithm, based on dynamic programming, able to select the most suitable network. We present the performance of the proposed algorithm both on the basis of computer simulations and on tests performed in an Arduino-based hardware platform