下载内容时,应用程序是通过谷歌更新玩? [英] Download content when app is updated via google play?

查看:154
本文介绍了下载内容时,应用程序是通过谷歌更新玩?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以这是我第一次要发送的更新我的应用程序,我不知道什么actully发生在一个应用程序通过谷歌播放更新,

So this is the first time I am going to send an update for my app and I don't know about what actully happens when an app is updated via google-play,

这里有一些问题,那些我无法得到的答案是:

Here are some questions those I couldn't get answer of :

  • 什么是真正更新,这个过程是如何工作的,即方法或回调时更新完成?

  • What is actually updated and how this process works i.e. methods or callbacks when update is done ?

发生了shared- preferences文件是什么,的名称值对更改/复位

What happens to the shared-preferences file, the name values pairs change/reset ?

比方说,我想从一台服务器,当应用程序通过谷歌更新播放下载一些文件,并做一些数据库操作在后台的文件。我怎样才能接近这个以正确的方式。

Let's say I want to download some file from a server , when the app is updated via google play and do some db operations with that file in the background. How can I approach this in the right way.

- 编辑 -

为了使它更清楚我想自动做一些处理,当应用程序被用户更新,他不刻意去打开应用程序,并实现这一点,我在找一个触发器是任何意图[隐性或显性]谷歌提供发挥我的应用​​程序。

To make it more clear I want to automatically do some processing when the app is updated by user and he doesn't bother to open the app and to achieve this I am looking for a trigger that is provided by google play to my app by any intent [implicit or explicit].

推荐答案

您需要实现广播接收器,获取通知的时候Paackage是beeing更换:
在你的清单包括:

You need to implement a Broadcast Receiver that gets notified when the Paackage is beeing replaced:
In your Manifest include:

<receiver android:name="my.package.MyReceiver">
  <intent-filter>
  <action android:name="android.intent.action.PACKAGE_REPLACED"/>
    <data android:scheme="package" /> 
  </intent-filter>
</receiver>

MyReceiver 需要扩展 android.content.BroadcastReceiver

要回答你的第二个问题:该共享preferences不受通过谷歌更新播放,因为是不是在你的应用程序的数据文件夹中的文件

The class MyReceiver needs to extend android.content.BroadcastReceiver

To Answer your second question: The SharedPreferences aren't affected by an update through Google Play, as aren't the files in your App's data-Folder.

这篇关于下载内容时,应用程序是通过谷歌更新玩?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