Skip to main content

Why use "regular” Fragments when you have the Android Compatibility Package?


From what I have read and heard, the Android Compatibility Package Fragments have the same capabilities than the "regular" Honeycomb Fragments.



  • On one hand you have Fragments that work with devices from 1.6 to 4.0.

  • On the other hand you have Fragments that only work with devices from 3.1 to 4.0.



Google is apparently planning to maintain the compatibility package for a while.



What are the reasons that would make me choose the "regular" ones instead of the ACP ones?



The only reason I could find is the size. The ACP jar is 220ko, but it is not that much in my opinion.



Is that a matter of speed? Something else I could not think about?


Source: Tips4all
Source: Tips4allSource: CCNA FINAL EXAM

Comments

  1. From what I have read and heard, the Android Compatibility Package Fragments have the same capabilities than the "regular" Honeycomb Fragments.


    Generally, yes. Note that it is now call the Android support package, since it has stuff in it that does not qualify for "compatibility", such as ViewPager.


    What are the reasons that would make me choose the "regular" ones instead of the ACP ones?



    Size, as you mention
    You have to inherit from FragmentActivity, which can cause problems with other code where you cannot inherit from FragmentActivity (e.g., Google Maps and MapActivity)
    Some things in Android will assume OS-supplied fragments (e.g., ActionBar.TabListener), which in some cases can be worked around but perhaps not in others


    There are probably other reasons as well, but those are ones that come to mind.

    ReplyDelete

Post a Comment

Popular posts from this blog

Wildcards in a hosts file

I want to setup my local development machine so that any requests for *.local are redirected to localhost . The idea is that as I develop multiple sites, I can just add vhosts to Apache called site1.local , site2.local etc, and have them all resolve to localhost , while Apache serves a different site accordingly.