auto-update

How can I write a Java application that can update itself at runtime?

大兔子大兔子 提交于 2019-11-26 02:17:01
问题 I would like to implement a java application (server application) that can download a new version (.jar file) from a given url, and then update itself at runtime. What is the best way to do this and is it possible? I guess that the application can download a new .jar file and start it. But how should I do the handover, e.g. know when the new application is started and then exit. Or is there a better way to do this? 回答1: The basic structure of a solution is as follows: There is a main loop

WebView load website when online, load local file when offline

妖精的绣舞 提交于 2019-11-26 01:12:38
问题 I am actually new to programming in Java but I have been following several solutions to my problem here but didn\'t find one that suits my case and I can\'t seem to get the code down correctly. I would like to have a WebView that opens an online page (for example Google) when the phone is online and open a local HTML page when the phone is offline. At the same time though I want the phone to overwrite the local page when it is online so that the offline local page is always updated to the