Kumpul di Forum bareng LG ?

by TrepleHouse » Fri, 11 Feb 2011 04:50:40 GMT

Sponsored Links
 rekan2.. tadi ada yang datang ke acara LG di FX Mall, Indochine... ?

ada komentar acaranya gmana ?



Other Threads

1. Question regarding Heap size behaviour

Hi All,

I have developed an application in Android which is frequently facing
memory issues. The application deals with heavy amounts of data but
the heap size pattern is a bit baffling to me. Will be great if
someone can share his/her thoughts.

1) When the process requires a chunk of new memory, it grows the heap
by some amount. For example:

Stats at a point of time:
Maximum availbale memory: 24.0
Total memory            : 8.507782
Free memory             : 4.6412277
Used memory             : 3.8673096

VM requires to increase memory the stats becomes:
Maximum availbale memory: 24.0
Total memory            : 9.070282
Free memory             : 2.1964188
Used memory             : 6.8746185

Upto this looks fine, but immediately after the GC collects, and stats
Maximum availbale memory: 24.0
Total memory            : 9.070282
Free memory             : 4.1707535
Used memory             : 4.900276

Total memory remains at 9 and Free mem becomes larger. My question is,
Is the free memory really free? Because in a situation like this, I
suddenly get

54540-byte external allocation too large for this process
 java.lang.OutOfMemoryError: bitmap size exceeds VM budget

How with an available free memory of 4.17 MB, 54 KB allocation is not
possible? Also, an important point would be, the outofmemory is always
about allocating memory for bitmap.

2) Between step 1 and step 2 in previous point, I see a log:
Grow heap (frag case) to 17.651MB for 522256-byte allocation

This is very baffling as Total memory has increased from 8.5 to 9 but
it reports to have increased the heap size to 17.651 MB. I can
guarantee the memory stats are correct because both System.freeMemory
() etc and DDMS view show the same memory stats. Can someone explain
how can this happen?

Thanks in advance


2. focus control in compund control?


I am trying to create a compound control using a TextView and Seekbar.
I am also trying to keep the SeekBar focused on itself during
View.FOCUS_RIGHT and View.FOCUS_LEFT transitions. If using just a seek
bar by itself I can add android:nextFocusRight(Left) to the layout.xml
which works. But when I pass focus to the seekbar in the compound
control it does not seem to work.

Any ideas on how to constrain the focus of a seek bar in a compound
control to only exit focus on View.FOCUS_UP or View.FOCUS_DOWN?

                                android:nextFocusRight = "@+id/
                            </mvis.pektroller.SeekBarLabeled >

public class SeekBarLabeled extends LinearLayout {

        private static final String TAG = "SeekBarLabeled";

        TextView        textView;
        SeekBar seekBarFocused;

        public SeekBarLabeled(Context context, AttributeSet attrs) {
                super(context, attrs);

                LayoutInflater inflater = (LayoutInflater)getContext
                View view = inflater.inflate(R.layout.seek_bar_labeled, this);

                seekBarFocused = (SeekBar)findViewById(R.id.ValueBar);
                textView = (TextView)findViewById(R.id.ValueText);

        public void onFocusChanged(boolean gainFocus, int direction, Rect
previouslyFocusedRect) {

                if (gainFocus) {
                        Log.v(TAG, "onFocusChangeListener() hasFocus.");
                } else {
                        Log.v(TAG, "onFocusChangeListener() !hasFocus.");

                super.onFocusChanged(gainFocus, direction, 


3. Broadcasting Intent from native code

4. Error to create an AVD - Ignoring add-on

5. Getting a Nexus One

6. How to build a binary dictionary for Latin IME( main.dict ) ??

7. HTC Hero OpenGL Bug