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