Wednesday 9 January 2019

System & Network Threats Security

  • Worms - use spawn mechanism; standalone program
  • Internet worm
 - Exploited UNIX networking features (remote access) and bugs in finger and send-mail programs. (See next slide)
          - Grappling hook program uploaded main worm program
  • Port scanning
          - Automated attempt to connect to a range of ports on one or a range of IP addresses
  • Denial of Service
           - Overloaded the targeted computer preventing it from doing any useful work.
           - Distributed denial-of-service (DDOS) come from multiple sites at once.



Security Environment and Program Threats in OS Security

Security Environment


Security Problem
  • Security must consider external environment of the system, and protect the system resources.
  • Intruders (crackers) attempt to breach security.
  • Threat is potential security violation.
  • Attack is attempt to breach security.
  • Attack can be accidental or malicious.
  • Easier to protect against accidental than malicious misuse.
Intruders
  • Snooping by insiders
  • Determined attempt to make money
  • Casual prying by nontechnical users
  • Commercial or military espionage

Accidental Data Loss
  • Hardware or Software error
            - CPU malfunction
            - Disk crash
            - Program bugs
  • Human errors
           - Data entry
           - Wrong tape mounted
  • Acts of God
           - Fires
           - Earthquakes
           - Wars


Program Threats
  • Trojan Horse
         - Code segment that misuses its environment
         - Exploits mechanisms for allowing programs written by users to be executed by other users.
         - Spyware, pop-up browser windows, convert channels
  • Trap Door
         - Specific user identifier or password that circumvents normal security procedures.
         - Could be included in a compiler.
  • Logic Bomp
          - Program that initiates a security incident under certain circumstances
  • Stack and Buffer Overflow
          - Exploits a bug in a program (overflow either the stack or memory buffers)
  • Viruses
         - Code fragment embedded in legitimate program
         - Very specific to CPU architecture, operating system, applications
         - Usually borne via email or as a macro
              * Visual Basic Macro to reformat hard drive
                     Sub AutoOpen( )
                      Dim oFS
                         set oFS = CreateObject("Scripting.FileSystemObject")
                           vs = Shell("c:command.com/kformat  c:" ,vbHide)
                                End Sub


Security Attacks: Cryptography

Attacks can be of two types.


  1. Active attacks :
           - Attempts to change and modify the information.
           - Easy to detect.
    
     2.  Passive attacks :

            - Attempts to obtain the information and not to modify.
            - Difficult to detect.

Passive Attacks

1. Release of Message Content.
      - Transmitted data may contain confidential information.
      - Monitors / listens the information.

2. Traffic Analysis.
       - Monitoring and observing the pattern of data transmission.


Active Attacks

1. Masquerade
         - One entity pretends to be a different entity.

2. Replay 
       - Passive capture of a data unit.
       - And it is retransmitted later.

3. Modification of Message
  • A legitimate message is altered.
  • And then it is retransmitted later.
4. Denial of Service.
  • Break down a communication system or network.
  • And making it unavailable to its intended users.

Principles of Security: Cryptography

Data Confidentiality
  • Privacy
  • Protect the information from any unauthorized disclosure
Data Integrity
  • Data received should be exactly same as the data sent.
  • There should be no modification.
Data Availability
  • Data must be available to the authorized parties.
Authentication
  • Ensure communication is authentic
  • Verifying the identity of sender/receiver.
Non Repudiation
  • Sender/receiver can not deny of transmitted data.


Introduction to Cryptography

Why need Cryptography?


 But Is internet secure?

→ This message can be corrupted by intruders.
      To provide the security and protect the valuable information, we can use cryptography.

What is Cryptography?


Bob wants to send a message to Alice.

His message can be sent securely by transforming the whole content into a new form others can't understand.
(Hello Alice! .........> 6EB6957008E03CE4)

The art of protecting information by transforming it into an unreadable format, is called CRYPTOGRAPHY.


Encryption and Decryption

Encryption 
    Transforming information from readable format to unreadable format.

Decryption
    Transforming information from unreadable format to readable format.

Key 
   A string of bits used by a cryptographic algorithm transform plain text into cipher text or vice versa. 
 Key remains private and secures communication.




Introduction of Information Security

Introduction
  • Information security a "well-informed sense of assurance that the information risks and controls are in balance." - Jim Anderson, Inovant (2002)
  • Security professionals must review the origins of this field to understand its impact on our understanding of information security today.
