colloquium report

18
Development of Weather Update App(in Android) for Cloud Computing & Application In PHP B. Tech Colloquium Report Submitted by Mr. Deepak Kumar (2011ECS41) in partial fulfillment of the requirements for the award of the degree of BACHLEOR OF TECHNOLOGY IN COMPUTER SCIENCE & ENGINEERING At SCHOOL OF COMPUTER SCIENCE & ENGINEERING SHRI MATA VAISHNO DEVI UNIVERSITY KATRA 1 DECEBER- 2014

Upload: deepak-kumar

Post on 11-Jul-2015

162 views

Category:

Engineering


1 download

TRANSCRIPT

Page 1: Colloquium Report

Development of Weather Update App(in Android) for

Cloud Computing &

Application In PHP

B. Tech Colloquium Report

Submitted by

Mr. Deepak Kumar (2011ECS41)

in partial fulfillment of the requirements for

the award of the degree

of

BACHLEOR OF TECHNOLOGY

IN

COMPUTER SCIENCE & ENGINEERING

At

SCHOOL OF COMPUTER SCIENCE & ENGINEERING

SHRI MATA VAISHNO DEVI UNIVERSITY

KATRA

1 DECEBER- 2014

Page 2: Colloquium Report

1

ABSTRACT Development of Weather Update App(in Android) for Cloud Computing

The project Weather App developed in Android by using JSON Parser & API key is taken from OpenWeatherMap.com .This App is made for computing on cloud to use PAAS service Models of Cloud Computing. OpenWeatherMap.com provides service to Access current weather data for any location on Earth including over 200,000 cities! Current weather is frequently updated based on global models and data from more than 40,000 weather stations, Data is available in JSON, XML, or HTML format. This App provide an opportunity to the end users on cloud to access Current Temperature, Humidity, Weather Type, Pressure, Wind Speed, Latitude, Longitude, Sunrise, Sunset.

Application In PHP The project in PHP is on kalpvirksha charity website. It is an online platform dedicated to bringing a positive change in society. It’s a nonprofit

platform to bring together those who want to give and those who are committed to working in the social sector. kalpvirksha enlists NGOs operating in India and provide them with a platform to showcase their work and reach out to donors. The aim of kalpvirksha is to bring transparency and professional standards in the nonprofit sector. We focus on few NGOs who have excellent track record in implementing social projects and enlist them after rigorous screening of their projects, financials and governance. We at kalpvirksha make every effort to give you the best possible options for your donations so that each rupee is well spent on improving the lives of disadvantaged sections of the society.

Page 3: Colloquium Report

2

TABLE OF CONTENTS

Part-A(Cloud Computing)

S.no Title Page No.

1 Introduction To Cloud Computing

2 Cloud Deployment Models

3 Cloud Service Models

4 Benefits Of Cloud Computing

5 Project-Weather Update App & Code

Part-B(PHP)

1 Introduction To HTML

2 Introduction To CSS

3 Introduction To JavaScript

4 Introduction To jQuery

5 Introduction To Bootstrap

6 Introduction To PHP

7 Introduction To Cake Framework

8 Introduction To Zend Framework

9 Introduction To Joomla CMS

10 Introduction To Wordpress CMS

11 Project-Charity Website

Page 4: Colloquium Report

3

PART-A (CLOUD COMPUTING)

Introduction To Cloud Computing The term Cloud refers to a Network or Internet. In other words, we can say that Cloud is something which is present at remote location. Cloud can provide services over network i.e. on public networks or on private networks i.e. WAN, LAN or VPN. Applications such as e-mail, web conferencing, customer relationship management (CRM), all run in cloud. Cloud Computing refers to manipulating, configuring, and accessing the applications online. It offers online data storage, infrastructure and application.

Cloud Deployment Models Deployment models define the type of access to the cloud i.e. how the cloud is located? Cloud can have any of the four types of access: Public, Private, Hybrid and Community.

Page 5: Colloquium Report

4

