0

i am working on a clock box app that contain several clock widgets the reason i want to put clocks in an another apk is its 30 clock for god sake its gets my phone widget manager force stop if i put all the clock codes in one apk. so i made 30 seperate clocks and now i stucked at the end how can i open them with package installer using intent?

the clocks are in assets folder and i just want to open them with package installer. can any body teach me how to do it? i am still learning so if you give me the whole code it would be great!

(my clint gets 403 so i cannat use google library)

  • Copy desired file from assets to external dir, and use it like here: http://stackoverflow.com/a/4969421/4271923 – Ped7g Dec 13 '16 at 15:00
  • why not in android assets? – Mohammad Reza Majid Pour Dec 13 '16 at 16:58
  • something like this: loadUrl("file:///android_assets/file.apk"); – Mohammad Reza Majid Pour Dec 13 '16 at 16:59
  • I think you will have to have "content provider" in your application, which the installer will be capable to use together with such url, to read your assets' bytes (it certainly can't read them directly). So it may be possible to create it the way you suggest. Extracting the file to external dir is shortcut to not have to do content provider, as the installer already must know how to handle files from external dir. Maybe this is relevant: http://stackoverflow.com/a/7177103/4271923 (I didn't study it too much) – Ped7g Dec 13 '16 at 17:28
  • thanks i will try it see ya tomorrow – Mohammad Reza Majid Pour Dec 13 '16 at 17:44

0 Answers0