The History of Information Security
  • Computer security began immediately after the first mainframes were developed.
           - Groups developing code-breaking computations during World War 2 created the first modern computers.

           - Multiple levels of security were implemented: Badges, key, and facial recognition of authorized personnel controlled access to sensitive military locations.
  • Physical controls to limit access to sensitive military locations to authorized personnel.
  • In contrast, information security during these early years was rudimentary and mainly composed of simple document classification schemes.
  • There were no application classification projects for computers or operating systems at this time,because the primary threats to security were physical theft of equipment, espionage against the products of the systems, and sabotage. 

The 1960s
  • During the 1960s, the Department of Defense's Advanced Research Procurement Agency (ARPA) began examining the feasibility of a redundant networked communications system designed to support the military's need to exchange information.
  • Larry Roberts, known as the founder of the internet, developed the project from its inception.
The 1970s and 80s
  • ARPANET grew in popularity as did its potential for misuse.
  • Fundamental problems with ARPANET security were indentified
             - No safety procedures for dial-up connections to ARPANET
             - Nonexistent user identification and authorization to system
  • Late 1970s: microprocessor expanded computing capabilities and security threats
  • Information security began with Rand Report R-609 (paper that started the study of computer security)
  • Scope of computer security grew from physical security to include:
          - Safety of data
          - Limiting unauthorized access to data
          - Involvement of personnel from multiple levels of an organization 


What is Security?
  • "The quality or state to being secure - to be free from danger"
  • A successful organization should have multiple layers of security in place:
         - Physical security
         - Personal security
         - Operations security
         - Communications security
         - Network security
         - Information security
  • A successful organization should have the following multiple layers of security in place for the protection of its operations:
         - Physical security :- To protect the physical items, objects, or areas of an organization from unauthorized access and misuse.
         - Personal security :- To protect the individual or group of individuals who are authorized to access the organization and its operations.
         - Operations security :- To protect the details of a particular operation or series of activities.
         - Communications security :- To protect an organization's communications media, technology, and content.
         - Network security :- To protect networking components, connections, and contents.

Tuesday 8 January 2019

Create Calendar in Android Studio

DialogAdaptor.Java 
 

import android.annotation.TargetApi;
import android.app.Activity;
import android.os.Build;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import java.util.ArrayList;

public class DialogAdaptor extends BaseAdapter {
    Activity activity;

    private Activity context;
    private ArrayList<Dialogpojo> alCustom;
    private String sturl;


    public DialogAdaptor(Activity context, ArrayList<Dialogpojo> alCustom) {
        this.context = context;
        this.alCustom = alCustom;

    }

    @Override    public int getCount() {
        return alCustom.size();

    }

    @Override    public Object getItem(int i) {
        return alCustom.get(i);
    }

    @Override    public long getItemId(int i) {
        return i;
    }

    @TargetApi(Build.VERSION_CODES.O)
    @Override    public View getView(final int position, View convertView, ViewGroup parent) {
        LayoutInflater inflater = context.getLayoutInflater();
        View listViewItem = inflater.inflate(R.layout.row_addapt, null, true);

        TextView tvTitle=(TextView)listViewItem.findViewById(R.id.tv_name);
        TextView tvSubject=(TextView)listViewItem.findViewById(R.id.tv_type);
        TextView tvDuedate=(TextView)listViewItem.findViewById(R.id.tv_desc);
        TextView tvDescription=(TextView)listViewItem.findViewById(R.id.tv_class);


        tvTitle.setText("Title : "+alCustom.get(position).getTitles());
        tvSubject.setText("Subject : "+alCustom.get(position).getSubjects());
        tvDuedate.setText("Due Date : "+alCustom.get(position).getDuedates());
        tvDescription.setText("Description : "+alCustom.get(position).getDescripts());

        return  listViewItem;
    }

}

Dialogpojo.Java
 

public class Dialogpojo {
    private String titles;
    private String subjects;
    private String types;
    private String duedates;
    private String descripts;
    private String attatchmentd;
    private String sections;
    private String classe;

    public void setTitles(String titles) {
        this.titles = titles;
    }

    public void setSubjects(String subjects) {
        this.subjects = subjects;
    }

    public void setTypes(String types) {
        this.types = types;
    }

    public void setDuedates(String duedates) {
        this.duedates = duedates;
    }

    public void setDescripts(String descripts) {
        this.descripts = descripts;
    }

