Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Packing an ELF executable inside Android application

 
Monu Tripathi
Rancher
Posts: 1369
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Peter Johnson
author
Bartender
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I doubt that this will work. The opcodes in your .so are probably not going to be compatible with the processor in Android.
 
Monu Tripathi
Rancher
Posts: 1369
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@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.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!