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. external native lib description

Is there a one liner description for the external projects listed
here
http://source.android.com/projects

-Dan

-- 
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

2. swapping two buttons isung translate animation

I am trying to swap the position of two buttons.
my swapping code looks as below.

private void exchangeButtons(Button btn1, Button btn2) {
        // Create the animation set


        AnimationSet exchangeAnimation = new AnimationSet(true);
        TranslateAnimation translate = new TranslateAnimation(
Animation.RELATIVE_TO_SELF, btn2.getLeft(),
 
Animation.RELATIVE_TO_SELF, btn1.getLeft(),
 
Animation.RELATIVE_TO_SELF, btn2.getRight(),
 
Animation.RELATIVE_TO_SELF, btn1.getRight()
        );
        translate.setDuration(500);
        exchangeAnimation.addAnimation(translate);
//      int fromX = btn1.getLeft();
//      int fromY = btn1.getRight();
//      int toX = btn2.getLeft();
//      int toY = btn2.getRight();


        Log.d("ArrangeMe", "view1 pos:" + btn1.getLeft() + ", "
+btn1.getRight() + "view2 pos:" + btn2.getLeft() + ", " +
btn2.getRight
());


        AnimationSet exchangeAnimation1 = new AnimationSet(true);
        TranslateAnimation translate1 = new TranslateAnimation(
Animation.RELATIVE_TO_SELF, btn1.getLeft(),
 
Animation.RELATIVE_TO_SELF, btn2.getLeft(),
 
Animation.RELATIVE_TO_SELF, btn1.getRight(),
 
Animation.RELATIVE_TO_SELF, btn2.getRight()
        );
                translate1.setDuration(500);
                exchangeAnimation1.addAnimation(translate1);


                // EXECUTE
                btn1.startAnimation(exchangeAnimation);
                btn2.startAnimation(exchangeAnimation1);


    }


I call the code as below


exchangeButtons(button1, button2);


my layout looks as below


<LinearLayout android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<Button android:text="One" android:id="@+id/button1"
android:layout_height="70px" android:layout_width="70px"
android:layout_weight="1"></Button>
<Button android:text="Two" android:id="@+id/button2"
android:layout_height="70px" android:layout_width="70px"
android:layout_weight="1"></Button>
</LinearLayout>


what happens when i execute the code is,


instead of the buttons exchanging their positions, they just
disappear
for sometime[may be 500 ms] and reappear as they were originally.


how to resolve this problem ? will it work properly in device ?


regards


Jagat


itried this too

http://www.mail-archive.com/android-develop...@googlegroups.com/msg49872.html

but i dont know how he made it work, this variable being non final
cant be used inside thread, hence the code does not compile

-- 

3. problem creating new android project

4. run emulator on remote computer?

5. How do I simulate a "Home", "Menu", Or "Back" key press

6. Access to DATA BASE from Android application

7. modular programming (design pattern)