A firewall is a security device that filters information (packets) entering and leaving a network. A firewall is often installed inside of a router making it a non separate device, as well as pre installed with an operating system. A secure firewall can prevent malware such as worms from infecting a network. It is always recommended to have a firewall in place. A network without a firewall is very dangerous and can infect the computers on a network a lot easier.
The user can ajust the firewall settings to their preference. You can control who can connect to the internet, what kind of content can be accessed, and what kind of connections can be made. You can allow only certain websites to be accessed by your computer as well as only allowing certain websites to access your computer. You can also block or disable ports.
Using a firewall with Windows is a must. However a firewall is generally not needed for a smartphone such as android. Android uses .apk files for apps so you have to grant permission for the malware to be installed. As long as you use the Google Play Store for apps and not other sources a firewall is not needed.
Even though smartphones dont get infected with malware that often, anti-virus can still be used just for precaution. A firewall is a very important part of internet security and should not be overlooked.