do not use static ip and pw (android app)
This commit is contained in:
1 parent
00199ec762
commit
70a75d2f54
1 file changed
+11
-5
@@ -24,10 +24,13 @@ namespace AndroidRemote
|
|||||||
Button bLogin;
|
Button bLogin;
|
||||||
Button bSendAvatar;
|
Button bSendAvatar;
|
||||||
Button bSendProfile;
|
Button bSendProfile;
|
||||||
|
|
||||||
|
TextView tIP;
|
||||||
|
TextView tPassword;
|
||||||
|
|
||||||
bool loggedIn;
|
bool loggedIn;
|
||||||
byte[] fileBytes;
|
byte[] fileBytes;
|
||||||
|
|
||||||
ImageView imageView;
|
|
||||||
Java.IO.File file;
|
Java.IO.File file;
|
||||||
Java.IO.File dir;
|
Java.IO.File dir;
|
||||||
System.IO.FileStream fs;
|
System.IO.FileStream fs;
|
||||||
@@ -55,6 +58,9 @@ namespace AndroidRemote
|
|||||||
bSendProfile = FindViewById<Button> (Resource.Id.btSendProfile);
|
bSendProfile = FindViewById<Button> (Resource.Id.btSendProfile);
|
||||||
bSendProfile.Click += SendProfile;
|
bSendProfile.Click += SendProfile;
|
||||||
|
|
||||||
|
tIP = FindViewById<TextView> (Resource.Id.tbIP);
|
||||||
|
tPassword = FindViewById<TextView> (Resource.Id.tbPassword);
|
||||||
|
|
||||||
sendProfile = false;
|
sendProfile = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -134,7 +140,7 @@ namespace AndroidRemote
|
|||||||
private void Connect()
|
private void Connect()
|
||||||
{
|
{
|
||||||
if (!client.Connected)
|
if (!client.Connected)
|
||||||
client.Connect("192.168.178.57", 3000, OnConnectionChanged);
|
client.Connect(tIP.Text, 3000, OnConnectionChanged);
|
||||||
else
|
else
|
||||||
client.Disconnect();
|
client.Disconnect();
|
||||||
}
|
}
|
||||||
@@ -142,7 +148,7 @@ namespace AndroidRemote
|
|||||||
private void Login()
|
private void Login()
|
||||||
{
|
{
|
||||||
if (!loggedIn)
|
if (!loggedIn)
|
||||||
client.SendMessage (CCommands.CreateCommandLogin("vocaluxe"), OnResponse);
|
client.SendMessage (CCommands.CreateCommandLogin(tPassword.Text), OnResponse);
|
||||||
else
|
else
|
||||||
client.Disconnect();
|
client.Disconnect();
|
||||||
}
|
}
|
||||||
@@ -215,13 +221,13 @@ namespace AndroidRemote
|
|||||||
if (LoggedIn)
|
if (LoggedIn)
|
||||||
{
|
{
|
||||||
bLogin.Text = Resources.GetString(Resource.String.button_logout);
|
bLogin.Text = Resources.GetString(Resource.String.button_logout);
|
||||||
Toast.MakeText(this, "Logged In", ToastLength.Short).Show();
|
Toast.MakeText(this, Resources.GetString(Resource.String.message_logged_in), ToastLength.Short).Show();
|
||||||
bSendAvatar.Enabled = true;
|
bSendAvatar.Enabled = true;
|
||||||
bSendProfile.Enabled = true;
|
bSendProfile.Enabled = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Toast.MakeText(this, "Not Logged In", ToastLength.Short).Show();
|
Toast.MakeText(this, Resources.GetString(Resource.String.message_logged_out), ToastLength.Short).Show();
|
||||||
bSendAvatar.Enabled = false;
|
bSendAvatar.Enabled = false;
|
||||||
bSendProfile.Enabled = false;
|
bSendProfile.Enabled = false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user