Thursday, December 28, 2023

What is React?

 

What is React?

React is a JavaScript library that aims to simplify development of visual interfaces.

Developed at Facebook and released to the world in 2013, it drives some of the most widely used apps, powering Facebook and Instagram among countless other applications.

Its primary goal is to make it easy to reason about an interface and its state at any point in time, by dividing the UI into a collection of components.

React has taken the frontend web development world by storm.

Less complex than the other alternatives

At the time when React was announced, Ember.js and Angular 1.x were the predominant choices as a framework. Both these imposed so many conventions on the code that porting an existing app was not convenient at all.

React made a choice to be very easy to integrate into an existing project, because that’s how they had to do it at Facebook in order to introduce it to the existing codebase. Also, those 2 frameworks brought too much to the table, while React only chose to implement the View layer instead of the full MVC stack.

Backed by Facebook

Being backed by Facebook is, of course, going to benefit a project if it turns out to be successful.

Facebook currently has a strong interest in React, sees the value of it being Open Source, and this is a huge plus for all the developers using it in their own projects.

How to install React on your development computer

How do you install React?

React is a library, so saying install might sound a bit weird. Maybe setup is a better word, but you get the concept.

There are various ways to setup React so that it can be used on your app or site.





Wednesday, November 22, 2023

Understanding Cyber Security

 

What is Cyber Security? 

The term ‘cyber security’ refers to all safeguards and measures implemented to reduce the likelihood of a digital security breach. Cyber security affects all computers and mobile devices across the board – all of which may be targeted by cyber criminals. Cyber security focuses heavily on privacy and confidentiality, along with data integrity and identity protection. Security breaches in general are nothing new, but have become more commonplace and problematic in today’s digital era. The greater the extent to which the world becomes reliant on connected technology, the greater the threat posed by cybercriminals worldwide. 

From reputation damage to system downtime to financial loss, cyber security issues can be incredibly costly. According to a recent study, almost half of all businesses operating in 2017 experienced at least one cyber attack or attempted security breach. Precisely the reason why businesses worldwide have begun prioritizing cyber security, implementing robust protective measures and hiring cyber security experts to oversee their operations. 


The Importance of Security


The Internet has transformed the face of everyday life for billions of people worldwide. Already enormous, daily web traffic volumes are growing at an exponential rate. To such an extent that the vast majority of communications and business activities worldwide are fundamentally reliant on the Internet. From simple retail purchases to the most sensitive and high-profile business activities, everything takes place online. All of which adds up to a near-irresistible opportunity for the 21st century cyber criminal. 

Turning a blind eye to cyber security is no longer an option. Businesses that fail to adequately protect themselves face the prospect of catastrophic consequences. Irrespective of the size, nature or purpose of the business, the effects of a cyber attack can be devastating. What’s more, some of the highest profile attacks over recent years have demonstrated how even the biggest companies in the world aren’t always as well protected as they think they are. Even when their systems are brought back online and business continues as normal, the reputational damage incurred can be much more difficult to overcome. 

Of course, it’s not simply a case of proactively protecting your business and its general interests from cyber attacks. You also need to think carefully about the extent to which your customers are protected. Oftentimes, a security breach that has negative consequences for one or more customers can be far more detrimental than an attack on the company itself. Businesses aren’t simply expected to protect their customers online – they have a legal obligation to do so. All of which amounts to yet another responsibility, which calls for the input and expertise of talented of cyber security specialists.


 

Friday, August 4, 2023

All Android Attribute for IT Students

I can provide you with a categorized list of some commonly used 

layout attributes 

for different types of views:

 

1. Common Layout Attributes:

   - android:id: View identifier.

   - android:layout_width and android:layout_height: View dimensions.

   - android:layout_gravity: View gravity within its parent.

   - android:layout_margin: Margins around the view.

   - android:layout_marginStart, android:layout_marginEnd, android:layout_marginTop, android:layout_marginBottom: Specific margins for individual sides.

   - android:layout_weight: Distribution of extra space in LinearLayout.

 

