WiFi frequencies are high enough that useful antennas can be quite small. It therefore isn't that hard to build the antennas into the case. Here is a extreme example of a WiFi antenna built right onto the PC board of a WiFi module. It can be seen near the top of the picture at the top right of the WiFi module.
The whole module from the ends of the solder pads on one side to the ends of the solder pads on the other side is about 1 inch. The antenna itself is only about 13mm left to right in the picture. The parts surrounding the WiFi module on the base board are 0805 packages.
This is referred to as a meander antenna, which is a specific type of folded dipole.
Advantages:
- Improve omnidirectionality
- Smaller space requirements
Disadvantages:
- Tuning becomes more critical
- Losses are higher than a standard dipole
The Freescale App note, "Compact Integrated Antennas" gives a brief overview of several options, included the meander, for on-PCB antennas. It doesn't give specific design parameters.
A 1982 dissertation, "Meander Antennas" provides some guidance on the mathematical models used to understand and design meander antennas, but goes rather deeper than most EEs will want to venture for simply designing an antenna.
The reality today is that most PCB antenna design of this type is usually done with the aid of an antenna design CAD package. The antenna performance depends on not just the physical layout, but also the materials used, and the shape of those materials, for the PCB substrate, copper, and mask. The software still has some limitations, and so extensive testing is done to validate and tweak the design once it's fabricated. An example of free antenna analysis software is 4nec2 which can evaluate many types of antennas.
When designing a meander antenna, start with a trace the length of the ideal dipole, fold it into the desired shape and space, then perform numerical analysis to determine the radiation pattern and efficiency. Some CAD software has wizards that can help you choose an optimal pattern for a given space, but I have not yet seen a book or guide that gives optimal pattern information that can be applied generally to meander antennas.
Best Answer
Short answer: external antennas are unattractive to the user. The consumer drives the market, and these days, consumers want thinner, lighter, faster, etc. This is actually a huge problem for antennas because the physics are fundamentally limiting.
Most antennas in cell phones are some sort of variant of a PIFA (planar inverted-F antenna). Antenna-Theory has some cool articles on PIFAs and the now-famous iPhone 4 antenna. PIFAs are fairly pattern invariant, and provide a decent impedance match. They have low gain but if you do a link budget calculation, you'll see that your noise floor is like -110 dBm (I think... I forget but somewhere in that range).
The miracle that makes phones work is digital communications. Advanced modulation, extremely robust protocols, MIMO, etc have all contributed to ensuring communication even when the antenna on the phone itself is a terrible radiator (-5 dBi gain). If you do the link budget calculation to reach the nearest tower, you'd see that it works, so long as your link budget factors in all of the communication properties. That is, you have to consider what signal level the radio (cell phone) needs to demodulate the digital data and get information. Beyond analog gain (antenna, amplifiers, etc), you have digital gain through things like error-control coding (i.e. coding gain) and robust modulation techniques like OFDM (the standard for LTE and the future). Multiple access techniques (CDMA, TDMA), and MIMO also contribute to this. If you look at the "generation standards" like 3G and 4G, you'll see where on the protocol level things get super complicated. All of this goes into making cell networks work.
There's been a huge hiring thrust in the mobile industries to hire antenna engineers to design functioning antennas for thin phones. One of the toughest challenges facing folks now is that cell phones need many antennas that all couple and communicate on the same bands. So you have to be able to integrate multiple radios and antennas on a small platform and make sure everything works. When you don't do it right, you get the iPhone 4/4S... :-)