eskalera
eskalera

Reputation: 1092

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?

Upvotes: 5

Views: 600

Answers (4)

Ivan Bartsov
Ivan Bartsov

Reputation: 21086

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.

Upvotes: 1

CommonsWare
CommonsWare

Reputation: 1007349

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.

Upvotes: 3

mdominick
mdominick

Reputation: 1319

Normally, I would say that using a deprecated API is a bad idea. However, since you are just practicing and presumably do not need to release this application on a wide range of devices, then just carry on with the tutorial and happy learning.

Hope that helps and enjoy Android.

Upvotes: 0

LuxuryMode
LuxuryMode

Reputation: 33741

No, just follow the example here for how to Tabs with Fragments: http://developer.android.com/reference/android/app/TabActivity.html

Upvotes: 0

Related Questions