2. RelativeLayout Attributes:

   - android:layout_toStartOf, android:layout_toEndOf, android:layout_above, android:layout_below: Positions the view relative to another sibling view.

   - android:layout_alignParentStart, android:layout_alignParentEnd, android:layout_alignParentTop, android:layout_alignParentBottom: Aligns the view to the start, end, top, or bottom of its parent container.

   - android:layout_alignStart, android:layout_alignEnd, android:layout_alignTop, android:layout_alignBottom: Aligns the view relative to another sibling view.

   - android:layout_alignBaseline: Aligns the baseline of the view to the baseline of another view.

 

3. LinearLayout Attributes:

   - android:orientation: Defines the orientation of the LinearLayout (horizontal or vertical).

   - android:baselineAligned: Aligns the children based on their baseline.

 

4. FrameLayout Attributes:

   - android:foreground: Foreground drawable.

 

5. GridLayout Attributes:

   - android:layout_row, android:layout_rowSpan, android:layout_column, android:layout_columnSpan: Row and column positioning for GridLayout.

 

6. ConstraintLayout Attributes:

   - Constraint attributes like app:layout_constraintStart_toStartOf, app:layout_constraintEnd_toEndOf, app:layout_constraintTop_toTopOf, etc.

   - app:layout_constraintWidth_percent, app:layout_constraintHeight_percent: View dimensions as percentages of the parent.

 

7. TableLayout Attributes:

   - android:shrinkColumns, android:stretchColumns: Column behavior.

 

These are just some of the commonly used layout attributes. Android has many more attributes for specific views and layout containers, which you can refer to in official Android documentation.

 

I can provide you with a categorized list of some commonly used 

UI attributes 

for different types of views:

 

1. Common View Attributes:

   - android:id: View identifier.

   - android:layout_width and android:layout_height: View dimensions.

   - android:layout_gravity: View gravity within its parent.

   - android:layout_margin: Margins around the view.

   - android:layout_marginStart, android:layout_marginEnd, android:layout_marginTop, android:layout_marginBottom: Specific margins for individual sides.

   - android:padding: Padding inside the view.

   - android:paddingStart, android:paddingEnd, android:paddingTop, android:paddingBottom: Specific padding for individual sides.

   - android:background: Background drawable or color for the view.

 

2. TextView Attributes:

   - android:text: Text content of the TextView.

   - android:textSize: Text size.

   - android:textColor: Text color.

   - android:textStyle: Text style (bold, italic, etc.).

   - android:gravity: Text gravity within the TextView.

   - android:ellipsize: Ellipsize behavior when text overflows.

   - android:maxLines: Maximum number of lines for multiline text.

 

3. ImageView Attributes:

   - android:src: Image resource to display.

   - android:scaleType: Scale type for the image (fit, center, etc.).

   - android:tint: Tint color for the image.

 

4. Button Attributes:

   - android:text: Text content of the button.

   - android:textSize: Text size.

   - android:textColor: Text color.

   - android:background: Background drawable or color for the button.

 

5. EditText Attributes:

   - android:hint: Hint text displayed when the EditText is empty.

   - android:inputType: Input type for the EditText (text, number, password, etc.).

   - android:maxLength: Maximum character length allowed.

 

6. ProgressBar Attributes:

   - android:progress: Current progress value.

   - android:max: Maximum value for the progress.

   - android:progressTint: Tint color for the progress bar.

 

7. CheckBox and RadioButton Attributes:

   - android:text: Text content next to the checkbox or radio button.

   - android:checked: Specifies whether the checkbox or radio button is checked.

 

8. Spinner Attributes:

   - android:entries: Array resource containing the spinner options.

   - android:prompt: Prompt text displayed when the spinner is closed.

 

9. CardView Attributes:

   - app:cardCornerRadius: Corner radius for the CardView.

   - app:cardElevation: Elevation (shadow) for the CardView.

   - app:cardBackgroundColor: Background color of the CardView.

 

These are some commonly used UI attributes in Android. Each view type has its own specific set of attributes, and Android offers a wide range of customization options.

 


Monday, July 3, 2023

Creating Application to Call API Using Angular

 

To create an application that calls an API using Angular, you can follow these steps:


1. Set up your Angular development environment: Make sure you have Node.js installed on your machine. Install Angular CLI (Command Line Interface) by running the following command in your terminal or command prompt:


npm install -g @angular/cli



2. Create a new Angular project: Create a new Angular project by running the following command:


ng new my-app


This will create a new directory called "my-app" with the basic structure of an Angular project.


