Self Updating app? - java

I'm new to Android development and I would like to ask if a self-updating feature could be possible. The details are:
The application is designed as an In House App, not going to be published on Google Play.
Will need to run only in Kiosk mode.
The self-updating feature will have to work as following: In the settings screen, there will be an Update button that will start downloading the new version of apk. After the apk will be downloaded, it will have to start the updating process automatically.
Is this even possible?

Yes, it's possible, furthermore, there are services that can do this for you, such as HockeyApp's update manager

Related

Creating a background service for a finished app

I am fairly new to android development, and I want to customize an open source browser application to suite my usecase.
So what is my usecase:
I use an Oculus Quest 2 running Android. As with any Android device, you can sideload any app on it, but unfortunately the OS is very rigorous with killing background tasks, making it impossible to have Discord or Spotify running in the background while playing a game, which was my plan.
So I thought about it and came up with the idea of creating my own browser that implements the functionality to prevent it from being killed by the OS itself, and then in the browser I can open the web application of Spotify or Discord or any other web service to listen to it.
I have now decided to use the FOSS browser which I found on github and wanted to modify it to keep it open in the background. Unfortunately, I know next to nothing about Android app development and I don't even know if it's even possible to add this kind of functionality to an existing app without completely rewriting it. I hope my explanation is clear and that there is someone who can help me with this task.
Some keywords I already found out about are:
creating a service (background service)
foregrounding -> to tell the system that the app is important to the user and shall only be closed if memory is very limited
There is already one app out there which is able to run in the background of the oculus quest, so there is definitly a way of perfoming this task but unfortunatly I dont know how... yet

Single application custom Android ROM

I find this question a couple places on the web, but never with a good answer. Let me be specific in the questions asked.
I want to build a custom Android ROM which only features one app. This app is not to interact with any hardware (per now). This app will be launched on the start up of the device. No locked-screen. The device will have to restart if the app malfunctions.
A resource told me that you can change the launcher app of the ROM.
-> Does this mean that the home screen, the one which displays all apps on our phones, is merely another app? If so, can you simply change the launcher app as it is stated here? What were to happen if this app fails?
If this is the case, it would solve the entire issue.
If not, how do you go about making this sort of project? It includes
Making an app on AOSP
Refuse users to leave the app or interact with anything else
Making this app part of the boot-up process
Remove locked screen
Make the app a dependency of the OS (to force shutdown if malfunction)
Thanks in advance for any replies
I just found Android have a topic about dedicated devices (formerly called corporate-owned single-use, or COSU) are a subset of company-owned devices that serve a specific purpose. maybe that can meet your requirement.
BTW, After into the sub-topic lock task mode that mentions about set DPC whitelist APPs and the device policy controller (DPC) needs setup by other steps.... FYR~

Update an pre-installed Android App without Google Play and not to be detected as an unknown source

I'm currently working on a specific Android app that might not be able to be uploaded to Google play due to some commercial considerations (But will be built in our customized ROM)
And now we've found some ways to update the app without Google Play, but still those solutions will lead to a dialog that asks user to allow installing apps from unknown sources, however showing the dialog and changing the configuration might not be a favorable option for our project.
I've referred to this before
How to push updates to preinstalled apps without allowing installation from unknown sources
Unfortunately our app cannot be built as a system app, so this solution might not be helpful.
So is it possible to update a pre-installed app without Google Play and also not to be detected as unknown sources(Or not be asked by the system)? Thx

Allow my Android view to be embedded in other apps

