I
I
Ilya2016-07-17 08:59:23
Java
Ilya, 2016-07-17 08:59:23

How to update a class dynamically from the server in Android?

The essence of the problem is this.
We are writing a specialized application that will be out of the market. People far from technology will use it (storekeepers, mechanics, etc.).
The application should be updated from the server without any questions. Root access to phones will not be done.
How to overwrite a concrete class? That is, in case of a change in MakeSell.java, load it from the server into the application.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
C
Copperfield, 2016-07-17
@postnik

Loading DEX code over the network

O
one pavel, 2016-07-17
@onepavel

you need to make an intermediate layer
you make an interface with the structure of your class as
a class you implement the interface
everywhere you use a reference to the interface instead of a class class
you compile separately from the project into dex
dex you put it on the server
the application downloads the dex file and loads it via
https://developer.android.com/reference /dalvik/sys...
profit

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question