    public void setAttatchmentd(String attatchmentd) {
        this.attatchmentd = attatchmentd;
    }

    public String getTitles() {
        return titles;
    }

    public String getSubjects() {
        return subjects;
    }

    public String getTypes() {
        return types;
    }

    public String getDuedates() {
        return duedates;
    }

    public String getDescripts() {
        return descripts;
    }

    public String getAttatchmentd() {
        return attatchmentd;
    }

    public void setSections(String sections) {
        this.sections = sections;
    }

    public void setClasse(String classe) {
        this.classe = classe;
    }

    public String getClasse() {
        return classe;
    }

    public String getSections() {
        return sections;
    }
}
 

HomeCollection.Java


import java.util.ArrayList;
public class HomeCollection {
    public String date="";
    public String name="";
    public String subject="";
    public String description="";


    public static ArrayList<HomeCollection> date_collection_arr;
    public HomeCollection(String date, String name, String subject, String description){

        this.date=date;
        this.name=name;
        this.subject=subject;
        this.description= description;

    }
}

HwAdapter.Java



import android.widget.BaseAdapter;
import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.graphics.Color;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.GregorianCalendar;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;


public class HwAdapter extends BaseAdapter {
    private Activity context;

    private java.util.Calendar month;
    public GregorianCalendar pmonth;
    /**     * calendar instance for previous month for getting complete view     */    public GregorianCalendar pmonthmaxset;
    private GregorianCalendar selectedDate;
    int firstDay;
    int maxWeeknumber;
    int maxP;
    int calMaxP;
    int mnthlength;
    String itemvalue, curentDateString;
    DateFormat df;

    private ArrayList<String> items;
    public static List<String> day_string;
    public ArrayList<HomeCollection>  date_collection_arr;
    private String gridvalue;
    private ListView listTeachers;
    private ArrayList<Dialogpojo> alCustom=new ArrayList<Dialogpojo>();

    public HwAdapter(Activity context, GregorianCalendar monthCalendar,ArrayList<HomeCollection> date_collection_arr) {
        this.date_collection_arr=date_collection_arr;
        HwAdapter.day_string = new ArrayList<String>();
        Locale.setDefault(Locale.US);
        month = monthCalendar;
        selectedDate = (GregorianCalendar) monthCalendar.clone();
        this.context = context;
        month.set(GregorianCalendar.DAY_OF_MONTH, 1);

        this.items = new ArrayList<String>();
        df = new SimpleDateFormat("yyyy-MM-dd", Locale.US);
        curentDateString = df.format(selectedDate.getTime());
        refreshDays();

    }

    public int getCount() {
        return day_string.size();
    }

    public Object getItem(int position) {
        return day_string.get(position);
    }

    public long getItemId(int position) {
        return 0;
    }

    // create a new view for each item referenced by the Adapter    public View getView(int position, View convertView, ViewGroup parent) {
        View v = convertView;
        TextView dayView;
        if (convertView == null) { // if it's not recycled, initialize some            // attributes            LayoutInflater vi = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            v = vi.inflate(R.layout.cal_item, null);

        }


        dayView = (TextView) v.findViewById(R.id.date);
        String[] separatedTime = day_string.get(position).split("-");


        gridvalue = separatedTime[2].replaceFirst("^0*", "");
        if ((Integer.parseInt(gridvalue) > 1) && (position < firstDay)) {
            dayView.setTextColor(Color.parseColor("#A9A9A9"));
            dayView.setClickable(false);
            dayView.setFocusable(false);
        } else if ((Integer.parseInt(gridvalue) < 7) && (position > 28)) {
            dayView.setTextColor(Color.parseColor("#A9A9A9"));
            dayView.setClickable(false);
            dayView.setFocusable(false);
        } else {
            // setting curent month's days in blue color.            dayView.setTextColor(Color.parseColor("#696969"));
        }


        if (day_string.get(position).equals(curentDateString)) {

            v.setBackgroundColor(Color.parseColor("#ffffff"));
        } else {
            v.setBackgroundColor(Color.parseColor("#ffffff"));
        }


        dayView.setText(gridvalue);

        // create date string for comparison        String date = day_string.get(position);

        if (date.length() == 1) {
            date = "0" + date;
        }
        String monthStr = "" + (month.get(GregorianCalendar.MONTH) + 1);
        if (monthStr.length() == 1) {
            monthStr = "0" + monthStr;
        }

