Buddy
Buddy

Reputation: 280

Is viewModel necessary to use?

I want to know that is viewModel necessary to use. Is there any alternative of ViewModel.

can I use only xml files for UI.

Upvotes: 0

Views: 812

Answers (3)

Monu Rohilla
Monu Rohilla

Reputation: 665

The simple answer is No, it's not necessary you can make complete Application Architecture by using fragments but in this way you might face many problems.

Android Architecture Components

you can use the only XML for UI

Upvotes: 0

tyczj
tyczj

Reputation: 73966

Model View ViewModel (MVVM) is a software architectural pattern so no its not necessary you can just throw everything in your activity/fragment if you wanted and it would work the same but typically you don't want to do that. There are a bunch of different patterns that you can use.

For your second question yes you can only use xml files to create your layout

Upvotes: 2

libliboom
libliboom

Reputation: 551

Both are possible to make application. But I recommend for you to use Android Architecture Components including ViewModel by google.

Upvotes: 0

Related Questions