In web-based development and Windows-based development it is possible to develop applets or components that other applications can embed in their own UI seamlessly. I have a component (derived from View) that does some real-time animation that I'd like other apps to be able to embed in their own views or activities. Is it possible to allow other apps to embed this component in them in such a way that, when my app is updated, the other apps will automatically exhibit the updated behavior in their embedded component?
If this is possible, I'm having a hard time figuring out the search terms to use to look up how to do this. How would one app go about embedding a view from another app, and what happens if that other app isn't installed?
You cannot directly allow embeding in the way of an iframe.
However, you could make your View a library project that other developers can include in their app, much like they include another company's SDK. To allow updating automatically, you will need to have your app installed in addition to theirs, and when making the library project, you will have to make a BroadcastReceiver that can react to broadcasts you send from your app to update the Views in other apps.
Your SDK can then receive these Broadcasts, and update your View accordingly.
You can make your current project as Library project. You add the Library project to the project you want use the custom View. Your custom View will be accessible in that project.
You can mark a project as Library project by going to Project Properties > Android and checking the appropriate checkbox.
You can create an app widget for your application, and that widget can be used by any application that acts as a widget host - which few do - but at least you could have it on your home screen. I wonder why this is not done more - that would be a killer feature for many applications.
https://developer.android.com/guide/topics/appwidgets/index.html
Gives more information.

How do "add-ons" work for native apps?

I am designing an app for Android, iPhone/iPad and Windows Phone using GWT and PhoneGap. GWT will allow me to write the entire app in Java (my strong suit, unlike JavaScript or CSS) and will translate it into cross-browser JavaScript/AJAX. PhoneGap will then wrap that resultant JavaScript and turn it into a native app for each of the three platforms mentioned above.
I would like to have a "plugin-oriented architecture", whereby users can optionally purchase (or qualify for through other means) "add-ons" (plugins/extensions) that will enhance the functionality of the app.
Normally I would accomplish this by using the Java Simple Plugin Framework (JSPF) and allow users to download plugin JARs as they paid for them. These plugin JARs would then be added to the classpath of the main app so that the next time it starts and scans the classpath for plugins, it finds them and loads them.
Is this possible with native apps? I don't believe I can deploy anything other than APK, IPA and XAP (Android, iPhone and WinPhone respectively) files to these marketplaces.
In Java-land, this would be like having to download a "base" app in the form of an executable JAR (containing its own main method), and then having to download a "plugin" app that is also an exectuable JAR, and somehow get the two to behave like a normal plugin architecture (which would be if you have 1 exectuable JAR base app and then 1+ plugin non-executable JAR libs).
So I ask: how do add-ons work for native apps from a deployment/download perspective? How do you get 2 or more APKs/IPAs/XAPs to communicate with each other on the client-side? If not possible, how do native app developers handle add-ons (I know they exist, I've seen them!)? Thanks in advance!
as for iPhone - the only way is to implement the additional features and have them disabled until the user purchases in app to unlock the feature.
In Android you can have apps communicate with each other so that the user can just load add-on apps that provide only the add-on functionality. For more detail on this.. android communication between two applications
WP8 - I do not yet have experience
Although I am not a core Android Developer, here are some suggestions from my experience with Android till now:
One possible solution for Android is to use Updates for application. One way to achieve this is using a Background Service which checks for updates whenever app starts or use GCM (Google Cloud Messaging) to push update messages to the app. Second option is much better as you can provide instant update to the user ,on per device basis (a user can have multiple devices), as soon as he/she has bought your add on feature. After the user has got the update message you can download the whole app with new feature and update app on the device. Of course in this case you need to backup the existing data of the app and restore after installation of updated app.
I don't know if this thing can be done but it would be also be an good option in my opinion if you can provide a legitimate user, who have bought the particular add on, an updated app through Android Market.
Another way is to create each add on as a Service and then let the main app can detect (or bind) those services at startup and if they are available, your app can communicate with them easily. You can even call the UI portion of the newly deployed add on from your main app by using Intents and BroadcastReceivers.
You may also find this useful as far as Android is concerned:
However, there are ways for an application to share data with other
applications and for an application to access system services:
It's possible to arrange for two applications to share the same Linux
user ID, in which case they are able to access each other's files. To
conserve system resources, applications with the same user ID can also
arrange to run in the same Linux process and share the same VM (the
applications must also be signed with the same certificate).
Hope this gives some useful information to you.

Categories