        setEventView(v, position,dayView);

        return v;
    }

    public void refreshDays() {
        // clear items        items.clear();
        day_string.clear();
        Locale.setDefault(Locale.US);
        pmonth = (GregorianCalendar) month.clone();
        // month start day. ie; sun, mon, etc        firstDay = month.get(GregorianCalendar.DAY_OF_WEEK);
        // finding number of weeks in current month.        maxWeeknumber = month.getActualMaximum(GregorianCalendar.WEEK_OF_MONTH);
        // allocating maximum row number for the gridview.        mnthlength = maxWeeknumber * 7;
        maxP = getMaxP(); // previous month maximum day 31,30....        calMaxP = maxP - (firstDay - 1);// calendar offday starting 24,25 ...        pmonthmaxset = (GregorianCalendar) pmonth.clone();

        pmonthmaxset.set(GregorianCalendar.DAY_OF_MONTH, calMaxP + 1);


        for (int n = 0; n < mnthlength; n++) {

            itemvalue = df.format(pmonthmaxset.getTime());
            pmonthmaxset.add(GregorianCalendar.DATE, 1);
            day_string.add(itemvalue);

        }
    }

    private int getMaxP() {
        int maxP;
        if (month.get(GregorianCalendar.MONTH) == month                .getActualMinimum(GregorianCalendar.MONTH)) {
            pmonth.set((month.get(GregorianCalendar.YEAR) - 1),
                    month.getActualMaximum(GregorianCalendar.MONTH), 1);
        } else {
            pmonth.set(GregorianCalendar.MONTH,
                    month.get(GregorianCalendar.MONTH) - 1);
        }
        maxP = pmonth.getActualMaximum(GregorianCalendar.DAY_OF_MONTH);

        return maxP;
    }

    public void setEventView(View v,int pos,TextView txt){

        int len=HomeCollection.date_collection_arr.size();
        for (int i = 0; i < len; i++) {
            HomeCollection cal_obj=HomeCollection.date_collection_arr.get(i);
            String date=cal_obj.date;
            int len1=day_string.size();
            if (len1>pos) {

                if (day_string.get(pos).equals(date)) {
                    if ((Integer.parseInt(gridvalue) > 1) && (pos < firstDay)) {

                    } else if ((Integer.parseInt(gridvalue) < 7) && (pos > 28)) {

                    } else {
                        v.setBackgroundColor(Color.parseColor("#343434"));
                        v.setBackgroundResource(R.drawable.rounded_calender);
                        txt.setTextColor(Color.parseColor("#696969"));
                    }

                }
            }}
    }

    public void getPositionList(String date,final Activity act){

        int len= HomeCollection.date_collection_arr.size();
        JSONArray jbarrays=new JSONArray();
        for (int j=0; j<len; j++){
            if (HomeCollection.date_collection_arr.get(j).date.equals(date)){
                HashMap<String, String> maplist = new HashMap<String, String>();
                maplist.put("hnames",HomeCollection.date_collection_arr.get(j).name);
                maplist.put("hsubject",HomeCollection.date_collection_arr.get(j).subject);
                maplist.put("descript",HomeCollection.date_collection_arr.get(j).description);
                JSONObject json1 = new JSONObject(maplist);
                jbarrays.put(json1);
            }
        }
        if (jbarrays.length()!=0) {
            final Dialog dialogs = new Dialog(context);
            dialogs.setContentView(R.layout.dialog_inform);
            listTeachers = (ListView) dialogs.findViewById(R.id.list_teachers);
            ImageView imgCross = (ImageView) dialogs.findViewById(R.id.img_cross);
            listTeachers.setAdapter(new DialogAdaptor(context, getMatchList(jbarrays + "")));
            imgCross.setOnClickListener(new View.OnClickListener() {
                @Override                public void onClick(View view) {
                    dialogs.dismiss();
                }
            });
            dialogs.show();

        }

    }

    private ArrayList<Dialogpojo> getMatchList(String detail) {
        try {
            JSONArray jsonArray = new JSONArray(detail);
            alCustom = new ArrayList<Dialogpojo>();
            for (int i = 0; i < jsonArray.length(); i++) {

                JSONObject jsonObject = jsonArray.optJSONObject(i);

                Dialogpojo pojo = new Dialogpojo();

                pojo.setTitles(jsonObject.optString("hnames"));
                pojo.setSubjects(jsonObject.optString("hsubject"));
                pojo.setDescripts(jsonObject.optString("descript"));

                alCustom.add(pojo);

            }


        } catch (JSONException e) {
            e.printStackTrace();
        }
        return alCustom;
    }
}

