Android的更新应用程序编程 [英] Android update app programmatically

查看:180
本文介绍了Android的更新应用程序编程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序,但我想更新它,我读了计算器(更新应用程序编程)

的一些后

  

<一个href=\"http://stackoverflow.com/questions/22709443/android-programmatically-update-application-when-a-new-version-is-available\">Android当有新版本可用编程方式更新应用程序


  
  

更新APK编程(无根)


但没有说服我。

我想就如何更新应用程序的信息。

现在我的应用程序没有上传过对谷歌玩,我有它的apk。


  

我想升级使用按钮[更新点击这里],她说她是
  要负起责任来。HTTP:www.site/myapk.apk,并更新


为什么说APK?因为每个星期我会更新我的应用程序了一下。

如果他们必须随时下载APK,这是非常令人沮丧的。

有一个简单而干净的方式(与code)?


解决方案

请访问此链接可能会得到一些想法的链接

它的步骤如下:


  

1创建您的应用可以轮询每当应用程序Web服务
  发布会或基于一些时间限制,可以检查是否有新的
  版本在那里。


  
  <醇开始=2>
  
  • 此Web服务应该返回在服务器上的应用程序的URI一起主办的apk文件的最新版本
      有新的版本文件。


  •   
  • 在你的应用程序会从Web服务的响应,它会解析JSON,并检查您的应用程序版本,它是最新版本
      在服务器上可用。


  •   
  • 如果您的应用程序版本比它会提示用户开始下载最新的版本低。新的应用程序的下载
      通过下载管理器来处理。


  •   
  • 下载管理器将使用广播接收器下载完成时通知您的应用程序。


  •   
  • 的应用程序的最新版本完成文件的之后,你可以开始活动,安装/更新该文件。


  •   

    I have an app, but I want to update it, I read some post of "stackoverflow" (update application programmatically)

    Android programmatically update application when a new version is available

    update apk programmatically (without root)

    but none convince me.

    I would like information on how to update an app.

    Right now my app is not uploaded on google play, I have it in apk.

    I would upgrade using a button [update click here], and that she is going to take charge "http:www.site/myapk.apk" and to update.

    Why say the apk? because every week I will update my app a bit.

    And if they have to always download the apk, it is very frustrating.

    There an easy and clean way (with code)?

    解决方案

    please visit this link you may get some idea LINK

    It follows these steps ::

    1 Create a Web Service which your app can poll whenever the app launches or based on some time limit that can check if there is new version out there.

    1. This Web service should return the lastest Version of the apk file that is hosted on the Server along with the URI of the application file that has the new version.

    2. When your app gets the response from the Web Service, it will parse the JSON and check your app version to the lastest version that is available on the server.

    3. If your app version is lower than the latest version it will prompt the user to start the download process. The download of the new app is handled by the Download Manager.

    4. The download manager will notify your app using Broadcast receiver when the download is complete.

    5. After completion of the latest version of the application file the you can start the activity to install/update that file.

    这篇关于Android的更新应用程序编程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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