Mein zweiter Vortag zum Thema Android. In diesem Talk ging es eher um "do's and dont's". Es wurden die Themen "Garbage prevention", Tools
Wieder ein paar Zitaten aus dem Talk:
- "avoid object creation"
- "recycle bitmaps"
- "instead of myBitmap=null use myBitmap.recycle()"
- "dont wait for the finalizer"
- "be aggressive on deallocating objects"
Tools zum Thema Speichermanagement/-monitoring
- Tools Allocation Tracking
- Debug.startAllocationCounting()
- Heap-Analysis mit "hat" (vom Java Oracle SDK) mit hprof-converter
- MAT Memory-Analysis-Tool for Eclipse
Tools für Layouting
- HierarchieViewer
- LayoutOpt
Verhindern von "Memory Leaks"
- "careful with context"
- "care with static fields"
- "avoid non-stsatic inner classes"
- "use weak references"
- Single-threaded UI
- Dont block the UI-thread
- ANR* after 5 sec - dump on sd-card
- Handler posts messages in event-queues
- Use AsyncTask - they are WorkerThread with callbacks
* Application not responding
Keine Kommentare:
Kommentar veröffentlichen