dcindia / KivyAppUpdater

Updater service for Android apps built using Kivy/KivyMD
Apache License 2.0
5 stars 2 forks source link

Extend support for module from API 21 (Lollipop) #2

Open darpan5552 opened 3 years ago

darpan5552 commented 3 years ago

PackageManager.Session was added in API level 21, still kivyappupdater module supports only API 26 & above. This is due to my own lack of expertise.

 public static void copy(InputStream in, OutputStream out) throws IOException {

    byte[] buffer = new byte[1024];
    while (true) {
      int bytesRead = in.read(buffer);
      if (bytesRead == -1)
        break;
      out.write(buffer, 0, bytesRead);
    }
  }

Above code or similar action performed by another code needs to be written in pyjnius for transferring data to Package Manager. I somehow found a method working in API 26 but unable to do so in lower APIs. This is very basic action and is definitely possible. If you can find away, please share it.