Skip to content

Commit

Permalink
success to connect my tomcat Server
Browse files Browse the repository at this point in the history
  • Loading branch information
yuichi10 committed Aug 25, 2015
1 parent 0ec0239 commit 7fc93d7
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public HttpCommunication(String serverName, String path){
mBuilder = new Uri.Builder();
setServerName(serverName);
if(path != "") {
mBuilder.path("/" + path + "/");
mBuilder.path("/" + path);
}
//Uri for post
mUri = "http:" + serverName + "/" + path + "/";
Expand All @@ -46,7 +46,7 @@ public HttpCommunication(String serverName){
mBuilder = new Uri.Builder();
setServerName(serverName);
//Uri for post
mUri = "http:" + serverName;
mUri = "http://" + serverName;
}

private void setServerName(String str){
Expand Down Expand Up @@ -76,7 +76,8 @@ public void Get(){
@Override
public void run() {
DefaultHttpClient httpClient = new DefaultHttpClient();
HttpGet request = new HttpGet(mBuilder.build().toString());
String url = mBuilder.build().toString();
HttpGet request = new HttpGet(url);
try{
String result = httpClient.execute(request, new ResponseHandler<String>() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,11 @@ public void onClick(View v) {
startActivityForResult(intent, this.mRequestCode);
break;
case R.id.doSignUp:
String server = "www.drk7.jp";
String path = "weather/xml/27.xml";
HttpCommunication hc = new HttpCommunication(server, path);
String server = "115.65.57.253:8080";
String path = "firstTom/servlet/hello";
//server = "google.co.jp";
HttpCommunication hc = new HttpCommunication(server,path);
hc.setGetParameter("message", "success");
hc.Get();
break;
}
Expand Down
18 changes: 18 additions & 0 deletions app/src/main/res/layout/activity_sign_in.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,22 @@
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Email"
android:id="@+id/signInEmail"
android:layout_alignBottom="@+id/idSignIn"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Password"
android:id="@+id/signInPassword"
android:layout_alignBottom="@+id/passwordSignIn"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />

</RelativeLayout>

0 comments on commit 7fc93d7

Please sign in to comment.