android - How to load a JAR from Assets folder at runtime -


how load jar file assets folder of android application during run time. loading assets folder requirement. there way this. please ..

i got answer.i adding answer here. because may helpful others searching.

there steps accomplish this.

  1. you have make copy of jar file private internal storage of aplication.

    1. using dx tool inside android folder, have generate classes.dex file associated jar file. dx tool @ location /android-sdks/build-tools/19.0.1 (this file needed dalvik vm, jar can not read dalvik vm))

    2. using aapt tool command inside same location, have add classes.dex jar file.

    3. this jar file loaded dynamically using dexclassloader.

    4. if making jar 1 own library, have steps (1-4) every time when there change in library source code. can automate steps creating shell script(in mac/linux/ubuntu) or batch scripts(in windows). can refere link understand how write shell scripts.

note : 1 situation implementing method is, when impossible add jar files directly build path of core project , need loaded dynamically @ run time. in normal cases jar files added build path.

please check link detailed code , implementation.

how load jar file @ runtime

android: how dynamically load classes jar file?


Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -