Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should a newbie forget about fragments?

I just started developing on Android. I'm practicing with a Tablayout tutorial in API 15 when I see TabActivities are deprecated.

Would I be better off just forgetting about Fragments for now and keep developing with TabActivities?

like image 701
eskalera Avatar asked Oct 09 '22 22:10

eskalera


2 Answers

Would I be better off just forgetting about Fragments for now and keep developing with TabActivities?

IMHO, no.

Get yourself a copy of ActionBarSherlock and implement tabs in the action bar. That is the tab pattern going forward with Honeycomb and Ice Cream Sandwich, and ActionBarSherlock lets you use the same approach for Android 2.x devices as well. You are better served aiming for the future, not the past.

Note that you do not have to use fragments with action bar tabs, though you can.

like image 101
CommonsWare Avatar answered Oct 12 '22 11:10

CommonsWare


I suggest you learn Fragments. There's no point in using TabActivities any more, there's a static support libary (you can see it available for download in Android SDK Manager) that will allow you to use fragments on older APIs - that's the way it's meant to be done now. Go with Fragments and action bar pattern, new is always better :)

Also, be ready to dump any other deprecated piece of API or obsolete UI approach. Mobile development evolves pretty quickly.

like image 43
Ivan Bartsov Avatar answered Oct 12 '22 10:10

Ivan Bartsov