开发者

Installing apk from within application in android

I need to downloads and install apk from server to devices and i tried to do this task bu开发者_如何学JAVAt it ask for user permission like "Insall" , "Cancel" . and if hits "Install" then it works fine and installed but i dont need this permission as i am to install 30 apk from server .

Thanks in advance .


The security model of android won't let you do such things without user interaction. It could be, if the particular phone was rooted, but I think you can't rely on that.


You can not do this on Android as said because it's a security limitation. It could be possible if you create a system app but based on your question I think that is not what you are after.

However there is a possible workaround: If those apps that you are installing are made by you and it is possible to modify them to act like plugins/libraries(Don't worry you can keep the activities and stuff) then you could load them dynamically when your apk is run, thus essentially giving you new code to be run on the device (Elements of these apps will run under same user ID but you can start them in a new process if you want with android:process=":YourProcessName". Check out this tutorial on how to load external libraries at runtime http://xianminx.blogspot.com/2011/12/dynamic-loading-android-custom-library.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