摘要 |
In a method for naming an electronic device, a hash table including indices and corresponding character strings is preset. The electronic device is controlled to enter into a searchable state, and inserts a default name of the electronic device in a searchable device list. A shaking angle of the electronic device is calculated according to detected coordinate values acquired from a gravity sensor, when the electronic device is shaking in the searchable state and the default name needs to be changed. A hash value is calculated using the shaking angle, a UNIX timestamp, a number of the indices in the hash table, and a predetermined formula. The method further determines an index that is the same as the hash value, determines a character string corresponding to the determined index, and renames the electronic device using the determined character string.
|