Anti-aircraft warfare
With little experience in the role, no means of measuring target, range, height or speed the difficulty of observing their shell bursts relative to the target gunners proved unable to get their fuse setting correct and most rounds burst well below their targets. The exception to this rule was the guns protecting spotting balloons, in which case the altitude could be accurately measured from the length of the cable holding the balloon.
The first issue was ammunition. Before the war it was recognised that ammunition needed to explode in the air. Both high explosive (HE) and shrapnel were used, mostly the former. Airburst fuses were either igniferious (based on a burning fuse) or mechanical (clockwork). Igniferious fuses were not well suited for anti-aircraft use. The fuse length was determined by time of flight, but the burning rate of the gunpowder was affected by altitude. The British pom-poms had only contact-fused ammunition. Zeppelins, being hydrogen-filled balloons, were targets for incendiary shells and the British introduced these with airburst fuses, both shrapnel type-forward projection of incendiary "pot" and base ejection of an incendiary stream. The British also fitted tracers to their shells for use at night. Smoke shells were also available for some AA guns, these bursts were used as targets during training.
German air attacks on the British Isles increased in 1915 and the AA efforts were deemed somewhat ineffective, so a Royal Navy gunnery expert, Admiral Sir Percy Scott, was appointed to make improvements, particularly an integrated AA defence for London. The air defences were expanded with more RNVR AA guns, 75 mm and 3-inch, the pom-poms being ineffective. The naval 3-inch was also adopted by the army, the QF 3-inch 20 cwt (76 mm), a new field mounting was introduced in 1916. Since most attacks were at night, searchlights were soon used, and acoustic methods of detection and locating were developed. By December 1916 there were 183 AA sections defending Britain (most with the 3-inch), 74 with the BEF in France and 10 in the Middle East.
AA gunnery was a difficult business. The problem was of successfully aiming a shell to burst close to its target's future position, with various factors affecting the shells' predicted trajectory. This was called deflection gun-laying, where "off-set" angles for range and elevation were set on the gunsight and updated as their target moved. In this method, when the sights were on the target, the barrel was pointed at the target's future position. Range and height of the target determined fuse length. The difficulties increased as aircraft performance improved.
The British dealt with range measurement first, when it was realised that range was the key to producing a better fuse setting. This led to the height/range finder (HRF), the first model being the Barr & Stroud UB2, a two-metre optical coincident rangefinder mounted on a tripod. It measured the distance to the target and the elevation angle, which together gave the height of the aircraft. These were complex instruments and various other methods were also used. The HRF was soon joined by the height/fuse indicator (HFI), this was marked with elevation angles and height lines overlaid with fuse length curves, using the height reported by the HRF operator, the necessary fuse length could be read off.
However, the problem of deflection settings — "aim-off" — required knowing the rate of change in the target's position. Both France and the UK introduced tachymetric devices to track targets and produce vertical and horizontal deflection angles. The French Brocq system was electrical; the operator entered the target range and had displays at guns; it was used with their 75 mm. The British Wilson-Dalby gun director used a pair of trackers and mechanical tachymetry; the operator entered the fuse length, and deflection angles were read from the instruments.
By the start of World War I, the 77 mm had become the standard German weapon, and came mounted on a large traverse that could be easily transported on a wagon. Krupp 75 mm guns were supplied with an optical sighting system that improved their capabilities. The German Army also adapted a revolving cannon that came to be known to Allied fliers as the "flaming onion" from the shells in flight. This gun had five barrels that quickly launched a series of 37 mm artillery shells.
As aircraft started to be used against ground targets on the battlefield, the AA guns could not be traversed quickly enough at close targets and, being relatively few, were not always in the right place (and were often unpopular with other troops), so changed positions frequently. Soon the forces were adding various machine-gun based weapons mounted on poles. These short-range weapons proved more deadly, and the "Red Baron" is believed to have been shot down by an anti-aircraft Vickers machine gun. When the war ended, it was clear that the increasing capabilities of aircraft would require better means of acquiring targets and aiming at them. Nevertheless, a pattern had been set: anti-aircraft warfare would employ heavy weapons to attack high-altitude targets and lighter weapons for use when aircraft came to lower altitudes.

Interwar years: World War I demonstrated that aircraft could be an important part of the battlefield, but in some nations it was the prospect of strategic air attack that was the main issue, presenting both a threat and an opportunity. The experience of four years of air attacks on London by Zeppelins and Gotha G.V bombers had particularly influenced the British and was one of if not the main driver for forming an independent air force. As the capabilities of aircraft and their engines improved it was clear that their role in future war would be even more critical as their range and weapon load grew. However, in the years immediately after World War I, the prospect of another major war seemed remote, particularly in Europe, where the most militarily capable nations were, and little financing was available.
Four years of war had seen the creation of a new and technically demanding branch of military activity. Air defence had made huge advances, albeit from a very low starting point. However, it was new and often lacked influential 'friends' in the competition for a share of limited defence budgets. Demobilisation meant that most AA guns were taken out of service, leaving only the most modern.
However, there were lessons to be learned. In particular the British, who had had AA guns in most theatres in action in daylight and used them against night attacks at home. Furthermore, they had also formed an Anti-Aircraft Experimental Section during the war and accumulated large amounts of data that was subjected to extensive analysis. As a result, they published the two-volume Textbook of Anti-Aircraft Gunnery  in 1924–1925. It included five key recommendations for HAA equipment:

Shells of improved ballistic shape with HE fillings and mechanical time fuses
Higher rates of fire assisted by automation
Height finding by long-base optical instruments
Centralised control of fire on each gun position, directed by tachymetric instruments incorporating the facility to apply corrections of the moment for meteorological and wear factors
More accurate sound-location for the direction of searchlights and to provide plots for barrage fire
Two assumptions underpinned the British approach to HAA fire; first, aimed fire was the primary method and this was enabled by predicting gun data from visually tracking the target and having its height. Second, that the target would maintain a steady course, speed and height. This HAA was to engage targets up to 24,000 ft (7.3 km). Mechanical time fuses were required because the speed of powder burning varied with height, so fuse length was not a simple function of time of flight. Automated fire ensured a constant rate of fire that made it easier to predict where each shell should be individually aimed.
In 1925 the British adopted a new instrument developed by Vickers. It was a mechanical analogue computer - the Predictor AA No 1. Given the target height, its operators tracked the target and the predictor produced bearing, quadrant elevation and fuse setting. These were passed electrically to the guns, where they were displayed on repeater dials to the layers who "matched pointers" (target data and the gun's actual data) to lay the guns. This system of repeater electrical dials built on the arrangements introduced by British coast artillery in the 1880s, and coast artillery was the background of many AA officers. Similar systems were adopted in other countries and for example the later Sperry M3A3 in the US, was also used by Britain as the Predictor AA No 2. Height finders were also increasing in size; in Britain, the seven-foot optical base World War I Barr & Stroud UB 2 stereoscopic rangefinder was replaced by the nine-foot optical base UB 7  and the eighteen-foot optical base UB 10 (only used on static AA sites). Goertz in Germany and Levallois in France produced five m (16 ft) instruments. However, in most countries the main effort in HAA guns until the mid-1930s was improving existing ones, although various new designs were on drawing boards.
From the early 1930s eight countries developed radar; these developments were sufficiently advanced by the late 1930s for development work on sound-locating acoustic devices to be generally halted, although equipment was retained. Furthermore, in Britain the volunteer Observer Corps formed in 1925 provided a network of observation posts to report hostile aircraft flying over Britain.