Modifying the genomes of many organisms is becoming as easy as manipulating DNA in test tubes, which is made possible by two recently developed techniques based on either the customizable DNA binding protein, TALEN, or the CRISPR/Cas9 system. Here, we describe a series of efficient applications derived from these two technologies, in combination with various homologous donor DNA plasmids, to manipulate the Drosophila genome: (1) to precisely generate genomic deletions; (2) to make genomic replacement of a DNA fragment at single nucleotide resolution; and (3) to generate precise insertions to tag target proteins for tracing their endogenous expressions. For more convenient genomic manipulations, we established an easy-to-screen platform by knocking in a white marker through homologous recombination. Further, we provided a strategy to remove the unwanted duplications generated during the "ends-in" recombination process. Our results also indicate that TALEN and CRISPR/Cas9 had comparable efficiency in mediating genomic modifications through HDR (homology-directed repair); either TALEN or the CRISPR/Cas9 system could efficiently mediate in vivo replacement of DNA fragments of up to 5 kb in Drosophila, providing an ideal genetic tool for functional annotations of the Drosophila genome.