Inter-Activity memory restriction and API documents

by Jack Jia » Mon, 07 Sep 2009 00:04:23 GMT


Sponsored Links
 Hi Mark,

I can give my app as an example. The app uses the camera API to catch a
bitmap and tries to pass the bitmap to the cropping activity. It worked on
the emulator but not on the real device because the inter-activity
limitation on memory. I can persist the data and pass it to the cropping
activity and pass the result back in the same way, but that will be very
slow. In the end I have to write my own cropping in the same activity. You
can see the cropping activity is not very useful (also, it is not documented
as well) because of the limitation.

If the two activities have the same signature or one of them (such as the
cropping) is a shared tool and provides only service (not data) then there
is no security concern. By "single process framework", I mean I can do
everything in my process and at the same time to use libraries and tools etc
from the SDK.

I really like Android but I hope it can improve on this.

Jack






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



Inter-Activity memory restriction and API documents

by Dianne Hackborn » Mon, 07 Sep 2009 02:22:36 GMT


 



This won't work because if you process has to get killed at some point while
in the background, there is no way for the system to restore this data to
it.

-- 
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, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

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


Sponsored Links


Inter-Activity memory restriction and API documents

by Jack Jia » Mon, 07 Sep 2009 12:20:37 GMT


 Thank you for the idea of using static data member or service. But in my
app, I want to use an activity built in Android which I cannot change, the
only way seems to be using an intent with either data or uri. Also,
sometimes, it seems too much work to create service when I just want to
share a bitmap. Since there are so many ways to use the intent with so many
flags, maybe there is a way to make it work. I haven't tried all the
different flags. I would really like to just instantiate a cropping class
and call a method with my bitmap that would ausome.

Thanks,
Jack






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



Other Threads

1. [WTS] Sticker Android - Waterproof & Rare Design - Satu"nya di Indonesia

http://forum.android.or.id/showthread.php?6715-sticker-android-waterproof-amp-rare-design-satu-quot-nya-di-indonesia

*ANDROID STICKER*
Waterproof & Rare Design - Satu"nya di Indonesia
*Sticker Material : 3M (USA) & Oracal (Jerman) - **4 years outdoor color
durability on vertical surface*

*Design Gallery*
*Size & color may vary depend on your requirement*
*
*
**
*
*
**
*
*
**
*
*
**
*
*
**
*
*
**
*
*
**
*
*
**
*
*
*Sample*
*
*
**
*
*
*
*
*Contact us *
*
*
**
*
*
*Infinity Color Chart*
*
*
**
*
*
*Thank you & happy shopping*

-- 
"

2. How does the ActivityStack behave when it contains thousands of Activities?

In my app I have a about a dozen of different Activities. These
Activities are connected (can call each other with startActivity()) in
such a way, that the user can theoretically keep running in circles -
always jumping to the next Activity, never going back. Also, I really
need to maintain a proper Activity history: if the user presses the
back button, the app returns to the previous Activity, with the
previous content.

Question: Suppose the user's using the app for an extended amount of
time, going in circles between Activites as mentioned above, resulting
an ever-growing ActivityStack. Every Activity saves some state on
onSaveInstanceState() too.

- Is this a problem? (I'm afraid it is, I guess it's a memory leak to
have tens of thousands of Activity records on the stack, especially if
these save their state).
- Is there a way to limit the size of the default Android
ActivityStack's size? (size limit is X, we delete the oldest record if
it gets filled up)

Any suggestions / alternative solutions are welcome.

-- 

3. Tab Content is Displayed Over Tab of Tabs Instead of Below

4. AdSense in Admob banner?

5. GB, Moving the status bar to the bottom, HC-style.

6. System.exit

7. How Do You Get Tabhost to Work With Views Instead of Activities !?