Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

[Q] Android Chat Program Development

OP thornt

10th April 2012, 07:36 PM   |  #1  
OP Junior Member
Thanks Meter: 0
 
4 posts
Join Date:Joined: Apr 2012
Hi guys,

I'm new here and this is my first post. I'm new to android program as i've just started learning at university. I'm developing a chat application that interacts with a chat server on a pc. I've created a login page that has a predefined username as password within it, however i wish to implement a system that checks the login name and password to a database, how ever i have no idea how to do this. Could anyone help please?.

p.s. sorry if this is in the wrong thread.

The coding for the login page is:

Quote:

package com.svennevik.andriod;


import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;

public class AndriodPasswordActivity extends Activity
{


@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.login);



final AlertDialog.Builder adb = new AlertDialog.Builder(this);
adb.setTitle("Login Incorrect");
adb.setMessage("Try again");
adb.setPositiveButton("Ok", new DialogInterface.OnClickListener()
{
public void onClick(DialogInterface dialog, int id)
{


}
});

Button send1 = (Button)findViewById(R.id.connectButton);
send1.setOnClickListener(new OnClickListener()

{
public void onClick(View v)
{

final EditText e1 = (EditText)findViewById(R.id.usernameEditText);
String username = e1.getText().toString();

final EditText e2 = (EditText)findViewById(R.id.passwordEditText);
String password = e2.getText().toString();

if (username.equals ("donald") && password.equals ("duck"))
f ();
else
adb.show ();
}
});
}

void f()
{
Intent i1 = new Intent(this, AndriodConnectionActivity.class);
startActivity (i1);
}
}

10th April 2012, 07:45 PM   |  #2  
Junior Member
Thanks Meter: 1
 
17 posts
Join Date:Joined: Mar 2012
You might want to move this to a more focused forum, perhaps a subforum in Android Development & Hacking
10th April 2012, 08:01 PM   |  #3  
OP Junior Member
Thanks Meter: 0
 
4 posts
Join Date:Joined: Apr 2012
i tried there first but it wont let me post it there, maybe a mod can move it?
10th April 2012, 09:07 PM   |  #4  
lufc's Avatar
Retired Senior Moderator / Resident Priest
Flag Blackpool UK
Thanks Meter: 1,545
 
9,528 posts
Join Date:Joined: Oct 2007
Donate to Me
More
Please use the Q&A Forum for questions &
Read the Forum Rules Ref Posting

Moving to Q&A
11th April 2012, 10:21 AM   |  #5  
OP Junior Member
Thanks Meter: 0
 
4 posts
Join Date:Joined: Apr 2012
any know or can help at all? Please i'm kinda time limited
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes