Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rolling out update of SDK OTA

I have developed a SDK for android applications.We have many clients using this SDK in there applications.Now i have updated my SDK.I am looking for a way that these changes can reflect in there application without updating there app on play store.Urgent help needed.Any help will be appreciated.Thanks in advance.

like image 745
Scorpio Avatar asked Sep 28 '15 05:09

Scorpio


People also ask

How does Android OTA update work?

How does OTA work? The OTA process is self-explanatory in that it delivers updated software wirelessly or 'over the air'. These updates are distributed over WiFi or mobile broadband using a function built into the smartphone or tablet's operating system or through a special OTA app that's given root access.

What is OTA file android?

Over-the-air (OTA) or Firmware Over-the-air (FOTA) are remote updates to the Android operating system (OS) running on a mobile device. Android devices connected to a network can receive and install over-the-air updates to the OS, application software, and time zone rules.


1 Answers

Well you can dynamically load a jar file from your SD card using DexLoader class...which you can update when ever you want..on your storage... below is working code..

  final String libPath = Environment.getExternalStorageDirectory() +     "/test.jar";
    final File tmpDir = getDir("dex", 0);

    final DexClassLoader classloader = new DexClassLoader(libPath, tmpDir.getAbsolutePath(), null, this.getClass().getClassLoader());
    final Class<Object> classToLoad = (Class<Object>) classloader.loadClass("com.test.android.MainActivity");

    final Object myInstance  = classToLoad.newInstance();
    final Method doSomething = classToLoad.getMethod("doSomething");



    doSomething.invoke(myInstance);

and in your library file code can be like this

public class MainActivity {



public void doSomething() {

Log.e(MainActivity .class.getName(), "MainActivity : doSomething() called.");
}}

tell me if you need any assistance

like image 191
Harry Sharma Avatar answered Sep 30 '22 12:09

Harry Sharma