Public Cloud : The Public Cloud allows systems and services to be easily accessible to the general public. Public cloud may be less secure because of its openness e.g. email. Private Cloud : The Private Cloud allows systems and services to be accessible with in an organization. It offers increased security because of its private nature. Community Cloud : The Community Cloud allows system and services to be accessible by group of organizations. Hybrid Cloud : The Hybrid Cloud is mixture of public and private cloud. However, the critical activities are performed using private cloud while the non critical activities are performed using public cloud. Cloud Service Models Service Models are the reference models on which the Cloud Computing is based. These can be categorized into three basic service models as listed below:

Infrastructure as a Service (IAAS) Platform as a Service (PAAS) Software as a Service (SAAS)

There are many other service models, all of which can take the form like XAAS i.e. Anything as a Service. This can be Network as a Service, Business as a Service, Identity as a Service, Database as a Service or Strategy as a Service. The Infrastructure as a Service (IAAS) is the most basic level of service. Each of the service models make use of the underlying service model i.e. each inherits the security and management mechanism from the underlying model, as shown in the following diagram:

Infrastructure as a Service (IAAS) : IAAS provides access to fundamental resources such as physical machines, virtual machines, virtual storage etc. Platform as a Service (PAAS): PAAS provides the run time environment for applications, development & deployment tools etc. Software as a Service (SAAS): SAAS model allows to use software applications as a service to end users.

Page 6: Colloquium Report

5

Benefits Of Cloud Computing

Cloud Computing has numerous advantages. Some of them are listed below:

One can access applications as utilities, over the internet. Manipulate, and configure the application online at any time. It does not require to install a specific piece of software to access

or manipulate cloud application. Cloud Computing offers online development and deployment

tools, programming run time environment through Platform as a Service model.

Cloud resources are available over the network in a manner that provides platform independent access to any type of clients.

Cloud Computing offers on-demand self-service. The resources can be used without interaction with cloud service provider.

Cloud Computing is highly cost effective because it operates at higher efficiencies with greater utilization. It just requires an Internet connection.

Cloud Computing offers load balancing that makes it more reliable.

Page 7: Colloquium Report

6

Project-Weather Update App

Page 8: Colloquium Report

7

