Modern Software Engineering _ the first week of practice _ question 14th

Source: Internet
Author: User

One: Android-based HelloWorld program development

The development environment and tools of the program are: androidstudio1.5+android5.1.1 version of the phone;

Development process:

1. File→new→new Project

2, enter your own project name: Hello_world, and select the location of your project, then select "Next"

3, choose their own application to develop the platform, and according to their own needs to choose the version of the SDK, and then "Next"

4. Select a default activity mode and select "Next"

5. Give the generated activity a name and select "Finish"

6, Hello_world Android program is complete!

Running on the real machine

The main code for activity is:

public class Mainactivity extends Appcompatactivity {

@Override
protected void OnCreate (Bundle savedinstancestate) {
Super.oncreate (savedinstancestate);
Setcontentview (R.layout.activity_main);
}
}

The main code for Activity_main.xml is:
<?xml version= "1.0" encoding= "Utf-8"?>
<relativelayout xmlns:android= "Http://schemas.android.com/apk/res/android"
Xmlns:tools= "Http://schemas.android.com/tools"
Android:layout_width= "Match_parent"
android:layout_height= "Match_parent"
tools:context= "Com.myapplication.MainActivity" >

<textview
Android:layout_width= "Wrap_content"
android:layout_height= "Wrap_content"
android:text= "Hello world!"/>
</RelativeLayout>

Second, the Java EE Development--helloworld Web Program

Development environment: Myeclipse2015+tomcat8.0+360 Browser.

1. File→new→web Project

2. Enter the project name: HelloWorld; and select the Java version and the run environment, as shown in my settings. This step can also change the path where the project is located. You can then directly click Finish to complete the project creation.

3, select the corresponding Tomcat server environment, and then click on the "Add deployments" icon to add the project to the server,

4. Start the Tomcat server. Then open the browser and enter it in the address: http://localhost:8080/HelloWorld/will be able to browse to the project you have created. Project interface such as:

The code for INDEX.JSP is:

<%@ page language= "java" import= "java.util.*" pageencoding= "Iso-8859-1"%>
<%
String path = Request.getcontextpath ();
String basepath = request.getscheme () + "://" +request.getservername () + ":" +request.getserverport () +path+ "/";
%>

<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" >
<base href= "<%=basePath%>" >

<title>my JSP ' index.jsp ' starting page</title>
<meta http-equiv= "Pragma" content= "No-cache" >
<meta http-equiv= "Cache-control" content= "No-cache" >
<meta http-equiv= "Expires" content= "0" >
<meta http-equiv= "keywords" content= "keyword1,keyword2,keyword3" >
<meta http-equiv= "description" content= "This is my page" >
<!--
<link rel= "stylesheet" type= "Text/css" href= "Styles.css" >
-

<body>
This is my JSP page. <br>
</body>

  

Modern Software Engineering _ the first week of practice _ question 14th

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.