Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between support.v7.widgets and android.widgets Toolbar, Fragment

I am creating a new application and will have to deal with ActionBar. I know that I have to extend the AppCompatActivity because the ActionBarActivity is deprecated, however I still do not understand why I have to use the support.v7.widget Toolbar rather than the android.widget Toolbar even though I am using the latest API ?

Thank you

EDIT1:

I understand now that the support.v7.widgets are there to enable devices with old APIs to comprehend what are the new functionalities added in the newer versions and mimic them in their own way. Is that correct ?

If that is correct and I do not want to have any sort of backwards compatibility does this mean I can move forward and use the android.widget Toolbar ?

Also using the android.widget Fragment unfortunately I can not add it to a ViewPager. Why is that ? Why does it force me to use an older version which has been extended to mimic the behaviour of the new implementation of the component ?

I think I just getting lost in all of those "support" libraries. Can someone briefly ( or not ) explain all that - why are there things in the support libraries that are not included or updated in the newer versions of the API ?

Thank you

like image 745
mp3por Avatar asked Dec 12 '15 11:12

mp3por


1 Answers

First of all you are asking Good Question, Android will add advanced features continuously in different API levels but those features are available from which level of API they are added

For Example: Consider android fragment functionality was added in API level 11 that means it will work for API level 11 and above but your application need for API level 10 devices also at that time it wont be work. For this reason android develop support library for cover a wide range of Android devices (support for low level API) to work those functionality.

Android always recommend developers to use support library for development for more information check here

like image 195
Ravi Jaggarapu Avatar answered Dec 10 '22 13:12

Ravi Jaggarapu