Partial code of Weather Update public class getupdates extends AsyncTask<String,String,String>{ Context context; JSONObject jobj; json_parser jparser=new json_parser(); static String country,sunrise,sunset,lat,lon,temp,humidity,pressure,speed,type; String url="http://api.openweathermap.org/data/2.5/weather?q=",city; public getupdates(Activity c) { context=c; } @Override protected String doInBackground(String... arg0) { // TODO Auto-generated method stub city=WeatherActivity.et1.getText().toString(); String newcity=city.replace(" ", "_"); String finalurl=url+newcity; jobj = jparser.makeHttpRequest(finalurl); try{ JSONObject jobj1 = jobj.getJSONObject("sys"); country=jobj1.getString("country"); sunrise=jobj1.getString("sunrise"); sunset=jobj1.getString("sunset"); JSONObject jobj2=jobj.getJSONObject("coord"); lat=jobj2.getString("lat"); lon=jobj2.getString("lon"); JSONObject jobj3=jobj.getJSONObject("main"); temp=jobj3.getString("temp"); pressure=jobj3.getString("pressure"); humidity=jobj3.getString("humidity"); JSONObject jobj4=jobj.getJSONObject("wind"); speed=jobj4.getString("speed"); JSONArray jarray = jobj.optJSONArray("weather"); JSONObject jsonChildNode = jarray.getJSONObject(0); type=jsonChildNode.optString("main").toString();} catch(Exception e) {Toast.makeText(context, "Please enter valid city name!", Toast.LENGTH_LONG).show(); } return country+sunrise+sunset+lat+lon+temp+pressure+humidity+speed+type;} protected void onPostExecute(String ab){ WeatherActivity.et2.setText(country); WeatherActivity.et10.setText(sunrise); WeatherActivity.et11.setText(sunset); WeatherActivity.et8.setText(lat); WeatherActivity.et9.setText(lon); WeatherActivity.et3.setText(temp); WeatherActivity.et4.setText(humidity); WeatherActivity.et6.setText(pressure); WeatherActivity.et7.setText(speed); WeatherActivity.et5.setText(type); } }

Page 9: Colloquium Report

8

PART-B(PHP ) Introduction To HTML

HTML stands for Hypertext Markup Language, and it is the most widely used language to write Web Pages. As its name suggests, HTML is a markup language.

Hypertext refers to the way in which Web pages (HTML documents) are linked together. When you click a link in a Web page, you are using hypertext.

Markup Language describes how HTML works. With a markup language, you simply "mark up" a text document with tags that tell a Web browser how to structure it to display.

Originally, HTML was developed with the intent of defining the structure of documents like headings, paragraphs, lists, and so forth to facilitate the sharing of scientific information between researchers.

Creating your document :

Creating an HTML document is easy. To begin coding HTML you need only two things: a simple-text editor and a web browser. Notepad is the most basic of simple-text editors and you will probably code a fair amount of HTML with it.

Here are the simple steps to create a baisc HTML document:

Open Notepad or another text editor. At the top of the page type <html>. On the next line, indent five spaces and now add the opening

header tag: <head>. On the next line, indent ten spaces and type <title> </title>. Go to the next line, indent five spaces from the margin and insert

the closing header tag: </head>. Five spaces in from the margin on the next line, type<body>. Now drop down another line and type the closing tag right below

its mate: </body>. Finally, go to the next line and type </html>. In the File menu, choose Save As. In the Save as Type option box, choose All Files. Name the file template.htm. Click Save.

Page 10: Colloquium Report

9

Introduction To CSS

Cascading Style Sheets, fondly referred to as CSS, is a simple design language intended to simplify the process of making web pages presentable.

CSS handles the look and feel part of a web page. Using CSS, you can control the color of the text, the style of fonts, the spacing between paragraphs, how columns are sized and laid out, what background images or colors are used, as well as a variety of other effects.

CSS is easy to learn and understand but it provides powerful control over the presentation of an HTML document. Most commonly, CSS is combined with the markup languages HTML or XHTML.

Advantage Of CSS :

CSS saves time - You can write CSS once and then reuse same sheet in multiple HTML pages. You can define a style for each HTML element and apply it to as many Web pages as you want.

Pages load faster - If you are using CSS, you do not need to write HTML tag attributes every time. Just write one CSS rule of a tag and apply to all the occurrences of that tag. So less code means faster download times.

Easy maintenance - To make a global change, simply change the style, and all elements in all the web pages will be updated automatically.

Superior styles to HTML - CSS has a much wider array of attributes than HTML so you can give far better look to your HTML page in comparison of HTML attributes.

Multiple Device Compatibility - Style sheets allow content to be optimized for more than one type of device. By using the same HTML document, different versions of a website can be presented for handheld devices such as PDAs and cell phones or for printing.

Global web standards - Now HTML attributes are being deprecated and it is being recommended to use CSS. So its a good idea to start using CSS in all the HTML pages to make them compatible to future browsers.

Introduction To JavaScript

JavaScript is:

JavaScript is a lightweight, interpreted programming language Designed for creating network-centric applications Complementary to and integrated with Java

Page 11: Colloquium Report

10

Complementary to and integrated with HTML Open and cross-platform

Client-side JavaScript is the most common form of the language. The script should be included in or referenced by an HTML document for the code to be interpreted by the browser.

The merits of using JavaScript are:

Less server interaction: You can validate user input before sending the page off to the server. This saves server traffic, which means less load on your server.

Immediate feedback to the visitors: They don't have to wait for a page reload to see if they have forgotten to enter something.

Increased interactivity: You can create interfaces that react when the user hovers over them with a mouse or activates them via the keyboard.

Richer interfaces: You can use JavaScript to include such items as drag-and-drop components and sliders to give a Rich Interface to your site visitors.

Intrduction To jQuery

jQuery is a fast and concise JavaScript Library created by John Resig in 2006 with a nice motto: Write less, do more.

jQuery simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development.

jQuery is a JavaScript toolkit designed to simplify various tasks by writing less code. Here is the list of important core features supported by jQuery:

DOM manipulation: The jQuery made it easy to select DOM elements, traverse them and modifying their content by using cross-browser open source selector engine called Sizzle.

Event handling: The jQuery offers an elegant way to capture a wide variety of events, such as a user clicking on a link, without the need to clutter the HTML code itself with event handlers.

AJAX Support: The jQuery helps you a lot to develop a responsive and feature-rich site using AJAX technology.

Animations: The jQuery comes with plenty of built-in animation effects which you can use in your websites.

Lightweight: The jQuery is very lightweight library - about 19KB in size ( Minified and gzipped ).

Page 12: Colloquium Report

11

you can include jquery library in your HTML file as follows:

<html>

<head>

<title>Deepak Dylan</title>

<script type="text/javascript"

src="/jquery/jquery-1.3.2.min.js"></script>

<script type="text/javascript">

// you can add Your javascript code here

</script>

</head>

<body>

<i>Hello EveryOne………</i>

</body>

</html>

Introduction To Bootstrap

Bootstrap is an open source product from Mark Otto and Jacob Thornton who, when it was initially released, were both employees at Twitter. There was a need to standardize the front end tool sets of engineers across the company. Since Bootstrap launched in August 2011, it has taken off in popularity. It has evolved from being an entirely CSS-driven project to include a host of JavaScript plugins and icons that go hand in hand with forms and buttons. At its base, it allows for responsive web design and features a robust 12-column, 940px-wide grid. One of the highlights is the build tool on Bootstrap’s website, where you can customize the build to suit your needs, choosing which CSS and JavaScript features you want to include on your site. All of this allows frontend web development to be catapulted forward, building on a stable foundation of forward-looking design and development. Getting started with Bootstrap is as simple as dropping some CSS and JavaScript into the root of your site. With Bootstrap, we include the link to the CSS style sheet and the JavaScript: <html> <head> <title>Deepak Dylan</title> <link href="css/bootstrap.min.css" rel="stylesheet"> </head> <body> <h1>Hello, world!</h1> <script src="js/bootstrap.min.js"></script> </body> </html>

Page 13: Colloquium Report

12

Introduction To PHP

Rasmus Lerdorf unleashed the first version of PHP in 1994.

PHP is a recursive acronym for "PHP: Hypertext Preprocessor". PHP is a server side scripting language that is embedded in HTML.

It is used to manage dynamic content, databases, session tracking, even build entire e-commerce sites.

It is integrated with a number of popular databases, including MySQL, PostgreSQL, Oracle, Sybase, Informix, and Microsoft SQL Server.

PHP is pleasingly zippy in its execution, especially when compiled as an Apache module on the Unix side. The MySQL server, once started, executes even very complex queries with huge result sets in record-setting time.

PHP supports a large number of major protocols such as POP3, IMAP, and LDAP. PHP4 added support for Java and distributed object architectures (COM and CORBA), making n-tier development a possibility for the first time.

PHP is forgiving: PHP language tries to be as forgiving as possible.

PHP Syntax is C-Like.

Common use of PHP

PHP performs system functions, i.e. from files on a system it can create, open, read, write, and close them.

PHP can handle forms, i.e. gather data from files, save data to a file, thru email you can send data, return data to the user.

You add, delete, modify elements within your database thru PHP. Access cookies variables and set cookies. Using PHP, you can restrict users to access some pages of your

website. It can encrypt data.

Characteristics Of PHP

Five important characteristics make PHP's practical nature possible:

Simplicity Efficiency Security Flexibility Familiarity

Hello World In PHP

Page 14: Colloquium Report

13

<html>

<head>

<title>Hello World</title>

<body>

<?php echo "Hello, World!";?>

</body>

</html>

Introduction To Cake Framework

Cake PHP is a free, open-source , rapid development framework5 for PHP. It’s a foundational structure for programmers to create web applications. Its primary goal is to enable you to work in a structured and rapid manner–without loss of flexibility. Cake PHP takes the monotony out of web development. It provides you with all the tools you need to get started coding and what you need to get done: the logic specific to your application. Instead of reinventing the wheel every time you begin a new project, check out a copy of Cake PHP and get started with the logic of your application. Cake PHP has an active developer team7 and community, bringing great value to the project. In addition to keeping you from wheel-reinventing, using Cake PHP means your application’s core is well tested and is being constantly improved. Advantage Of Cake PHP • Compatible with versions PHP 5.2.8 and greater. • Integrated CRUD for database interaction. • Application scaffolding. • Code generation. • MVC architecture. • Request dispatcher with clean, custom URLs and routes. • Built-in validation. • Fast and flexible templating (PHP syntax, with helpers). • View Helpers for AJAX, JavaScript, HTML Forms and more. • Email, Cookie, Security, Session, and Request Handling Components. • Flexible ACL. • Data Sanitization. • Flexible Caching.

Introduction To Zend Framework

Zend Framework (ZF) is an open source, object-oriented web application framework implemented in PHP5 and licensed under the New BSD License.

Zend Framework features include

Page 15: Colloquium Report

14

All components are fully object-oriented PHP 5 and are E_STRICT

compliant.

Use-at-will architecture with loosely coupled components and minimal

interdependencies

Extensible MVC implementation supporting layouts and PHP-based

templates by default

Support for multiple database systems and vendors, including MariaDB

, MySQL, Oracle, IBM DB2, Microsoft SQ Server, PostgreSQL, SQLite,

and Informix Dynamic Server

Email composition and delivery, retrieval via mbox , Maildir

, POP3 and IMAP4

Flexible caching sub-system with support for many types of backends,

such as memory or a file system.

Introduction To Joomla CMS

Joomla is a free and open-source content management system(CMS) for

publishing web content. It is built on a model–view–controller web application

framework that can be used independently of the CMS.

Joomla is written in PHP, uses object-oriented programming (OOP)

techniques (since version 1.5 and software design patterns, stores data in

a MySQL, MS SQL (since version 2.5), or PostgreSQL (since version 3.0)

database, and includes features such as page caching, RSS feeds, printable

versions of pages, news flashes, blogs, polls, search, and support

for language internationalization.

Introduction To Wordpress CMS

WordPress started in 2003 with a single bit of code to enhance the typography of everyday writing and with fewer users than you can count on your fingers and toes. Since then it has grown to be the largest self-hosted blogging tool in the world, used on millions of sites and seen by tens of millions of people every day. Everything you see here, from the documentation to the code itself, was created by and for the community. WordPress is an Open Source project, which means there are hundreds of people all over the world working on it. (More than most commercial platforms.) It also means you are free to use it for anything from your cat’s home page to a Fortune 500 web site without paying anyone a license fee and a number of other important freedoms.

Page 16: Colloquium Report

15

Project- Charity Website(Kalpvriksha)

User of Website: Guset

-No Need to Login -Can access Home Page ,About Us page ,Contact us page only. -To donate or Receive a guest must to sign In.

Page 17: Colloquium Report

16

User

-A User must Sign in And Login to open their Zone. -A user can Update & delete their Profile. -A user can Add post about their donation or need, -A user can view the report of donation and receive. -A user can make ,edit or delete their comment as shown below.

Page 18: Colloquium Report

17

Admin - Admin have all right about this website like they can Add category, View category, Add post, Manage post, Manage User As Shown below.

Software process model:- Waterfall model languages: -PHP , HTML ,CSS ,JAVASCRIPT ,jQuery ,Bootstrap Databse Tool:- phpMyAdmin CONCLUSION

The Above project is designed for learning process. The Weather Update App is built in Android. The charity Website is built in PHP by using HTML,CSS JavaScript,

jQuery , Bootstrap. I use Waterfall software model to build Above App and Website. I take the API key from openWeatherMap.com for weather Update

App.