Hi,

That's what I was trying to do. I converted the class files to dex and
placed them on the sdcard. There's a ClassLoader in Android which takes raw
.dex files:
http://developer.android.com/reference/dalvik/system/PathClassLoader.html

I haven't been able to get it to work yet, but that's probably because I
only found out about dynamic class loading in Java while working on this
and I'm not doing it right. Someone else is welcome to try it out.

For the coding challenge, then, I switched to the "ugly" method and it's
working on Android. I posted an email here, but it's being held because of
the attachment size. Should I just host the source somewhere and post a
link?

On Tue, Mar 27, 2012 at 8:23 PM, Stephen Tigner <stephen.tig...@gmail.com>wrote:

> On Mon, Mar 26, 2012 at 5:01 PM, Stephen Tigner
> <stephen.tig...@gmail.com> wrote:
> [snip]
> > Hmm... perhaps when run as a standalone, the transfer compile could
> > have an option for invoking the ADK to compile to Dalvik classes?
> > I'll need to look and see how/if it's possible to programatically
> > invoke the ADK compiler, as well as how to tell if the ADK is present.
>
> After some research
> (http://www.betaversion.org/~stefano/linotype/news/110/  [see the
> first point under "update and errata"], and
> http://mylifewithandroid.blogspot.com/2008/12/dalvik-opcodes.html), it
> seems that Dalvik classes are actually Java classes that have been
> transformed by the "dx" tool *after* compilation (the dx tool is found
> in android-sdk/platform-tools). Further research and tinkering is
> required, but at this point it looks fairly trivial to just call the
> dx tool to convert the pre-compiled transfer class files to dex files,
> and then there will need to be a bit of code added to the class loader
> to look for the dex file instead of the class file if running under
> android.
>
> -- Stephen
>
>
> ------------------------------------------------------------------------------
> This SF email is sponsosred by:
> Try Windows Azure free for 90 days Click Here
> http://p.sf.net/sfu/sfd2d-msazure
> _______________________________________________
> Apertium-stuff mailing list
> Apertium-stuff@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/apertium-stuff
>
------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Apertium-stuff mailing list
Apertium-stuff@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/apertium-stuff

Reply via email to