I'm beginner in android development. When searching the web I have found that it is possible to make tabs by having the separate activities for each tab or have fragments instead. I would like to know more about theory so, my question is where it will be appropriate to use fragments and where activities? I'm curious because there might be some considerable differences for example in memory, performance or UI. Hope that I'm clear and will appreciate any help.
After reading articles on developer site, particularly page below, I have found that TabActivity is deprecated. They advice to use FragmentActivity and with the help of v4 support library it can be implemented in older version of android.
https://developer.android.com/reference/android/app/TabActivity.html
Related
Tutorial found in Android Developer can't be used together with Toolbar and Android 5.0. The alternative solution is to use SlidingTabLayout. But currently, I found FragmentTabHost.
Which method is better? What is the pros and cons for each of them? What method should I use? I've googled it and found nothing regarding the comparison between them.
Having same question. After looking at it, it's depending on your requirement.
If it does not need sliding the FragmentTabHost is enough.
I just bought a new phone and I noticed, opening for the first time Gmail and other G apps, some quite cool introduction screens.
I was wondering how this is implemented..
It doesn't look like just a simple ViewPager with fragments.
Could someone please give me an help?
I can't find any information online but those about ShowcaseView which is not what I'm looking for.
I developed a library which does exactly that: https://github.com/rubengees/introduction
And yes, it is done with a ViewPager with Fragments, but with a fairly complex layout.
Another library I have found also does it with a Viewpager: https://github.com/PaoloRotolo/AppIntro
I am Searching for the answer of my questions
Why Group Activity is deprecated?
I did not find any proper answer. My second question is
Why we have to use Fragment instead of Group Activity?
I need answer of these question in detail.
You can get your detailed answer by reading The Android 3.0 Fragments API blog. One of the relevant point is:
Embedded Activities via ActivityGroup were a nice idea, but have always been difficult to deal with since Activity is designed to be an independent self-contained component instead of closely interacting with other activities. The Fragment API is a much better solution for this, and should be considered as a replacement for embedded activities.
You can also look at Is it advised to build all apps using fragments? question. Hope it helped.
I am developing an app which requires heavy use of fragments and preferencefragments. But as these things are new to Android, I can not find any good resource to study these except developer.android.com.
developer.android.com provides a good insight, but still after reading preferenceactivity and preferencefragment from there I am a lil bit lost.
So please share some good reference on these topics. (any nice video will be extremely helpful)
Check out this YouTube video to understand Fragments:
Fragments for All: Android Open 2011
I hope it makes you understand fragments. You can also check this video tutorial:
Android 3.0 Activity Fragments Demo
I have a similar technical problem I am trying to solve where I am using android's FragmentPagerAdapter to handle swipe gestures.
This is in regards to ICS...
My question is do you know or think that the android devs used fragments for switching between the groups, people, and favorites screens?
It seems like they are using listfragment
I am curious since I am considering making my fragments very content heavy and worry about performance and such.
Thank you
Fragments are relatively light weight components which can be replaced with other fragments on the fly. Even though there is no fixed guideline on how the app UI should be broken down into fragments i would suggest using a new fragment for every use case
So from using heavyweight fragments with the viewpager I feel comfortable with assuming that my original question is true. Either way fragments can be used effectively with tons of operations and they seem to work great.