How to remove a file in assets at run time?

by shuoshuo » Mon, 15 Dec 2008 21:50:16 GMT


Sponsored Links
 I have made an application, it uses a C++ shared library, I want
deploy it by including it with the .apk package, at run time, copy it
from the assets to a file, then remove it from assets in apk, how
could I remove a file from assets in apk at runtime? or Is there any
other alternative to deploy a C++ shared library?
--~--~---------~--~----~------------~-------~--~----~



How to remove a file in assets at run time?

by Michael » Tue, 16 Dec 2008 01:23:43 GMT


 You cannot currently install a shared library via an APK file.  Or for
that matter, get it onto a non-hacked G1 at all.
--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


How to remove a file in assets at run time?

by Ralf » Tue, 16 Dec 2008 05:16:23 GMT


 You can think of the the APK as being a read-only zip file, so I don't
think you can remove anything from it. You don't really need to remove
your lib from the apk anyway, do you?

R/




--~--~---------~--~----~------------~-------~--~----~



How to remove a file in assets at run time?

by shuoshuo » Tue, 16 Dec 2008 09:57:48 GMT


 Yes, I don't really need to remove it, but after I copy the share lib
out, the share lib have two copy, it wast storage space.




--~--~---------~--~----~------------~-------~--~----~



How to remove a file in assets at run time?

by jarkman » Tue, 16 Dec 2008 16:50:06 GMT


 We've got a similar issue, with a bunch of files that we extract from
the apk on first run and will never need in the apk again.

It is a terrible waste of space to leave them there. Shame.

Richard





--~--~---------~--~----~------------~-------~--~----~



How to remove a file in assets at run time?

by Dianne Hackborn » Wed, 17 Dec 2008 01:30:38 GMT


 The .apk is read-only, and can not be modified.








-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support.  All such questions should be posted on public
forums, where I and others can see and answer them.

--~--~---------~--~----~------------~-------~--~----~



How to remove a file in assets at run time?

by jarkman » Wed, 17 Dec 2008 06:33:24 GMT


 Thanks for the confirmation. Still seems like a shame... :-)

R.







--~--~---------~--~----~------------~-------~--~----~



How to remove a file in assets at run time?

by Urs Grob » Wed, 17 Dec 2008 07:28:43 GMT


 It would be nice to have something like an installation package that
contains the apk as well as some files that are only needed during
installation time. Like this you could deploy e.g. your sqlite db file
with some initial content or some files that maybe should be stored
inflated on the sdcard.

-- Urs








--~--~---------~--~----~------------~-------~--~----~



How to remove a file in assets at run time?

by Dianne Hackborn » Wed, 17 Dec 2008 10:07:40 GMT


 e deliberately do not do this, so we can always reset the application back
to the initial state it was installed in. Keeping .apks entirely
self-contained, self-sufficient, and without needing some external installer
that you can loose is of tremendous value in being able to manage everything
the user has installed and simplifying their experience.

This is something that I will very strongly push back from changing, and is
central to just about everything about how we manage applications, such as
the fact that applications don't go and explicitly register themselves with
part of the system, but rather declare those things in the manifest.

On Tue, Dec 16, 2008 at 3:18 PM, Urs Grob <grob....@gmail.com> wrote:



--
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support. All such questions should be posted on public
forums, where I and others can see and answer them.

--~--~---------~--~----~------------~-------~--~----~



How to remove a file in assets at run time?

by dssheng » Wed, 17 Dec 2008 11:13:53 GMT


 i

maybe you can refer
Browser component

/package/apps/Browser/asserts/plugins/gear.so

and BrowserActivity.java head of function run()

On Dec 17, 10:07am, "Dianne Hackborn" <hack...@android.com> wrote:
--~--~---------~--~----~------------~-------~--~----~



How to remove a file in assets at run time?

by jarkman » Thu, 18 Dec 2008 21:41:22 GMT


 ianne - that reminds me of another question - is the user going to
have any way to get the .apk back off a device after installation ?

I'm wondering if we should expect this world to be a bit like old-
school PalmOS, where users tended to pass apps around, or more like
(I'm sorry for the comparison) Windows Mobile, where once they have
installed it they probably don't keep the .cab and so don't pass the
app on to their friends.

Thanks,

Richard


On Dec 17, 2:07am, "Dianne Hackborn" <hack...@android.com> wrote:
--~--~---------~--~----~------------~-------~--~----~



How to remove a file in assets at run time?

by Dianne Hackborn » Fri, 19 Dec 2008 03:58:21 GMT


 ou can use "adb pull" to retrieve an .apk from a running system.  In this
case our model is much more like PalmOS than windows, where the thing you
download and install is also the thing that you run, there is no separate
installer.

On Thu, Dec 18, 2008 at 5:41 AM, jarkman <jark...@gmail.com> wrote:



--
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support. All such questions should be posted on public
forums, where I and others can see and answer them.

--~--~---------~--~----~------------~-------~--~----~



How to remove a file in assets at run time?

by jarkman » Sat, 20 Dec 2008 00:02:42 GMT


 hanks, but there's another aspect of the question.

In order to reap the (substantial & lovely) benefits of the re-
usability of .apks, the users would need a way to get at them & pass
them around. They aren't likely to run adb.

Can you say if there any plan to give them a mechanism for that ?

Thanks,

Richard

On Dec 18, 7:58pm, "Dianne Hackborn" <hack...@android.com> wrote:
--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. XMLHttpRequest in WebView

Hello,

I have read that the XMLHttpRequest object is not available in a
WebView? Is this misunderstanding or true? If so, are there any
workarounds for AJAX-based applications?

Best regards
mboehmer
--~--~---------~--~----~------------~-------~--~----~

2. Compiling G1 firmware from source and then re-flashing G1

Yes, you need to have a USB connection between your device and your PC.

Disconnect has a good write-up about fastboot: http://andblogs.net/fastboot/

JBQ










-- 
Jean-Baptiste M. "JBQ" Queru
Android Engineer, Google.

--~--~---------~--~----~------------~-------~--~----~

3. Sporadic SharedPreferences reset

4. Compiling G1 firmware from source and then re-flashing G1

5. need help to display dialog message

6. Regarding Positioning

7. Asynchronously populating a ListAdapter