A computer-implemented method for detecting state change of a mobile device based on context data, the method comprising: - forming, by training, a codebook of random index vectors, said random index vectors corresponding to words; - obtaining data from one or more sensors and/or applications of the mobile device, and forming the obtained data into words; - generating a first set of context tags from the words being formed from data obtained in a first time span; - generating at least one second set of context tags from the words being formed from data obtained in a second time span, wherein said first time span and said second time span are at least partly different; - determining a first random index context vector by summing random index vectors of words of the first set of context tags, the first random index context vector being representative of a first context; - determining a second random index context vector by summing random index vectors of words of the second sets of context tags, the second random index context vector being representative of second context; - wherein the random index vectors of the words have been obtained from the codebook of random index vectors, said random index vectors corresponding to words; - determining, by said computer system, a difference between the first context and the second context by computing a distance between the first random index context vector and the second random index context vector; - as a response to the determined difference, determining, by said computer system, that the context has changed from the first time span to the second time span, and performing one or more of the following: adapting a user interface of a mobile device, controlling applications or information processing of the mobile device. - forming, by training, a codebook of random index vectors, said random index vectors corresponding to words; - obtaining data from one or more sensors and/or applications of the mobile device, and forming the obtained data into words; - generating a first set of context tags from the words being formed from data obtained in a first time span; - generating at least one second set of context tags from the words being formed from data obtained in a second time span, - determining a first random index context vector by summing random index vectors of words of the first set of context tags, the first random index context vector being representative of a first context; - determining a second random index context vector by summing random index vectors of words of the second sets of context tags, the second random index context vector being representative of second context; - wherein the random index vectors of the words have been obtained from the codebook of random index vectors, said random index vectors corresponding to words; - determining, by said computer system, a difference between the first context and the second context by computing a distance between the first random index context vector and the second random index context vector; - as a response to the determined difference, determining, by said computer system, that the context has changed from the first time span to the second time span, and performing one or more of the following: adapting a user interface of a mobile device, controlling applications or information processing of the mobile device.