Nanodevices for photonics and electronics: Advances and applications