A novel method for the selective and localized synthesis and integration of nanostructures to the functional microdevices has been developed. This method is based on the localized hydrothermal reaction control by microscale heaters. By applying an electrical bias across micro/nanoscale wires, a localized temperature field is generated via Joule heating of the wires. Then, the hydrothermal reaction of the metal oxide precursor solution induces localized synthesis and in-situ integration of nanostructures near the heated micro/nano wires. We have applied this method to the zinc oxide (ZnO) nanowires and demonstrated a UV -sensitive photodetector device based on the integrated ZnO nanowires.