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.
- you have make copy of jar file private internal storage of aplication. - 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)) 
- using aapt tool command inside same location, have add classes.dex jar file. 
- this jar file loaded dynamically using dexclassloader. 
- 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.
Comments
Post a Comment