[ 
https://issues.apache.org/jira/browse/FELIX-5913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16630983#comment-16630983
 ] 

Karl Pauls commented on FELIX-5913:
-----------------------------------

Tom,

great! I was hoping that I could clear things up. 

Excellent point about the native libraries! My point was that (and I fully 
admit that this isn't obvious) the call to getEntryAsNativeLibrary(String) on a 
Content will already copy the native library in question to the file system 
(inside the framework cache). Towards that end, I used that feature to create a 
list of libraries inside the bundle and pass it to the PathClassLoader. 
However, I was missing the bit about needing to pass a list of _directories_ 
instead of files. Good catch! 

I updated my solution to make sure it uses directories - the code in question 
is [0] where I pass the calculated list of directories containing native code 
from the bundle (if any) to the PathClassLoader and [1] where I do the actual 
calculation. Notice [2], where the call to getEntryAsNativeLibrary will cause 
the lib to get extracted into the framework cache.

Again, none of this is actually tested so it would be awesome if you could look 
into getting it to work. Looking forward to your results!

[0] 
https://github.com/karlpauls/felix/blob/android/framework/src/main/java/org/apache/felix/framework/BundleWiringImpl.java#L1954
[1] 
https://github.com/karlpauls/felix/blob/android/framework/src/main/java/org/apache/felix/framework/BundleWiringImpl.java#L1994
[2] 
https://github.com/karlpauls/felix/blob/android/framework/src/main/java/org/apache/felix/framework/BundleWiringImpl.java#L2001

> Support Android
> ---------------
>
>                 Key: FELIX-5913
>                 URL: https://issues.apache.org/jira/browse/FELIX-5913
>             Project: Felix
>          Issue Type: Wish
>          Components: Framework
>    Affects Versions: framework-6.0.0, framework-6.0.1
>            Reporter: Tom Rutchik
>            Priority: Major
>         Attachments: BundleWiringImpl.java, 
> FelixAndroidSupportImplementationNotes.pdf
>
>   Original Estimate: 3h
>  Remaining Estimate: 3h
>
> The lastest 6.0.0 and 6.0.1 release no longer works on Android.
> The code form the 5.6.10 version necessary to make it work was not ported 
> into these versions.
> Some code needs to be added to the class BundleWiringImpl class to allow for 
> android support. All of the code necessary to due that can be found in the 
> 5.6.10 version.
> I've added the code and have tested it and it's working fine again.  I've 
> attached an implementation of BundleWiringImpl that works with android. It's 
> basically the 6.0.1 implementation with the extra code from 5.6.10.  You 
> should be able to do a file diff on the 6.0.1 to see where I had to add the 
> missing code.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to