User Tools

Site Tools


android_study

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
android_study [2020/03/09 23:41] jrsetiandroid_study [2020/03/10 01:58] (current) – [Background Location] jrseti
Line 17: Line 17:
 ====Background Location==== ====Background Location====
  
-[[https://developer.android.com/about/versions/oreo/background-location-limits|Background Lovation Limits]]+[[https://developer.android.com/about/versions/oreo/background-location-limits|Background Location Limits]]
  
 ====Saving Data==== ====Saving Data====
Line 423: Line 423:
   * Avoids memory fragmentation   * Avoids memory fragmentation
   * Create ObjectPools, each has a size and RGB format in common.   * Create ObjectPools, each has a size and RGB format in common.
-  * Use Glide libray to do this+  * Use Glide library to do this
  
 Perfomance Tuning Lifestyle Perfomance Tuning Lifestyle
  
-  * Thik about performance ahead of a time+  * Think about performance ahead of a time
   * Gather, Insight, Action   * Gather, Insight, Action
   * Use a tool to gather information.   * Use a tool to gather information.
  
 +Overdraw
  
 +  * Overdraw is how many times a pixel is drawn in a single frame
 +  * Turn on Show Overdraw in dev options to debug
 +  * Tints showing overdraws
 +  * Overlapping backgrounds
  
 +Understanding VSYNC
 +
 +  * Refresh Rate
 +  * Frame Rate
 +  * If refresh rate > Frame Rate, you get tearing
 +  * Double buffering by the GPU 
 +  * VSYNC will copy from GPU to screen during VSYNC
 +
 +Profile GPU Rendering Tool
 +
 +  * In dev mode on device
 +  * Keep all bars < 16ms!
 +
 +GPU
 +
 +  * DisplayList submitted to the GPU
 +  * Turn on the GPU View in dev mode. Invalidates will show in red.
 +  * Use Hierarchy Viewer
 +
 +App Launch Time
 +
 +  * Don't display a splash screen
 +  * Fix the main activity so the load time is quick
 +
 +Smaller APKs
 +
 +  * Smaller resources
 +  * In build.gradle in 
 +  * 
 +<code>
 +BuildTypes{ 
 +  Release { 
 +    minifyEnabled: True
 +    shrinkResources: True
 +    proguardFiles getDefaultProguardFile('proguard-android.txt', 'proguard-tools.pro')
 +  }
 +}
 +</code>
 +
 +  * Toss out images you don't need for all resolutions.
 +  * Use "Vector Drawables"
 +  * Rotate images instead of separate images.
 +
 +  * Smaller code
 +  * minifiedEnabled: true
 +  * Optimize code like enums (which get inflated to a class)
 +  * JARs can be large. Proguard only helps a bit. Find smaller alternatives.
 +  * You can split APKs into different versions
 +  *  
 ====Tools to use==== ====Tools to use====
  
-  * Systrace+  * Systrace Trace.beginSection(), Trace.endSection()
   * Network Monitor Tool - in Android Studio   * Network Monitor Tool - in Android Studio
   * Network Attenuator from AT&T   * Network Attenuator from AT&T
Line 442: Line 496:
   * TraceView   * TraceView
   * Battery Historian   * Battery Historian
-  * DDMS in Android Studio. Best of all  memory tools            `+  * DDMS in Android Studio. Best of all  memory tools       
 +  * Heirarchy View 
 +  * On device tools: Profile GPU (Rendering), Show GPU (Overdraw), GPU View (Updates)      ` 
 +  * Heap Tool 
 +  * Memory Monitor 
 +  * Start Method Tracing Tool 
 +  * Method Profile Tool 
 +  * APK Analyzer 
 + 
 +Vector Drawable 
 + 
 +  * One file generates all resolutions on demand 
 +  * Can be animated with an XML file 
 +  * Can take more time to load into GPU 
 +  * Pay attention to the complexity of the paths in your vector data 
 + 
  
-NOTES:+====NOTES:====
  
 New Java 5 syntax:  New Java 5 syntax: 
android_study.1583797317.txt.gz · Last modified: 2020/03/09 23:41 by jrseti