-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from harjot-oberai/p2p
Fixes : Database and related issues
- Loading branch information
Showing
7 changed files
with
174 additions
and
30 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
app/src/main/java/com/example/haresh/tic_tac_toe_app/TwoDevice2P_names.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.example.haresh.tic_tac_toe_app; | ||
|
||
import android.content.Intent; | ||
import android.support.v7.app.AppCompatActivity; | ||
import android.os.Bundle; | ||
import android.view.View; | ||
import android.widget.Button; | ||
import android.widget.EditText; | ||
|
||
public class TwoDevice2P_names extends AppCompatActivity { | ||
|
||
public static String MyName; | ||
public static String OpponentName; | ||
Button btn; | ||
EditText name; | ||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_two_device2_p_names); | ||
btn = (Button) findViewById(R.id.btn_find); | ||
name = (EditText) findViewById(R.id.myName); | ||
name.setText(""); | ||
btn.setOnClickListener( | ||
new View.OnClickListener() { | ||
@Override | ||
public void onClick(View v) { | ||
MyName = name.getText().toString(); | ||
if(MyName.trim().equals("")){ | ||
name.setError("Enter Name"); | ||
} | ||
else{ | ||
Intent intent = new Intent(TwoDevice2P_names.this,BluetoothActivity.class); | ||
startActivity(intent); | ||
} | ||
} | ||
} | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?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" | ||
android:paddingBottom="@dimen/activity_vertical_margin" | ||
android:paddingLeft="@dimen/activity_horizontal_margin" | ||
android:paddingRight="@dimen/activity_horizontal_margin" | ||
android:paddingTop="@dimen/activity_vertical_margin" | ||
tools:context="com.example.haresh.tic_tac_toe_app.TwoDevice2P_names"> | ||
|
||
<EditText | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:id="@+id/myName" | ||
android:layout_marginTop="40dp" | ||
android:hint="Your Name"/> | ||
<Button | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:background="@color/colorPrimary" | ||
android:text="Find Opponent" | ||
android:textColor="#FFFFFF" | ||
android:textSize="20dp" | ||
android:id="@+id/btn_find" | ||
android:layout_alignParentBottom="true"/> | ||
</RelativeLayout> |