aspose file tools*
The moose likes Android and the fly likes Packing an ELF executable inside Android application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Android
Bookmark "Packing an ELF executable inside Android application" Watch "Packing an ELF executable inside Android application" New topic
Author

Packing an ELF executable inside Android application

Monu Tripathi
Rancher

Joined: Oct 12, 2008
Posts: 1369
    
    1

I have a binary file compiled for linux, ARM(version 5) machines. I do not have the source code to recompile it into a shared library(.so). My Android Java code depends on this binary to implement its business rules and I was thinking of how and if this executable can be packaged with the Android application.

Questions : Can the ELF be dumped into a folder, and then executed using Runtime.exec()?
How should it be packaged? Is there a definite package structure that need to be followed?

Please advise.

Thanks.

[List of FAQs] | [Android FAQ] | [Samuh Varta]
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5827
    
    7

I doubt that this will work. The opcodes in your .so are probably not going to be compatible with the processor in Android.


JBoss In Action
Monu Tripathi
Rancher

Joined: Oct 12, 2008
Posts: 1369
    
    1

@Peter: The executable was compiled for Linux OS and ARM machine and I was able to push this executable onto the internal file system of a rooted Android phone and start it. So, executable compilation for the machine architecture is not a major concern, apparently. The problem is bundling the executable with our Android project and somehow running it when the application starts.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Packing an ELF executable inside Android application