Answer the question
In order to leave comments, you need to log in
How to update part of the application without updating the application itself?
How to update a piece of the application without updating the entire application?
My application works with a third party API. This API is updated quite frequently. Every time they are updated, the application stops working for me, I have to rewrite and upload a new version.
This is okay, but the problem is that it will take a lot of time until it reaches the user, and many users do not update the application at all.
I thought to do this: move the work with the service API into a separate module (for example, jar) and, when the service API changes, force the application to update it without updating the application. But how to do this?
UPD Working through your own server is not possible, because with my number of requests to a third-party API, the service blocks my server after 10 seconds.
Answer the question
In order to leave comments, you need to log in
There are several options:
- do not call someone else's API directly, but make your own facade over it. As a result, it will be enough to quickly change the backend, there will be no need to update the application.
- show users a dialog with a big green "Update" button and an explanation why the application will not work without it.
You have 2 ways:
1. Legal and logical:
Start your own server, register all work with a third-party api there. In which case, you simply change the server logic, you do not need to update the application, the connection with it does not change in any way.
2. Relatively legal:
Use DexClassLoader and create an additional .dex that contains the logic for working with api (store it initially in assets, then in the files folder (for example) in /data/data/packagename , and if necessary, download the new version yourself from your server and replace the original
Why relatively legal: Your application may be banned in the GP (it is not clear what you can slip to the client next time), your application will most likely be banned by most antiviruses.
try to bring to your server a template according to which the data downloaded from a third-party site is processed, if possible. those are not binary code, but the instruction by which your binary code will work.
Then, simply in the application, enable checking the version of the instruction and updating it.
binary upload tips are good, but you will get banned.
ps: as an option, the application can check the current version on your site and if it is old, just slow down and tell the user that work is not possible, the vendor has changed the protocol, update,
so I fought with a megaphone for a long time
There was a similar problem, I did this:
Let's say you need to make a request1, the program sends a request to the server, with all the data, and the server already returns the generated request1. the program simply executes this request and sends the data back to the server. The server "converts" them and issues them.
only I often changed not the answer, but the request itself, there was no need to convert the answer.
Yes, it is difficult, not beautiful, but convenient. The API has changed, you change the templates on the server.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question