3. Navigate to the project directory: Change to the project directory using the command:


cd my-app


4. Create a service: In Angular, services are used to encapsulate reusable code and handle API requests. Create a service to interact with the API by running the following command:


ng generate service api


This will create a new file named `api.service.ts` in the `src/app` directory.


5. Implement API call logic: Open `api.service.ts` and import the necessary modules and HttpClient from `@angular/common/http`. Update the class to include a method that makes an HTTP request to the desired API. For example:

typescript

import { Injectable } from '@angular/core';

import { HttpClient } from '@angular/common/http';


@Injectable({

  providedIn: 'root'

})

export class ApiService {


  constructor(private http: HttpClient) { }


  getData() {

    return this.http.get('https://api.example.com/data');

  }

}

```


6. Inject the service into a component: Open `src/app/app.component.ts` and import the ApiService. Update the AppComponent class to include the service as a dependency. For example:

typescript

import { Component } from '@angular/core';

import { ApiService } from './api.service';


@Component({

  selector: 'app-root',

  template: '<button (click)="getData()">Get Data</button>',

})

export class AppComponent {

  constructor(private apiService: ApiService) { }


  getData() {

    this.apiService.getData().subscribe((data) => {

      console.log(data);

    });

  }

}



7. Add HttpClientModule to the application: Open `src/app/app.module.ts` and import HttpClientModule from `@angular/common/http`. Add it to the imports array in the NgModule decorator. For example:

typescript

import { NgModule } from '@angular/core';

import { BrowserModule } from '@angular/platform-browser';

import { HttpClientModule } from '@angular/common/http';

import { AppComponent } from './app.component';


@NgModule({

  declarations: [

    AppComponent

  ],

  imports: [

    BrowserModule,

    HttpClientModule

  ],

  providers: [],

  bootstrap: [AppComponent]

})

export class AppModule { }



8. Run the application: Launch the application by running the following command in the project directory:


ng serve


This will start a development server, and your application will be accessible at `http://localhost:4200`.


9. Test the API call: Open your browser and navigate to `http://localhost:4200`. Click the "Get Data" button, and the API call will be made, with the response logged to the console.


This is a basic example of calling an API in an Angular application. You can customize it based on your specific API requirements, handle API responses, error handling, and data manipulation as per your application needs.



Thursday, June 29, 2023

Unit -1: Web Application development using J2EE for IMCA, BCA, MCA and all IT Students




Unit -1:  Web Application development using J2EE

Contents

1.    What is J2EE. 3

2.    What is Enterprise Architecture: 3

3.    The J2EE Platform.. 6

4.    J2EE APIs. 7

5.    Servlet : 8

6.    JSP. 8

7.    EJB

8.    JMS. 9

9.    Introduction to Containers. 12

10.    Tomcat as a Web Container. 12

11.    Configuration of Webserver - Apache Tomcat Server 13

12.    RMI 15

13.    RMI Architecture. 16

