the following discussion of the embodiments of the invention directed to a system and method that determines the best communication path to facilitate data transfer to provide screen projection from an electronic device to a display on a vehicle is merely exemplary in nature , and is in no way intended to limit the invention or its applications or uses . for example , while a vehicle environment is described herein , other environments for screen replication may be used . as stated above , electronic devices that are capable of being connected to a vehicle &# 39 ; s information and entertainment ( infotainment system ) is known to those skilled in the art , for the sake of simplicity , all electronic devices in the following discussion will be referred to as smartphones , but it is to be understood that the methods and systems described herein are applicable to any suitable electronic device . fig1 is a block diagram illustration of a vehicle 10 that includes communications architecture 12 that can be used to replicate a smartphone device screen on a vehicle display 30 . the display 30 is intended to represent any display that may be part of an infotainment system of the vehicle 10 . the vehicle communications architecture 12 includes a forward audio / video channel 14 , a reverse control channel 16 a transmission control protocol / user datagram protocol ( tcp / udp ) 18 , an internet protocol ( ip ) 20 and a flexible connectivity module 26 , which are described in detail below . a smartphone 22 is wirelessly connected to the communications architecture 12 , and a smartphone 24 is connected to the communications architecture 12 using a wired connection such as a universal serial bus ( usb ). while the smartphone 24 is connected via a wired connection according to this exemplary embodiment , the smartphone 24 may also connect using a wireless communications link . as is described in detail below , the flexible connectivity module 26 determines the communications links that are available for each phone and utilizes the most desirable communications link that is available . fig2 is an illustration of a block diagram of the vehicle communications architecture 12 in more detail . the forward audio / video channel 14 provides content to a user via the display 30 and includes video encoding at box 32 , such as h . 264 video encoding . audio encoding is provided at box 34 . the audio is ultimately provided to the user through speakers associated with the display 30 , although not shown for the sake of accuracy . packetized elementary stream ( pes ) packetization at box 36 carries the output of the video encoding at the box 32 and the output of the audio encoding at the box 34 into packets . high - bandwidth digital content protection ( hdcp ) at box 38 prevents copying of digital audio and video content as it travels across connections . a mpeg 2 . 0 transport stream at box 40 provides generic coding for transferring picture and associated audio data . a real - time transport protocol ( rtp ) at box 42 defines a standardized packet format for delivering audio and video from the mpeg 2 . 0 — ts at box 40 to the display 30 . the reverse control channel 16 includes a user input back channel ( uibc ) 44 and an audio back channel ( abc ) 46 to allow a user to provide commands via , for example , touchscreen events or button push events using the uibc 44 and / or microphone events using the abc 46 . a real time streaming protocol ( rtsp ) at box 48 controls streaming media servers in a manner known to those skilled in the art . the smartphone 22 and / or 24 features from the box 14 as well as user features of the vehicle 10 from the box 16 use a tcp / udp at box 18 that delivers files from one location to another in a manner known to those skilled in the art , and is a core protocol of the ip at box 20 . the flexible connectivity module 26 includes a connectivity manager 50 that determines the best connection to use between an electronic device , such as the smartphone 22 and / or 24 , and a vehicle infotainment system that includes a display in the vehicle 10 , such as the display 30 . when operating in a server - client mode 52 , the connectivity manager 50 utilizes usb tethering 54 or a wifi tethering 56 . the usb tethering 54 includes a plug - in communications link that uses a usb connection . the wifi tethering includes a communication link with one device being used as a router and the other devices connecting thereto . when the connectivity manager 50 is operating in a peer - to - peer mode 58 , the connectivity manager utilizes a wifi direct connection 60 or a wifi tunneled direct link setup ( tdls ) connection 62 . the wifi direct connection 60 could also include peer - to - peer negotiated connections such as bluetooth . the wifi tdls connection 62 includes an intermediary connection such as a phone as a hotspot or a vehicle as the hotspot . as is described in more detail below , the connectivity manager 50 determines the most optimal way to utilize the connections 54 , 56 , 60 and 62 . the connections 54 , 56 , 60 and 62 are merely exemplary in nature , other communications / medium such as wigig and other wireless communications may be used . content streams may use , by way of example , the usb tethering 54 and in parallel microphone input or output may use the wifi direct connection 60 . in addition , as is described in more detail below , data streams that are routed by the connectivity manager 50 may be re - routed by the connectivity manager as needed . fig3 is a flow diagram 70 of an algorithm for utilizing the connectivity manager 50 to connect electronic devices such as the smartphones 22 and 24 to the vehicle 10 according to one embodiment of the invention . at box 72 , smartphone service is provided to a smartphone in the vehicle 10 , such as , for example , the smartphone 24 . the smartphone 24 scans local connectivity options at box 74 and publishes the available options at box 76 . at box 78 , the connectivity manager 50 of the flexible connectivity module 22 establishes service to the vehicle 10 . the connectivity manager 50 scans local connectivity options on the vehicle 10 and publishes the available options at box 80 . next , the algorithm determines if matching technology between the connectivity options of the vehicle 10 and the connectivity options of the smartphone 24 is available . if matching technology is not found , the algorithm returns to box 80 and the connectivity manager 50 again scans local connectivity options . if matching technology between the connectivity options of the vehicle 10 and the connectivity options of the smartphone 24 are found at decision diamond 82 , the algorithm selects a preferred interface at box 84 . in determining what interface is preferred , the algorithm considers rule - based input at box 86 and / or a user selection upon user prompting at box 88 . some examples of rule - based inputs are user ranking , cost function , etc . any suitable rule - based input may be used . for example , when the smartphone 24 and the vehicle 10 connectivity options are scanned , the following table may result : table 1 shows four different connectivity options ( wifi direct , wifi tdls , wifi tethering and usb ) are possible , but only two of the possible options are found on both the vehicle 10 and the smartphone 24 ( wifi direct , usb ). in this example , the algorithm takes into consideration rule - based selection and user preference and determines that channel 11 at 24 megabytes using wifi direct is the preferred interface . the preferred interface is determined for the data that flows between the vehicle 10 and the smartphone 24 , and may vary for different data . for example , audio / video from the smartphone 24 may use usb tethering as the preferred interface , where microphone input may use wifi direct at the preferred interface . the algorithm may determine the preferred interface for each of the data boxes 32 - 42 of the forward audio / video channel at the box 14 and for each of the boxes 44 - 48 of the reverse control channel at the box 16 to deliver using the most efficient communication path for the data . once the preferred interface is selected at the box 84 , parameter exchange occurs at box 90 and a session is established at box 92 . once the session is established at the box 92 , the screen of the smartphone 24 is projected to the vehicle display 30 . the session is monitored at box 96 and the algorithm determines if there is a performance failure at decision diamond 98 . if no , the algorithm returns to the box 94 and continues to project the screen of the smartphone 24 to the vehicle display 30 . if there is a performance failure , the algorithm returns to the box 84 and selects a new preferred interface . for example , if the smartphone 24 is connected using wifi direct as the preferred interface , and a second passenger with a second smartphone 22 enters the vehicle , the wifi in the smartphone 24 may interfere with the wifi direct preferred interface between the vehicle 10 and the smartphone 24 . if interference occurs that causes a predetermined performance degradation , a performance failure is detected by the algorithm at decision diamond 98 and the preferred interface may be re - selected at the box 84 . for example , to correct the interference , wifi direct may still be used but the chosen operational parameters , for example , frequency range , may be changed to prevent interference between the smartphones 22 and 24 . thus , a new session of the wifi preferred interface may be created for the smartphone 24 to compensate for the presence of the smartphone 22 . alternatively , the new preferred interface could result in switching from wifi to usb for the smartphone 24 at the box 84 . using the algorithm above , high - quality video and screen replication of the smartphone 24 to the display 30 may be achieved using the optimal qualified physical medium , i . e ., connection that is available and not simply a user selected connection as is known to those skilled in the art . as will be well understood by those skilled in the art , the several and various steps and processes discussed herein to describe the invention may be referring to operations performed by a computer , a processor or other electronic calculating device that manipulate and / or transform data using electrical phenomenon . those computers and electronic devices may employ various volatile and / or non - volatile memories including non - transitory computer - readable medium with an executable program stored thereon including various code or executable instructions able to be performed by the computer or processor , where the memory and / or computer - readable medium may include all forms and types of memory and other computer - readable media . the foregoing discussion disclosed and describes merely exemplary embodiments of the present invention . one skilled in the art will readily recognize from such discussion and from the accompanying drawings and claims that various changes , modifications and variations can be made therein without departing from the spirit and scope of the invention as defined in the following claims .