简体   繁体   English

升级apk从自己的网络服务器下载

[英]Upgrade apk downloaded from own web server

I need help in upgrading apk file. 我需要帮助升级apk文件。 I have apk file developed for android 2.2 and I donot wish to publish my apk on android market. 我有为Android 2.2开发的apk文件,我不想在Android市场上发布我的apk。 I published apk in our own webserver. 我在自己的网络服务器上发布了apk。 And i could download it to my android mobile. 我可以将它下载到我的Android手机上。 Now the issue is that how can i upgrade apk file by publishing in our webserver. 现在问题是如何通过在我们的网络服务器中发布来升​​级apk文件。

My questions are: 我的问题是:

  1. How android market does apk upgrading? android市场如何进行apk升级?

  2. How to upgrade a binary in android mobile with new version of which old version is already installed? 如何使用已安装旧版本的新版本升级Android手机中的二进制文件?

  3. I used android built in view using intent which actually Re-installs apk not upgrading.But i don't want prompts asking "Do u want to install application?". 我使用android内置视图使用intent实际上重新安装apk而不是升级。但我不想要提示“你想安装应用程序吗?”。

I want the apk to be upgraded once user click upgrade button without showing prompt to user, like doing in android market. 我希望在用户单击升级按钮后升级apk而不向用户显示提示,就像在Android市场中做的那样。

  1. Is there any method to upgrade apk in android? 在android中有没有升级apk的方法?

  2. Are there any restrictions doing that? 这样做有什么限制吗?

  3. Are there any specific permissions i need or i need to set in manifest file. 我需要或我需要在清单文件中设置任何特定权限。

Once you've downloaded the APK, Android itself decides if the program is installed and needs to be upgraded, or if it is a new installation. 下载完APK后,Android会自行决定是否已安装该程序并需要升级,或者是否为新安装。 Users can decide for themselves whether to upgrade or not. 用户可以自行决定是否升级。

Besides how to find out when there is an update available, it's not possible to upgrade it without prompting the user with the "Do you want to install". 除了如何找出有可用更新的时候,如果没有提示用户“你想安装”,也无法升级它。 Android doesn't allow third apps to install apps unless the phone is rooted and your app has root access, but I think that this isn't your target group. Android不允许第三个应用安装应用,除非手机已植根并且您的应用具有超级用户权限,但我认为这不是您的目标群体。

I have no experience with that but what you could try is loading classes manually from your server and then store it in the assets folder. 我没有这方面的经验,但您可以尝试从服务器手动加载类,然后将其存储在assets文件夹中。 http://android-developers.blogspot.com/2011/07/custom-class-loading-in-dalvik.html http://android-developers.blogspot.com/2011/07/custom-class-loading-in-dalvik.html

This is one approach, I don't think that it's very handy and easy but it would work. 这是一种方法,我不认为它非常方便,但它会起作用。

Hope it helps! 希望能帮助到你!

PS: And just because I'm wondering, is there a reason why don't you wanna publish it on the Android Market? PS: 只是因为我想知道,为什么你不想在Android Market上发布它?

When you are publishing an App on your private web server, you need to create a process through which you can check for new version .There is No in built method for doing this . 当您在私人Web服务器上发布应用程序时,您需要创建一个过程来检查新版本。 在构建方法中没有这样做。

I have created one as well. 我也创造了一个。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM