I have implemented an application that has similar requirements to you, you can read my blog here Android update for Android automatic screen . Below are answers to some of your questions:
May I request that no matter what is pressed on the screen, the user never leaves my application?
Are there any instructions for this, are they officially supported, or do I need to start> hacking? (using the interface at the system level, removing voice activation (when the user holds> down the search button), disables automatic updates, etc.)
Ideally, I want to just write one application that replaces the entire interface, and I want> a way to connect the application, without a bunch of extra work (rooting the phone and manually), removing the built-in built-in built-in application).
As far as I know, there are two ways to do this: one uses the Homescreen application, and the other uses a "system warning window", and I think that you are familiar with both options.
I would also like to lock USB in "Charging Only" mode to prevent the installation of the file system without the approval of my application. I am not bothered by the really determined guy who> opens the device and mounts the internal file storage system.
I'm not sure if this is possible, but you can play with low-level Linux commands if you have a root phone with a loaded box installed. Sorry because you are not helping much here.
In case of failure, I would like to have a second application that decides whether> the first application needs to be restarted
Perhaps I believe, for example, if you look at existing android “crash reports” such as Acra , there you will see examples of crash handling, what you need to do is handle UncaughtExceptionHandler
(these two methods are your friends Thread.getDefaultUncaughtExceptionHandler()
and Thread.setDefaultUncaughtExceptionHandler(UncaughtExceptionHandler eh)
). After the handler is configured from there, you can decide what to do (do not forget to handle the exception without any problems, you must enable this so that Android can perform the necessary cleanup). Now, if your application is the default Homescreen, then in case of failure Android will automatically restart the application for you. If this is not a Homescreen application, you can run Intent to restart the application when a crash occurs.
Hope this helps.