MainActivity.Java


import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.GridView;
import android.widget.ImageButton;
import android.widget.TextView;
import android.widget.Toast;
import java.util.ArrayList;
import java.util.GregorianCalendar;

public class MainActivity extends AppCompatActivity {
    public GregorianCalendar cal_month, cal_month_copy;
    private HwAdapter hwAdapter;
    private TextView tv_month;
    @Override    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        HomeCollection.date_collection_arr=new ArrayList<HomeCollection>();
        HomeCollection.date_collection_arr.add( new HomeCollection("2019-01-01" ,"New Year's Day","Holiday","Today is holiday"));
        HomeCollection.date_collection_arr.add( new HomeCollection("2019-01-14" ,"Makar Sankranti /Pongal","Holiday","Today is holiday"));
        HomeCollection.date_collection_arr.add( new HomeCollection("2019-01-26" ,"Republic Day","Holiday","Today is holiday"));
        HomeCollection.date_collection_arr.add( new HomeCollection("2019-03-04" ,"Maha Shivaratri","Holiday","Today is holiday"));
        HomeCollection.date_collection_arr.add( new HomeCollection("2019-03-21" ,"Holi","Holiday","Today is holiday"));
        HomeCollection.date_collection_arr.add( new HomeCollection("2019-04-06" ,"Ugadi/Gudi Padwa","Holiday","Today is holiday"));
        HomeCollection.date_collection_arr.add( new HomeCollection("2019-04-13" ,"Ram Navami","Holiday","Today is holiday"));
        HomeCollection.date_collection_arr.add( new HomeCollection("2019-04-17" ,"Mahavir Jayanti","Holiday","Today is holiday"));
        HomeCollection.date_collection_arr.add( new HomeCollection("2019-04-19" ,"Good Friday","Holiday","Today is holiday"));
        HomeCollection.date_collection_arr.add( new HomeCollection("2019-05-01" ,"Labor Day","Holiday","Today is holiday"));



        cal_month = (GregorianCalendar) GregorianCalendar.getInstance();
        cal_month_copy = (GregorianCalendar) cal_month.clone();
        hwAdapter = new HwAdapter(this, cal_month,HomeCollection.date_collection_arr);

        tv_month = (TextView) findViewById(R.id.tv_month);
        tv_month.setText(android.text.format.DateFormat.format("MMMM yyyy", cal_month));


        ImageButton previous = (ImageButton) findViewById(R.id.ib_prev);
        previous.setOnClickListener(new View.OnClickListener() {
            @Override            public void onClick(View v) {
                if (cal_month.get(GregorianCalendar.MONTH) == 4&&cal_month.get(GregorianCalendar.YEAR)==2017) {
                    //cal_month.set((cal_month.get(GregorianCalendar.YEAR) - 1), cal_month.getActualMaximum(GregorianCalendar.MONTH), 1);                    Toast.makeText(MainActivity.this, "Event Detail is available for current session only.", Toast.LENGTH_SHORT).show();
                }
                else {
                    setPreviousMonth();
                    refreshCalendar();
                }


            }
        });
        ImageButton next = (ImageButton) findViewById(R.id.Ib_next);
        next.setOnClickListener(new View.OnClickListener() {
            @Override            public void onClick(View v) {
                if (cal_month.get(GregorianCalendar.MONTH) == 5&&cal_month.get(GregorianCalendar.YEAR)==2018) {
                    //cal_month.set((cal_month.get(GregorianCalendar.YEAR) + 1), cal_month.getActualMinimum(GregorianCalendar.MONTH), 1);                    Toast.makeText(MainActivity.this, "Event Detail is available for current session only.", Toast.LENGTH_SHORT).show();
                }
                else {
                    setNextMonth();
                    refreshCalendar();
                }
            }
        });
        GridView gridview = (GridView) findViewById(R.id.gv_calendar);
        gridview.setAdapter(hwAdapter);
        gridview.setOnItemClickListener(new AdapterView.OnItemClickListener() {

            public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
                String selectedGridDate = HwAdapter.day_string.get(position);
                ((HwAdapter) parent.getAdapter()).getPositionList(selectedGridDate, MainActivity.this);
            }

        });
    }
    protected void setNextMonth() {
        if (cal_month.get(GregorianCalendar.MONTH) == cal_month.getActualMaximum(GregorianCalendar.MONTH)) {
            cal_month.set((cal_month.get(GregorianCalendar.YEAR) + 1), cal_month.getActualMinimum(GregorianCalendar.MONTH), 1);
        } else {
            cal_month.set(GregorianCalendar.MONTH,
                    cal_month.get(GregorianCalendar.MONTH) + 1);
        }
    }

    protected void setPreviousMonth() {
        if (cal_month.get(GregorianCalendar.MONTH) == cal_month.getActualMinimum(GregorianCalendar.MONTH)) {
            cal_month.set((cal_month.get(GregorianCalendar.YEAR) - 1), cal_month.getActualMaximum(GregorianCalendar.MONTH), 1);
        } else {
            cal_month.set(GregorianCalendar.MONTH, cal_month.get(GregorianCalendar.MONTH) - 1);
        }
    }

    public void refreshCalendar() {
        hwAdapter.refreshDays();
        hwAdapter.notifyDataSetChanged();
        tv_month.setText(android.text.format.DateFormat.format("MMMM yyyy", cal_month));
    }
}

