Limitation on porting SCA to Android platform

  Below are detailed some issues we got when porting the Apache Tuscany SCA Java version to the Android platform. The progress of some blocking issues can be tracked here.

Android Reflection API

The Apache Tuscany SCA library relies a lot on the Java Reflection API. The Android API provides the Reflection API, otherwise on the latest Android SDK version (m5-rc15) it is not correctly implemented with some Reflection methods throwing exceptions. At Android developers list there are many topics about this problem and the Android developers tell that in next release it will be fixed. So far we are using the retrotranslator as a workaround for this problem until the next SDK version is released. Unfortunately the next SDK release date is uncertain.

 Android JAR converter excluding the non-class files

For an Android application to use the SCA library, the library (.jar) must be converted to the Android format. Unfortunately when a jar file is converted to the Android format, it only converts the class files contained in the jar files and ignores the other files (resources). It would be great if the converter also support the conversion of these resources contained in jar to the Android resource format (either those located in rsc or asset folder).

As a workaround for this problem, it was developed a simple tool that extracts all non-class files from a jar file (for example, the SCA library jar) to an Android application assets folder. Unfortunately, we are not being able to access anything using the AssetManager (the class used to access the resouces placed in the assets folder), for example, we have tried to list the files using assetManager.list(path), but I got no files for any combination of path ( / , /assets/ , assets/ , ... ). It would be great if it could be fixed for next SDK release too.

 RMI API

There are some SCA modules that uses the RMI API, but the Android library does not implement this API. For now the source code that uses the RMI API is being commented or the entire module is being removed. In future, we may use the Apache Harmony RMI API to add the RMI support on Android SCA.

 Beans API

There are some SCA modules that uses the Beans API, but the Android library does not implement this API. For now the source code that uses the Beans API is being commented. In future, we may also probably use the Apache Harmony Beans API to add the Beans support on Android SCA. But it would be a good approach when the Android Annotation support is fixed, otherwise we will still need to use the retrotranslator, because the Beans API uses a lot the Reflection API.

 javax.jws.WebService

There are some SCA modules that import javax.jws.WebService, which is not part of the supported packages in Android. The current approach is to comment out the code that relies on javax.jws.WebService. Also looking to find if it can be backported (similar to RMI).

  • No labels