Skip to main content

Posts

MVVM Android Example

  What is MVVM? For a start, let's consider the classical description of this template and analyze each of its components.  Model-View-ViewModel  (ie  MVVM ) is a template of a client application architecture, proposed by John Gossman as an alternative to MVC and MVP patterns when using Data Binding technology. Its concept is to separate  data presentation logic  from  business logic  by moving it into particular class for a clear distinction. So, what does each of the three parts in the title mean? Model is the logic associated with the application data. In other words, it is POJO, API processing classes, a database, and so on. View is actually a layout of the screen, which houses all the widgets for displaying information. ViewModel is an object which describes the behavior of View logic depending on the result of Model work. You can call it  a behavior model of View . It can be a rich text formatting as well as a component visibility contr...
Recent posts

Set Alarm on specified time using Broadcast reciever in Android

Alarm.java import java.util.Calendar; import android.app.Activity; import android.app.AlarmManager; import android.app.PendingIntent; import android.app.TimePickerDialog; import android.app.TimePickerDialog.OnTimeSetListener; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.TextView; import android.widget.TimePicker; import android.widget.Toast; public class Alarm extends Activity {     TimePicker TimePicker;     Button Setalarm;     TimePickerDialog timePickerDialog;     final static int RQS_1 = 1;     /** Called when the activity is first created. */     @Override     public void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState); ...