The development of a short-wavelength p-n junction device is essentially important for the realization of transparent electronics for next-generation optoelectronics. Nickel oxide (NiO) thin films with a tunable electrical conductivity of both p-type and n-type under the optimized growth conditions using RF sputtering technique with high optical transmission in the visible region have been fabricated. The room-temperature conductivities for n-type and p-type NiO thin films were about and , respectively. A p-n junction of NiO thin film has been realized, successfully exhibiting good rectifying behavior with efficient UV photodiode characteristics, providing suitable solution for low-cost visible blind UV photodetector application.