0

I am trying to store a saved class binary file in my application's resources. Where should I put it and how can I access it in the application?

Flynn
  • 5,903
  • 7
  • 38
  • 55
  • I'm struggling to understand why you would want/need to do this. If you want to distribute a class file with your app then simply put it in the package where it will be built and accessible as with any other class. – Squonk May 11 '12 at 18:13

2 Answers2

1

Dalvic machine can't work with .class file. It only work with .dex file.

KoVadim
  • 707
  • 1
  • 7
  • 22
  • Could I save a class as a .dex? – Flynn May 11 '12 at 18:03
  • read this articles http://stackoverflow.com/questions/6857807/is-it-possible-to-dynamically-load-a-library-at-runtime-from-an-android-applicat http://stackoverflow.com/questions/2610995/dynamically-generating-dalvik-bytecode-into-a-running-dalvik-android-application http://stackoverflow.com/questions/3022454/how-to-load-a-java-class-dynamically-on-android-dalvik – KoVadim May 11 '12 at 19:23
1

Put it in res/raw and access it like any other file, but don't expect to actually be able to execute it.

Argyle
  • 3,324
  • 25
  • 44