Activity_main.xml

<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"    xmlns:app="http://schemas.android.com/apk/res-auto"    xmlns:tools="http://schemas.android.com/tools"    android:layout_width="match_parent"    android:layout_height="match_parent"    tools:context=".MainActivity">

    <LinearLayout        android:layout_width="match_parent"        android:layout_height="wrap_content"        android:layout_margin="4dp"        android:background="#343434"        android:id="@+id/ll_calendar"        android:orientation="vertical" >

        <LinearLayout            android:id="@+id/header"            android:layout_width="fill_parent"            android:layout_height="wrap_content"            android:background="#ffffff"            android:gravity="center"            android:orientation="horizontal"            android:padding="10dp" >

            <FrameLayout                android:layout_width="45dp"                android:layout_height="45dp" >

                <ImageButton                    android:id="@+id/ib_prev"                    android:layout_width="wrap_content"                    android:layout_height="wrap_content"                    android:layout_gravity="center"                    android:layout_margin="2dp"                    android:background="@drawable/left_arrow" />

            </FrameLayout>

            <RelativeLayout                android:layout_width="wrap_content"                android:layout_height="wrap_content"                android:layout_weight="1" >

                <TextView                    android:id="@+id/tv_month"                    android:layout_width="wrap_content"                    android:layout_height="wrap_content"                    android:layout_centerHorizontal="true"                    android:text="January"                    android:textColor="#4b4a4a"                    android:textSize="20dip"                    android:textStyle="bold" />
                <TextView                    android:layout_width="wrap_content"                    android:layout_height="wrap_content"                    android:layout_below="@+id/tv_month"                    android:text="Tap on day to see its detail"                    android:layout_centerHorizontal="true"                    android:textColor="#4b4a4a"                    android:textSize="12dp"                    android:textStyle="normal" />
            </RelativeLayout>

            <FrameLayout                android:layout_width="45dp"                android:layout_height="45dp" >

                <ImageButton                    android:id="@+id/Ib_next"                    android:layout_width="wrap_content"                    android:layout_height="wrap_content"                    android:layout_margin="2dp"                    android:background="@drawable/right_arrow" />

            </FrameLayout>
        </LinearLayout>

        <TableRow            android:id="@+id/tableRow1"            android:layout_width="match_parent"            android:layout_height="wrap_content"            android:paddingBottom="5dp"            android:background="#ffffff"            android:paddingLeft="2dp"            android:paddingRight="2dp"            android:paddingTop="6dp" >

            <TextView                android:id="@+id/TextView06"                android:layout_width="wrap_content"                android:layout_height="wrap_content"                android:layout_weight="1"                android:gravity="center"                android:text="S"                android:textColor="#4b4a4a" />

            <TextView                android:id="@+id/TextView05"                android:layout_width="wrap_content"                android:layout_height="wrap_content"                android:layout_weight="1"                android:gravity="center"                android:text="M"                android:textColor="#4b4a4a" />

            <TextView                android:id="@+id/TextView04"                android:layout_width="wrap_content"                android:layout_height="wrap_content"                android:layout_weight="1"                android:gravity="center"                android:text="T"                android:textColor="#4b4a4a" />

            <TextView                android:id="@+id/TextView03"                android:layout_width="wrap_content"                android:layout_height="wrap_content"                android:layout_weight="1"                android:gravity="center"                android:text="W"                android:textColor="#4b4a4a" />

            <TextView                android:id="@+id/TextView02"                android:layout_width="wrap_content"                android:layout_height="wrap_content"                android:layout_weight="1"                android:gravity="center"                android:text="T"                android:textColor="#4b4a4a" />

            <TextView                android:id="@+id/TextView01"                android:layout_width="wrap_content"                android:layout_height="wrap_content"                android:layout_weight="1"                android:gravity="center"                android:text="F"                android:textColor="#4b4a4a" />

            <TextView                android:id="@+id/textView1"                android:layout_width="wrap_content"                android:layout_height="wrap_content"                android:layout_weight="1"                android:gravity="center"                android:text="S"                android:textColor="#4b4a4a" />

        </TableRow>

        <TextView            android:id="@+id/textView2"            android:layout_width="match_parent"            android:layout_height="2dp"            android:background="#dfdfdf"            android:padding="1dp" />

        <GridView            android:id="@+id/gv_calendar"            android:layout_width="match_parent"            android:layout_height="wrap_content"            android:background="#ffffff"            android:cacheColorHint="#ffffff"            android:gravity="center"            android:listSelector="@android:color/transparent"            android:numColumns="7"            android:padding="2dp"            android:stretchMode="columnWidth"            android:textAlignment="gravity" >

        </GridView>

    </LinearLayout>
    <RelativeLayout        android:layout_width="match_parent"        android:layout_below="@+id/ll_calendar"        android:layout_height="match_parent">


    </RelativeLayout>

    <TextView        android:id="@+id/text_view_difficulty"        android:layout_width="wrap_content"        android:layout_height="wrap_content"        android:layout_below="@id/ll_calendar"        android:freezesText="true"        android:gravity="center"        android:textSize="20dp"        android:layout_marginTop="80dp"        android:text="All Circle are Holiday!!"        android:textColor="@android:color/black" />