14.    Developing and Executing RMI application. 19

 


      J2EE is the  Java  2  Enterprise  Edition  platform  defined  by Sun.

      J2EE is a  platform-independent,  Java-central  environment from Sun for developing, building and deploying Web-based enterprise applications online.

      The J2EE platform  consists  of  a  set  of  services,  APIs,  and protocols  that  provide  the  functionality  for  developing multitier or Web-based applications.

      Core  java  is  the  basic  java  programming  and  is  called  as the  J2SE(Java 2  Standard  Edition.)  This  is  basically  used  to develop standalone programs.

      Based  on  this  sun  has  released  the  J2EE(Java 2 Enterprise Edition.)This  is  basically  used  to  develop  the  enterprise applications and also web applications.

      J2EE consists of Servlets, JSP, JDBC, EJB etc…

      J2EE can be expanded as Java 2 Enterprise Edition that offers a development environment for enterprise application creation and implementation.

      J2EE Architecture is made up of three tier,

      Such as the client tier that is used as an interactive medium for the end user or the client & consists of web clients and application clients.

      The middle tier that is used for defining logical functioning units & consist of web components and EJB components.

      And the enterprise data tier that is used for storage purposes in the form of relational database & consists of containers, components and services.

      J2EE Architecture consist of different architecture. And that is

      Two Tier Architecture.

      Three Tier Architecture.

      N – Tier Architecture. 

      Each are clearly define with there name

      One tier component run on Sing client Machine

      Tow tier component run on client as well as on database server.

      Three tier component run on client , middleware and database server.

      N tier component require client, middleware and Multiple database. 

      The J2EE platform simplifies enterprise applications by basing them on standardized, modular components,  by  providing  a complete  set  of  services  to  those  components,  and  by  handling many  details  of  application  behavior  automatically,  without complex  programming.

      The  J2EE  platform  enables  you  to  assemble  applications  from  a combination of  standard, commercially available components and their own custom components.

      Another  advantage  of  the  J2EE  platform  is  that  the  application model  encapsulates  the  layers  of  functionality  in specific  types  of components.

      The J2EE platform consists of a set of services, APIs, and protocols that provide the functionality for developing multitier, Web-based applications.

      Some of the key features and services of J2EE is  At the client tier, J2EE supports pure HTML, as well as Java applets or applications.

      Enterprise JavaBeans (EJBs) provide another layer where the platform's logic is stored. An EJB server provides functions such as threading, concurrency, security and memory management.

      Java Database Connectivity (JDBC), which is the Java equivalent to ODBC, is the standard interface for Java databases. The Java servlet API enhances consistency for developers without requiring a graphical user interface.

      The J2EE platform also supports stand-alone Java application clients.

      NetBeans,  Eclipse etc are IDE which provide J2EE Platforms.

      API  is  stand  for  Application  Programming Interface,  which  is  a  software  intermediary  that allows  two  applications  to  talk  to  each  other.

      Each time  you  use  an  app  like  Facebook,  send  an  instant message,  or  check  the  weather  on  your  phone, you’re using an API.

      API  is  set  of  Subroutine,  Definition, Communication  Protocol,  and  tools  for  building software.

      A  good  API  makes  it  easier  to  develop  a  computer program by providing all the building blocks.

      The  API  describe  and  prescribes  the  Expected behavior and Actual implementation of program.

      Following is list of J2EE API

      Servlet

      JSP

      EJB

      JMS

      JavaMail

      JSF

      JNDI

      Servlet technology is used to create a web application.

      It is robust and scalable.

      There are many interfaces and classes in the Servlet API such as Servlet, Generic Servlet, HttpServlet, Servlet Request, Servlet Response etc.

      Servlet is an interface that must be implemented for creating any Servlet.

      Servlet is a class that extends the capabilities of the servers and responds to the incoming requests. 

      It can respond to any requests.

      Servlet is a web component that is deployed on to the server to create a dynamic web page.

JSP

      It stands for Java Server Pages.

      It is a server side technology.

      It is used for creating web application.

      It is used to create dynamic web content.

      In this JSP tags are used to insert JAVA code into HTML pages.

      It is an advanced version of Servlet Technology.

      It is a Web based technology helps us to create dynamic and platform independent web pages.

      In this, Java code can be inserted in HTML/ XML pages or both.

      JSP is first converted into Servlet by JSP container before processing the client’s request.

      JSP  technology  is  used  to  create  web  application  just  like  Servlet technology.

      It  provides  more  functionality  than  Servlet  such  as  expression language, JSTL, etc.

EJB

      EJB  (Enterprise  Java  Bean)  is  used  to  develop scalable, robust and secured enterprise applications in java.

      Unlike  RMI,  middleware  services  such  as  security, transaction  management  etc.  are  provided  by  EJB Container to all EJB applications.

      EJB Used When Application need remote access.

      EJB Used When Application need to be scalable .

      EJB Used when Application need encapsulation business logic.

JMS

      JMS Stand for Java Message Service.

      It is an API that provide the facility to create, sand and read message.

      It is Technique to communicate application or software components.

      JMS Mainly used for send or received message from one application to another.

      JMS is a part of the Java Platform, Enterprise Edition (Java EE).

      To implement JMS Interface, it uses Message Oriented Middleware(MOM)

JavaMail

      The  JavaMail  is  an  API  that  is  used  to  compose,  write  and read electronic  messages means emails.

      The  JavaMail  API  provides  protocol  independent  and platform  independent  framework  for  sending  and  receiving emails.

      The  javax.mail  and  javax.mail.activation  packages  contains the core classes of JavaMail  API.

      The JavaMail  facility  can be applied to many events.

      It  can  be  used  at  the  time  of  registering  the  user  for  sending notification  such  as  thanks  for  your  interest  to  my  site  or forgot  password  that  sending  password  to  the  users  email  id or sending notifications  for important updates etc.

      So there can be various usage of JavaMail  api.

