Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Activities vs. Fragment Implementation

I am having some trouble working with Activities and Fragments. I am in the early stages of app development and am ultimately looking to design the most efficient way of integrating two separate screens.

The first screen would be the "Splash Screen", It would present the user with the Logo, the ability to enter user information and sign in through either a database or with Facebook. There would also be a button available to allow the user to register for the app.

The second screen would allow the user to set up an account by defining his user information and would include a register button and also a connect with Facebook button.

I would like to know how everyone would approach the task at hand as I had initially designed the app designating 2 Activities to handle each screen. Recently, I have switched to being able to host the screens as 2 fragments under 1 Activity.

What are the benefits of each approach and which design would you opt for?

like image 898
Coova Avatar asked Oct 04 '22 02:10

Coova


1 Answers

Fragments are mainly for allowing you to display two separate UIs side-by-side on large-format devices. Fragments can combine code and UI within a single layout, and they also allow non-UI "activities", but mostly they give you flexibility in showing the various views attached to an activity.

I'd choose 2 activities, since what you're describing is a progression of operations rather than multiple views into the same operation.

like image 51
Joe Malin Avatar answered Oct 16 '22 23:10

Joe Malin