</RelativeLayout>
 
cal_item.xml
 
 
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"    android:layout_width="fill_parent"    android:layout_height="fill_parent"    android:layout_gravity="center"    android:background="#ffffff"    android:gravity="center"    android:orientation="vertical"    android:padding="4dp" >

    <LinearLayout        android:layout_width="match_parent"        android:layout_height="wrap_content"        android:layout_gravity="center"        android:gravity="center"        android:orientation="vertical"        android:padding="1dp" >

        <TextView            android:id="@+id/date"            android:layout_width="wrap_content"            android:layout_height="wrap_content"            android:layout_margin="2dp"            android:gravity="center_vertical"            android:padding="2dp"            android:textColor="#3d3c3c"            android:textSize="14dip"            android:textStyle="bold" />

        <ImageView            android:id="@+id/date_icon"            android:layout_width="wrap_content"            android:layout_height="wrap_content"            android:visibility="gone" />

    </LinearLayout>

</LinearLayout>

dialog_inform.xml

<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"    android:layout_width="match_parent"    android:layout_height="match_parent">

    <RelativeLayout        android:layout_width="match_parent"        android:id="@+id/tv_title"        android:layout_height="60dp">
        <ImageView            android:layout_width="20dp"            android:layout_height="20dp"            android:id="@+id/img_cross"            android:layout_marginLeft="10dp"            android:layout_marginTop="10dp"            android:src="@drawable/multiply"/>
        <TextView            android:layout_width="match_parent"            android:layout_height="wrap_content"            android:gravity="center"            android:layout_centerHorizontal="true"            android:layout_centerInParent="true"            android:text="Holiday"            android:layout_marginRight="10dp"            android:layout_marginLeft="10dp"            android:layout_toRightOf="@+id/img_cross"            android:textSize="18dp"            android:textColor="@color/colorPrimary"            android:id="@+id/tv_date"/>
        <View            android:layout_width="match_parent"            android:layout_marginTop="10dp"            android:layout_alignParentBottom="true"            android:background="#939393"            android:layout_height="0.2dp"/>

    </RelativeLayout>
    <ListView        android:layout_width="wrap_content"        android:id="@+id/list_teachers"        android:divider="#004e4e4e"        android:layout_below="@+id/tv_title"        android:dividerHeight="0dp"        android:layout_height="wrap_content">
    </ListView>

