Gallium nitride nanowire based nanogenerators and light-emitting diodes