Yes every app gets killed during update-refer my answer here
You can make your service as STICKY service,this services are restarted when killed.From the docs:
public static final int START_STICKY
Added in API level 5
Constant to return from onStartCommand(Intent, int, int): if this
service's process is killed while it is started (after returning from
onStartCommand(Intent, int, int)), then leave it in the started state
but don't retain this delivered intent. Later the system will try to
re-create the service. Because it is in the started state, it will
guarantee to call onStartCommand(Intent, int, int) after creating the
new service instance; if there are not any pending start commands to
be delivered to the service, it will be called with a null intent
object, so you must take care to check for this.
Other thing you can try is detect app update and start the service again.To detect app update you can listen to PACKAGE_INSTALL broadcast or use following workaround:
- Implement a dummy database and override SQLiteOpenHelper.html onUpgrade().The onUpgrade() method is called whenever a new database version is installed.For more info-refer here
- Now everytime you have a new update for an app..update the database version too.In this way you will have one to one mapping between database version and the app version.
- Now when the user updates the app onUpgrade() is called and you can write whatever logic you want to track the update.(If you are using database in your app, you might need some extra logic to differentiate between actual database upgrade and app upgrade.)