</RelativeLayout>

row_addapt.xml


<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"    android:layout_width="match_parent"    android:layout_height="match_parent">

    <TextView        android:layout_width="match_parent"        android:layout_height="wrap_content"        android:paddingLeft="10dp"        android:layout_marginLeft="10dp"        android:layout_marginRight="10dp"        android:layout_centerHorizontal="true"        android:text="event on "        android:textColor="#696969"        android:layout_marginTop="10dp"        android:layout_below="@+id/tv_title"        android:textSize="16dp"        android:id="@+id/tv_name"/>
    <TextView        android:layout_width="match_parent"        android:layout_height="wrap_content"        android:paddingLeft="10dp"        android:layout_marginLeft="10dp"        android:layout_marginRight="10dp"        android:layout_centerHorizontal="true"        android:text="event on "        android:textColor="#696969"        android:layout_marginTop="5dp"        android:layout_below="@+id/tv_name"        android:textSize="16dp"        android:id="@+id/tv_type"/>
    <TextView        android:layout_width="match_parent"        android:layout_height="wrap_content"        android:paddingLeft="10dp"        android:visibility="gone"        android:layout_marginLeft="10dp"        android:layout_marginRight="10dp"        android:layout_centerHorizontal="true"        android:text="event on "        android:textColor="#696969"        android:layout_marginTop="5dp"        android:layout_below="@+id/tv_type"        android:textSize="16dp"        android:id="@+id/tv_desc"/>
    <TextView        android:layout_width="match_parent"        android:layout_height="wrap_content"        android:paddingLeft="10dp"        android:layout_marginLeft="10dp"        android:layout_marginRight="10dp"        android:layout_centerHorizontal="true"        android:text="event on "        android:textColor="#696969"        android:layout_marginTop="5dp"        android:layout_below="@+id/tv_desc"        android:textSize="16dp"        android:id="@+id/tv_class"/>
    <TextView        android:layout_width="match_parent"        android:layout_height="wrap_content"        android:paddingLeft="10dp"        android:layout_marginLeft="10dp"        android:layout_marginRight="10dp"        android:visibility="gone"        android:layout_centerHorizontal="true"        android:text="event on "        android:textColor="#696969"        android:layout_marginTop="5dp"        android:layout_below="@+id/tv_class"        android:textSize="16dp"        android:id="@+id/tv_section"/>
    <View        android:layout_width="match_parent"        android:background="#8f8e8e"        android:layout_below="@+id/tv_section"        android:id="@+id/visdf"        android:layout_marginRight="20dp"        android:layout_marginLeft="20dp"        android:layout_marginTop="10dp"        android:layout_height="1.5dp"/>
    <ImageView        android:layout_width="match_parent"        android:layout_height="65dp"        android:id="@+id/img_save"        android:layout_marginRight="20dp"        android:layout_below="@+id/visdf"        android:layout_marginLeft="20dp"        android:visibility="gone"        android:layout_marginTop="20dp"        />
    <View        android:layout_width="match_parent"        android:layout_marginTop="20dp"        android:visibility="gone"        android:background="#393939"        android:layout_marginLeft="20dp"        android:layout_marginRight="20dp"        android:layout_below="@+id/img_save"        android:layout_marginBottom="20dp"        android:layout_height="0.2dp"/>


</RelativeLayout>

Popular Posts

Categories

AI (27) Android (24) AngularJS (1) Assembly Language (2) aws (17) Azure (7) BI (10) book (4) Books (118) C (77) C# (12) C++ (82) Course (62) Coursera (180) Cybersecurity (22) data management (11) Data Science (96) Data Strucures (6) Deep Learning (9) Django (6) Downloads (3) edx (2) Engineering (14) Excel (13) Factorial (1) Finance (6) flutter (1) FPL (17) Google (19) Hadoop (3) HTML&CSS (46) IBM (25) IoT (1) IS (25) Java (92) Leet Code (4) Machine Learning (44) Meta (18) MICHIGAN (5) microsoft (4) Pandas (3) PHP (20) Projects (29) Python (754) Python Coding Challenge (232) Questions (2) R (70) React (6) Scripting (1) security (3) Selenium Webdriver (2) Software (17) SQL (40) UX Research (1) web application (8)

Followers

Person climbing a staircase. Learn Data Science from Scratch: online program with 21 courses