JSF

      It is a server side component based user interface  framework.

      It is used to develop  web applications.

   It  provides  a  well-defined  programming  model  and  consists  of rich API and tag libraries.

 The  JSF  API  provides  components  like  inputText, commandButton  etc and helps to manage their states.

      It  also  provides  server-side  validation,  data  conversion, defining  page  navigation,  provides  extensibility,  supports  for internationalization,  accessibility  etc.

     JavaServer  Faces  is  the  Java  standard  technology  for building  component-based,  event-oriented  web interfaces.

    Like  JavaServer  Pages  , JSF  allows  access  to  server-side data and logic.

JNDI

      The  Java  Naming  and  Directory  Interface  (JNDI)  is  an application  programming  interface  (API)  for  accessing different kinds of naming and directory services.

      JNDI  is  similar  to  JDBC  in  that  they  are  both  Object Oriented  Java  APIs  that  provide  a  common  abstraction for accessing services from different vendors.

      JNDI  is  not  specific  to  a  particular  naming  or  directory service,  it  can  be  used  to  access  many  different  kinds  of systems  including  file  systems;  distributed  objects systems like CORBA, Java RMI, and EJB.

      They  provide  one  programming  model  for  accessing many different  products. 

      A  container  is  a  component  which  can  contain  other  components inside  itself.  It  is  also  an  instance  of  a  subclass  of  java.awt.Container,  java.awt.Containerextends , java.awt.Component  so containers  are themselves  components.

      An applet is a container.

      Other containers include  windows,  frames, dialogs,  and panels.

      Containers  may contain other containers.

      Every  container  has  a  LayoutManager  that  determines  how different  components are positioned  within the container.

      Containers  provide  an  interface  between  a  component  and  the

      low-level  platform-specific  functionality  that  supports  the

      component.

      Container  Type  include  Applet  Container  ,  Application  Client Container,  Enterprise  JavaBeans  Container,  Web  Container etc…

      Apache  Tomcat  is  a  Servlet  container  and  it  is developed by Apache Software Foundation.

      Tomcat  is  used  to  implement  The  Java  Servlet and the Java Server Page.

      Servlet  and  JSP  are  specially  used  for  website development  as  well  as  web  service development.

      Web container allowed to contain data on web.

      Apache  Tomcat  provide  pure  java  HTTP  web server environment for java code to run.

      So  Tomcat  work  as  web  container  in  Java Enterprise.

Configuring Apache Tomcat Server involves several steps. Here's a basic overview of the configuration process:

 

