Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
How to deal with Fragmentation         on Android                   Sittiphol Phanvilai                        Managing Di...
Who am I• Sittiphol Phanvilai• nuuneoi• Cross Platform Mobile  Application Developer• Managing Director at  Hua Lampong Co...
MOLOME ™• Share our experience how  we beat fragmentation on  Android• Who should concern?  – Designer  – Developer
Agenda• Understand the  fragmentation on Android• How to beat it
Android              Freedom                         Pain for  Diverse               developerHappiness for User
Android Fragmentation               “ Android Fragmentation will bethe huge problem for developer               ”      Sit...
“Problem comes with solution           or …            ”
Understand the Fragmentation• Fragmentation   – No standard   – Too many standard• Fragmentation in Android  – Software  –...
Android Fragmentation• Software                              And each version of Android                              has ...
Software Fragmentation• Each Android OS version has 30+ version of  ROMs• Some non-Android phone also has custom  ROM
API Level• API Level 1-16• Some “must-have”  API is available only  on high API Level
Android Fragmentation• Hardware  – Screen resolution  – CPU  – GPU  – Camera  – Sensors
Screen FragmentationScreen Density       Screen Size • ldpi               • Small screen • mdpi               • Normal scr...
Screen Fragmentation   … and many more …
CPU Fragmentation• Android compatible CPU architectures  – armeabi  – armeabi-v7a  – x86• This causes some application cou...
GPU Fragmentation• GPU used on Android  – NVIDIA  – PowerVR  – Mali  – Adreno  – etc.• This causes some game couldn’t run ...
Android Fragmentation Visualized    http://www.techanalyzer.net/2012/08/22/why-android-fragmentation-never-really-mattered/
Learning Curve• It is very easy to develop easy application
Learning Curve• But it needs very high effort to make the good  one
Learning Curve
Thats why …• That’s why  – There are a lot of junk apps on Google Play  – UI of Android Application is not so beautiful (i...
Deal with Software Fragmentation               Build application based on Android 2.2 Froyo               No need to suppo...
API Level• FACT: You could compile with higher API level  and run in lower OS version                 <uses-sdk           ...
How to run new API on old OS• Sorry you couldn’t but you could do the trick     if (android.os.Build.VERSION.SDK_INT > 8) ...
Deal with Screen Fragmentation320x480   540x960   720x1280   600x1024   800x1280
Deal with Screen Fragmentation               Recommended lowest supported screen:               normal-mdpi               ...
Multiple drawable• Android provides mechanic to  use different resource for  different dpi / screen size• I suggest you to...
Designing Step• Always snap each component to screen or  another component• Use  – LinearLayout  – RelativeLayout  – Frame...
Snap Component to ScreenSnap to Top of Screen              Snap to the rightSnap to the leftSnap to the leftSnap to Bottom...
Snap Component to Screen
Snap Component            RelativeLayout
Snap Component            ListView
Snap Component            LinearLayout            - Horizontal            - weight 1:60:1:60:1:60:1
Snap ComponentFrameLayout
Never trust in “Pixel”• Actual Pixel on Screen  – px    Don’t use it!• Physical Size of the Screen  – dp, dip (Relative to...
Different dpi Screen Handling• Unhandled (px)• Handled (dp)
Designing Step: Component SizeFixed dp                        Screen Width-Related px  – Use for the “Exact Size”      – T...
Example
Fixed dp
Fixed dp
Whats actually is in px?
Screen Width-Related px
Screen Width-Related px• Inherit View or Layout and set the size on  initializing• Override onLayout if you wish to manage...
Screen Width-Related pxWindowManager wm =       (WindowManager)getApplicationContext()       .getSystemService(Context.WIN...
Screen Width-Related px
Screen Width-Related px
Screen Height-Related px• Do it for landscape application  – Horizontal Scrolling
Considering• How to consider which one to be used?  – Purpose of that component  – Beautifulness  – Emotional (           )
Example
Example
Common Problem with ImageView               How to show this image               fitting the screen in               aspec...
Common Problem with ImageView            <ImageView                android:layout_width="fill_parent"                andro...
Common Problem with ImageView            // Inherits ImageView            protected void onMeasure(int widthMeasureSpec,  ...
More Common Problem• Please note that you will see this kind of  problem a lot on Android Application  Development• You ne...
Deal with CPU Fragmentation• Directly effect Native Code (NDK)• Don’t use any platform-specific code or  assembly code• Co...
Fragmentation Beaten• Congratulations !
RAM• Each phone has different amount of free RAM• Always use AdapterView. It will help you  reduce memory consumption  – L...
Memory Leak• First reason of app crashing in large-scale  application• Don’t 100% trust in Garbage Collector• Use Context ...
Bitmap.recycle()• If you fully take control the Bitmap object,  don’t forget to recycle() it when you don’t  need it anymo...
Nested Layout• Don’t implement more than 6 levels of nested  Layout• There is always the way to reduce level of  nested La...
Caching• Normally there is so limited amount of  Storage• But some has so many• If you wish to cache anything, limit cache...
OpenGL• OpenGL could limit number of target devices,  don’t use it unless you have to.• Better use OpenGL 1.1 over OpenGL ...
Service• If you need to do some background task, go  for Service• Launch when needed only and terminate once  the task has...
Multiple APK• Google Play Store provides feature to use  multiple apk• Don’t use it. It will ruin your life in long run.
Target Devices• You can’t please everybody. If you have to  scope down the number of target devices, do  it with hard-hear...
Custom ROM• Don’t care a lot about phone with Custom  ROM. There is always a problem.• Care only major Custom ROM.
Message to Designer• Don’t expect what you design and the final  product will be 100% exactly• You could expect that on iO...
Message to Developer   Good luck
Android Fragmentation Visualized http://www.techanalyzer.net/2012/08/22/why-android-fragmentation-never-really-mattered/
Android Fragmentation Visualized http://www.techanalyzer.net/2012/08/22/why-android-fragmentation-never-really-mattered/
Android Fragmentation Visualized http://www.techanalyzer.net/2012/08/22/why-android-fragmentation-never-really-mattered/
Android Fragmentation Visualized http://www.techanalyzer.net/2012/08/22/why-android-fragmentation-never-really-mattered/
Android Fragmentation Visualized http://www.techanalyzer.net/2012/08/22/why-android-fragmentation-never-really-mattered/
Android Fragmentation Visualized http://www.techanalyzer.net/2012/08/22/why-android-fragmentation-never-really-mattered/
Android Fragmentation Visualized http://www.techanalyzer.net/2012/08/22/why-android-fragmentation-never-really-mattered/
Android Fragmentation Visualized http://www.techanalyzer.net/2012/08/22/why-android-fragmentation-never-really-mattered/
Android Fragmentation Visualized http://www.techanalyzer.net/2012/08/22/why-android-fragmentation-never-really-mattered/
Android Fragmentation Visualized http://www.techanalyzer.net/2012/08/22/why-android-fragmentation-never-really-mattered/
Android Fragmentation Visualized http://www.techanalyzer.net/2012/08/22/why-android-fragmentation-never-really-mattered/
Android Fragmentation Visualized http://www.techanalyzer.net/2012/08/22/why-android-fragmentation-never-really-mattered/
Upcoming SlideShare
Loading in …5
×

Android Fragmentation Visualized http://www.techanalyzer.net/2012/08/22/why-android-fragmentation-never-really-mattered/ How to deal with Fragmentation on Android

11,277 views

Published on

Android Fragmentation Visualized http://www.techanalyzer.net/2012/08/22/why-android-fragmentation-never-really-mattered/

  • DOWNLOAD FULL BOOKS INTO AVAILABLE FORMAT ......................................................................................................................... ......................................................................................................................... 1.DOWNLOAD FULL PDF EBOOK here { https://tinyurl.com/y8nn3gmc } ......................................................................................................................... 1.DOWNLOAD FULL EPUB Ebook here { https://tinyurl.com/y8nn3gmc } ......................................................................................................................... 1.DOWNLOAD FULL doc Ebook here { https://tinyurl.com/y8nn3gmc } ......................................................................................................................... 1.DOWNLOAD FULL PDF EBOOK here { https://tinyurl.com/y8nn3gmc } ......................................................................................................................... 1.DOWNLOAD FULL EPUB Ebook here { https://tinyurl.com/y8nn3gmc } ......................................................................................................................... 1.DOWNLOAD FULL doc Ebook here { https://tinyurl.com/y8nn3gmc } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Firstly thanks for your guidance. But I want simple example of fragment which is also compatible with Android 2.2 (using FragmentActivity not a ListFragment), will you please help me? If you have some samples then please forward me on shailesh.v88@gmail.com Thanks in advance
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Thanks for the share.
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Thanks for sharing
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

×