Q:

Identify the sphere bundle of a complex line bundle $BD_{2n}\to BU(1)$

I'd like to know whether it is possible to identify the sphere bundle arising as follow:
Let $\xi \colon BD_{2n}\to BU(1)$ the complex line bundle corresponding to the element $y^2 \in H^2(D_{2n};\Bbb Z) \cong \Bbb Z_2\langle x^2,y^2\rangle$ (we assume $n=0 \pmod{4}$ and $D_{2n}$ is the dihedral group of order $2n$). 
Let $q\colon S(\xi) \to BD_{2n}$ be the sphere bundle of $\xi$. It's easy to see that it's a Eilenberg MacLane space $K(G,1)$ where $G$ sits in the following s.e.s.  $$0 \to \Bbb Z \to G \to D_{2n} \to 0$$
which arises from the following piece of l.e.s.  of a fibration 
$$0 \to \pi_2(\Bbb CP^{\infty}) \to \pi_1(S(\xi)) \xrightarrow{\pi_1(q)} \pi_1(BD_{2n}) \to 0$$
I'd like to identify such $G$. The Serre exact sequence in homology (integer coefficient) gives us the following exact sequence:

Since it's know that $H_2(BD_{2n})\cong \Bbb Z_2$, we have that $H_2(BU(1))\hookrightarrow H_1(S(\xi))$ which means that the exact sequence gives us $$0 \to \Bbb Z \to H_1(S(\xi)) \to \Bbb Z_2 \oplus \Bbb Z_2 \to 0$$
which implies that $H_1(S(\xi))$ cannot be a finite abelian group.  In particular we already have that that $G \neq D_{\infty}$ since $H_1(D_{\infty})=ab(D_{\infty})=\Bbb Z_2\oplus \Bbb Z_2$.
From the exact sequence  retrieved by the dual Blakers Massey Theorem (see here, in our case the base space is $1$-connected and the map is $1$-connected)

I was able to retrive this informations: $H^1(S(\xi);\Bbb Z)\cong \Bbb Z$, the boundary map $\delta \colon H^1(S(\xi);\Bbb Z) \to H^2(\Bbb C P^{\infty})$ is multiplication by $2$ and $H^2(S(\xi);\Bbb Z)\cong \Bbb Z_2$ since I know explicitly the map $H^2(BU(1))\to H^2(BD_{2n})$. 
Is there a way to identify such $G$ completely? 

A:

As is described in any standard group cohomology textbook, if $Q$ is a group and $A$ is an abelian group, then elements of $H^2(Q;A)$ correspond to central group extensions $A \rightarrow G \rightarrow Q$. 
You are asking for a particular case of this.   As you have described your particular element of $H^2(D_{2n};\mathbb Z)$ by its image in $H^2(D_{2n};\mathbb Z/2)$, one might also wish to describe the extension $\mathbb Z/2 \rightarrow \bar G \rightarrow D_{2n}$, the quotient of $G$ by $2\mathbb Z$. 
It should be easy to calculate the mod 2 cohomology of $\bar G$.  I have just be fooling with this when $n$ is a power of 2.   One learns that when $n=4$, $\bar G$ will be group no.  4 of order 16 as described on Simon King and David Green's remarkable group cohomology website http://users.minet.uni-jena.de/cohomology/.  When $n=8$, $\bar G$ will be group no.  12 of order 32.   I am guessing that when $n=2^k$, $\bar G$ will also be the extension associated to the canonical element in $H^2(D_{2^k}; H_2(D_{2^k};\mathbb Z/2))$, and is a 2-central group of rank 2. ( 2-central = all elements of order 2 are central.)   

A:

Your cohomology class in $H^2(D_{2n},\mathbb{Z})$ comes from a homomorphism $D_{2n} \to S^1$, which factors as $D_{2n} \to \mathbb{Z}/2 \to S^1$, where the map $D_{2n} \to \mathbb{Z}/2$ sends the rotation to $0$ and the reflection to $1$. 
So, you have maps $BD_{2n} \to B \mathbb{Z}/2 \to BS^1$, and you want to compute the homotopy fiber of this composition.  To do this, first compute the homotopy fiber of the map $B \mathbb{Z}/2 \to BS^1$. This corresponds to the unique nontrivial central extention of $\mathbb{Z}/2$ by $\mathbb{Z}$, i.e. $\mathbb{Z} \to \mathbb{Z} \to \mathbb{Z}/2$. 
Now, you have a homotopy pullback diagram, where $G$ is the group you are trying to compute:
$$
\require{AMScd}
\begin{CD}
BG   @>  >> 
B \mathbb{Z} \\
@VVV @VVV  \\
BD_{2n} @> >> B \mathbb{Z}/2 
\end{CD}
$$
Taking fundamental groups doesn't preserve pullbacks in general, but it does when everything in sight is the classifying space of a discrete group.  So, $G$ is the fiber product $D_{2n} \times_{\mathbb{Z}/2} \mathbb{Z}$, where the map $D_{2n} \to \mathbb{Z}/2$ is the one mentioned earlier. 
Algebraically speaking, you have some central extension of $D_{2n}$ by $\mathbb{Z}$, and it is pulled back from a known central extension of $\mathbb{Z}/2$ by $\mathbb{Z}$, so you can use this to figure out what the extension is.