1. Download and Install Apache Tomcat:

   - Visit the Apache Tomcat website (https://tomcat.apache.org) and download the latest stable version of Tomcat.

   - Follow the installation instructions specific to your operating system.

 

2. Set Environment Variables (Optional):

   - Set the `CATALINA_HOME` environment variable to the installation directory of Tomcat.

   - Add `%CATALINA_HOME%\bin` to the `PATH` environment variable.

3. Configure Server Ports (Optional):

   - Open the `server.xml` file located in the `conf` directory of Tomcat installation.

   - Modify the `<Connector>` elements to specify the ports on which Tomcat listens for requests (e.g., HTTP, HTTPS).

4. Configure Virtual Hosts (Optional):

   - In the `server.xml` file, you can define virtual hosts to host multiple websites on a single Tomcat instance.

   - Define `<Host>` elements within the `<Engine>` element for each virtual host.

 

5. Deploy Web Applications:

   - Copy your web application (WAR file) into the `webapps` directory of Tomcat.

   - Tomcat will automatically deploy the web application and create a corresponding directory.

 

6. Configure Web Application Specifics:

   - Customize the configuration of each web application by modifying the respective `context.xml` file located in the application's directory.

   - You can configure data source connections, session management, security settings, etc.

 

7. Start Tomcat:

   - Execute the startup script (`startup.bat` on Windows or `startup.sh` on Unix-based systems) located in the `bin` directory of Tomcat.

   - Tomcat will start and deploy the web applications.


8. Access the Web Application:

   - Open a web browser and access the web application using the URL: `http://localhost:<port>/<webapp>`

   - Replace `<port>` with the appropriate port number and `<webapp>` with the name of your web application.

 

These steps provide a general overview of configuring Apache Tomcat Server. Depending on your requirements, you may need to delve into more advanced configurations, such as security settings, logging, performance tuning, and load balancing, among others.

 

RMI

      RMI stands for Remote Method Invocation.

      It is a mechanism that allows object residing in one JVM system to access or invoke an object running on another JVM system.

      RMI is used to build distributed application.

      It provides remote communication between java programs.

      It provided in the package java.rmi.

      The RMI provides remote communication between the application using two object stub and skeleton.

      RMI use registry server to RPC.

      RPC means Remote Procedure Call.


RMI (Remote Method Invocation) is a Java-based remote procedure call (RPC) framework that allows communication between Java programs running on different machines in a network. RMI enables objects in one JVM (Java Virtual Machine) to invoke methods on objects located in another JVM.

 

The architecture of RMI involves the following components:

 

1. Stub and Skeleton:

   - Stub: The client-side proxy object that acts as a local representative of the remote object. The client interacts with the stub as if it were the actual remote object.

   - Skeleton: The server-side object that receives method invocations from the stub, invokes the corresponding methods on the remote object, and returns the results to the stub.

 

2. Remote Interface:

   - A Java interface that defines the methods that can be invoked remotely by clients. Both the client and server must have the remote interface definition.

 

3. Remote Object:

   - The actual implementation of the remote interface. It resides on the server and provides the methods that can be invoked remotely by clients.

 

4. RMI Registry:

   - A central registry that keeps track of remote objects available for clients to invoke.

   - Clients can look up remote objects in the registry using a unique name or identifier.

 

5. RMI Compiler (rmic):

   - A tool that generates stub and skeleton classes from the remote interface.

   - The stub is used on the client-side, and the skeleton is used on the server-side to handle remote method invocations.

 

The steps involved in setting up and using RMI are as follows:

 

1. Define the remote interface: Create a Java interface that extends the `java.rmi. Remote` interface and includes the remote methods that can be invoked by clients.

 

2. Implement the remote object: Create a class that implements the remote interface. This class will provide the implementation of the remote methods.

 

3. Compile the remote object: Use the `rmic` tool to generate the stub and skeleton classes for the remote object.

 

4. Start the RMI registry: Run the RMI registry on the server-side. The registry listens for client requests and allows them to look up remote objects.

 

5. Bind the remote object to the RMI registry: Register the remote object with the RMI registry using a unique name or identifier.

 

6. Write the client application: Create a client application that uses the stub to invoke methods on the remote object. The client interacts with the remote object as if it were a local object.

 

7. Run the server application: Start the server application that hosts the remote object. The server application listens for client requests and invokes the methods on the remote object.

 

8. Run the client application: Execute the client application, which connects to the server, looks up the remote object in the registry, and invokes methods on the remote object.

 

During the method invocation, the stub on the client-side serializes the method parameters and sends them to the skeleton on the server-side. The skeleton deserializes the parameters, invokes the corresponding method on the remote object, serializes the result, and sends it back to the stub, which then returns the result to the client application.

 

RMI provides a transparent mechanism for remote communication between Java objects, simplifying distributed application development.

 

      In an RMI application, we have to write two programs that is

      Server Program that is resides on the server.

      Client Program that is reside on the client.

      Inside the server program, a remote object is created and reference of that object is made available for the client using the registry.

      The client program requests the remote objects on the server and tries to invoke its methods.

      Hear is diagram for RMI.


      Stub

      A stub is a representation or proxy of the remote object at client.

      It resides in the client program.

      It acts as a gateway for the client program.

      Skeleton

      This is the object which resides on the server side.

      Stub communicate with this skeleton to pass request to the remote object.

      RRL (Remote Reference Layer)

      It is the layer which manages the references made by the client to the remote object.

      Transport Layer.

      This layer connects the client and the server.

      It manages the existing connection and also sets up new connection.

 

Thank You

:: Any Query ::

Contact: Ruparel Education Pvt. Ltd.

Mobile No: 7600044051


Please comment this post and Share this post to your friends.