From what I have read and heard, the Android Compatibility Package Fragments have the same capabilities than the "regular" Honeycomb Fragments.
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?
According to the Android documentation, a fragment is a part of applications user interface that is bound to an activity. Fragments have their lifecycle and layouts or UI components. Fragments help enrich your UI design, pass data between different screens, and adapt to different device configurations.
After using multiple fragments in a single activity, we can create a multi-screen UI. Fragment cannot be used without an Activity. While Using fragments in the project, the project structure will be good and we can handle it easily.
Fragments are Android's solution to creating reusable user interfaces. You can achieve some of the same things using activities and layouts (for example by using includes). However; fragments are wired in to the Android API, from HoneyComb, and up.
Fragments introduce modularity and reusability into your activity's UI by allowing you to divide the UI into discrete chunks. Activities are an ideal place to put global elements around your app's user interface, such as a navigation drawer.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With