I'm writing an application and would like to have some files extracted
from the .apk during _installation_ time, as the files can be quite
large and extracting them from the .apk during the first run results in
a noticeable slowdown which I would prefer to avoid.
After lots of experimentation, I have found one way to make this work,
but I'm unsure about the "long-term" ramifications of this approach,
specifically: will this actually work in android-9 and later?
The approach is to name the files I want extracted at installation time
as "lib*.so", and place them into the appropriate lib/ABI folder within
the apk file, e.g. the .apk contains:
lib/armeabi/libMyLargeFile.dat.so
and at installation time this is (nicely) installed as:
$APPDIR/lib/libMyLargeFile.dat.so
My concern is that 'libMyLargeFile.dat.so' is NOT an ELF shared library.
This approach only works because PackageManagerService only checks for
files matching the `lib/ABI/lib*.so` pattern (which is followed) and
does not check the contents of the extracted file.
This approach works for Android 1.6 through Android 2.2. I'm wondering
if this will continue to work in the future, or if I need to investigate
an alternate mechanism.
Thanks,
- Jon
P.S. On a related note, I did see android.app.backup.BackupAgent, which
says "Restore operations are typically performed only when applications
are first installed on a device." Unfortunately, this type is only
supported in Android 2.2, and even when I
specify /manifest/application/@android:backupAgent my BackupAgent isn't
ever instantiated, never mind "when...first installed on a device," so
the docs appear to be misleading or I'm missing some other crucial
undocumented step.
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en