  We employ almost periodicity to establish analogues of the Hardy--Stein
identity and the Littlewood--Paley formula for Hardy spaces of Dirichlet
series. A construction of Saksman and Seip shows that the limits in this
Littlewood--Paley formula cannot be interchanged. We apply this construction to
show that the limits in the definition of the mean counting function for
Dirichlet series cannot be interchanged. These are essentially statements about
the two different kinds of boundary values that we associate with Dirichlet
series that converge to a bounded analytic function in a half-plane. The
treatment of the mean counting function also involves an investigation of the
zero sets and Blaschke products of such Dirichlet series.
