Method for updating application and electronic device thereof
An electronic device is provided. The electronic device includes a communication module, a memory, and a processor operatively connected with the communication module and the memory, wherein the memory stores instructions which, when executed, cause the processor to, based on application information of a specific application installed in the electronic device, receive app store source change information for updating the specific application, identify whether a higher version of the specific application exists in an app store which is to update the specific application, the app store being identified based on the app store source change information relating to the specific application, and update the specific application by receiving an application package of the higher version from the identified app store.
1 . An electronic device comprising:
a communication module;
memory, comprising one or more storage media, storing instructions and a setting database including information on a source of an application installed on the electronic device; and
at least one processor operatively connected with the communication module and the memory,
wherein the instructions, when executed by the at least one processor individually or collectively, cause the electronic device to:
based on detecting an event for changing an app store of an application installed on the electronic device, identify app store source change information with respect to the application, the app store source change information including information on a target app store with respect to the application and version information for updating the application,
compare the source of the application stored in the setting database with the information on the target app store in the app store source change information,
when the source of the application stored in the setting database is different from the target app store in the app store source change information, update the application by receiving an update file for the application from the target app store, and
update the setting database by changing the source of the application stored in the setting database to the target app store in the app store source change information.
2 . The electronic device of claim 1 , wherein the instructions, when executed by the at least one processor individually or collectively, further cause the electronic device to receive the app store source change information through the target app store in the app store source change information.
3 . The electronic device of claim 2 , wherein the instructions, when executed by the at least one processor individually or collectively, further cause the electronic device to:
obtain the app store source change information from a file received from the target app store in the app store source change information; and
store the app store source change information in a store database through a store manager.
4 . The electronic device of claim 3 , wherein the instructions, when executed by the at least one processor individually or collectively, further cause the electronic device to:
identify the source of the application stored in the setting database through the store manager; and
store the app store source change information in the store database in case that the source of the application stored in the setting database is different from the target app store in the app store source change information.
5 . The electronic device of claim 3 , wherein the instructions, when executed by the at least one processor individually or collectively, further cause the electronic device to:
identify the app store source change information stored in the store database through a store app corresponding to the target app store in the app store source change information; and
receive the update file of the application from the target app store in the app store source change information.
6 . The electronic device of claim 3 , wherein the instructions, when executed by the at least one processor individually or collectively, further cause the electronic device to, in case that the updating of the application is completed, delete the app store source change information from the store database through the store manager.
7 . The electronic device of claim 1 , wherein the instructions, when executed by the at least one processor individually or collectively, further cause the electronic device to receive the app store source change information through an app store which is the source of the application stored in the setting database.
8 . The electronic device of claim 7 , wherein the instructions, when executed by the at least one processor individually or collectively, further cause the electronic device to:
receive another update file of the application from the target app store in the app store source change information; and
obtain the app store source change information from a file included in the other update file.
9 . The electronic device of claim 8 , wherein the instructions, when executed by the at least one processor individually or collectively, further cause the electronic device to:
store the app store source change information in a store database through a store manager;
identify the app store source change information stored in the store database through a store app corresponding to the target app store in the app store source change information; and
receive the update file of the higher version from the target app store in the app store source change information.
10 . The electronic device of claim 9 , wherein the instructions, when executed by the at least one processor individually or collectively, further cause the electronic device to, in case that a plurality of store apps are identified based on the app store source change information through the store manager, identify an app store corresponding to a store app installed in the electronic device according to a priority among the plurality of store apps as the app store which is to update the application.
11 . A method of an electronic device, the method comprising:
based on the detecting an event for changing an app store of an application installed on the electronic device, identifying app store source change information with respect to the application, the app store source change information including information on a target app store with respect to the application and version information for updating the application;
comparing the source of the application stored in a setting database with the information on the target app store in the app store source change information;
when the source of the application stored in the setting database is different from the target app store in the app store source change information, updating the application by receiving an update file for the application from the target app store; and
updating the setting database by changing the source of the application stored in the setting database to the target app store in the app store source change information.
12 . The method of claim 11 , wherein the receiving of the app store source change information comprises receiving the app store source change information through the target app store in the app store source change information.
13 . The method of claim 12 , further comprising:
obtaining the app store source change information from a file received from the target app store in the app store source change information; and
storing the app store source change information in a store database through a store manager.
14 . The method of claim 13 , further comprising:
identifying the source of the application stored in the setting database through the store manager,
wherein the storing of the app store source change information comprises storing the app store source change information in the store database in case that the source of the application stored in the setting database is different from the target app store in the app store source change information.
15 . The method of claim 13 , further comprising:
identifying the app store source change information stored in the store database through a store app corresponding to the target app store in the app store source change information; and
receiving the update file of the application from the target app store in the app store source change information.
16 . The method of claim 13 , further comprising:
in case that the updating of the application is completed, deleting the app store source change information from the store database through the store manager.
17 . The method of claim 11 , wherein the receiving of the app store source change information comprises receiving the app store source change information through an app store which is the source of the application stored in the setting database.
18 . The method of claim 17 , further comprising:
receiving another update file of the application from the target app store in the app store source change information; and
obtaining the app store source change information from a file included in the other update file.
19 . The method of claim 18 , further comprising:
storing the app store source change information in a store database through a store manager;
identifying the app store source change information stored in the store database through a store app corresponding to the target app store in the app store source change information; and
receiving the update file of the higher version from the target app store in the app store source change information.
20 . The method of claim 19 , wherein the identifying of the app store comprises, in case that a plurality of store apps are identified based on the app store source change information through the store manager, identifying an app store corresponding to a store app installed in the electronic device according to a priority among the plurality of store apps as the app store which is to update the application.