an electronic device using a lens module is disclosed . the lens module for a housing , comprises a barrel comprising a containing portion ; and at least one lens insert molded mounted in the containing portion ; wherein the containing portion comprises an inner sidewall , and a first latching portion in the inner sidewall ; the at least one lens comprises a main body , and a second latching portion extends outward from a side surface of the main body ; the second latching portion is received in the first latching portion .