Results 1 to 4 of 4
  1. #1
    thornt is offline Member
    Join Date
    Apr 2012
    Posts
    2
    Rep Power
    0

    Default Help Needed! Android chat - pc chat server

    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 looked online at different sql login pages but i have no idea how to implement it to my code. Could anyone help please?.

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

    The coding for the login page is:

    Java Code:
    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);
    }
    }
    Last edited by DarrylBurke; 04-13-2012 at 12:29 PM. Reason: Changed QUOTE tags to CODE tags

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,188
    Rep Power
    19

    Default Re: Help Needed! Android chat - pc chat server

    Use code tags, not quote tags for posting code. I've corrected them for you this time.

    And please take the trouble to post properly indented and formatted code. Code that's all aligned to the left margin is difficult to read.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,188
    Rep Power
    19

    Default Re: Help Needed! Android chat - pc chat server

    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  4. #4
    thornt is offline Member
    Join Date
    Apr 2012
    Posts
    2
    Rep Power
    0

    Default Re: Help Needed! Android chat - pc chat server

    Sorry about the tags and format of the coding. Yeah no one has been able to help me there

Similar Threads

  1. Replies: 15
    Last Post: 04-05-2012, 06:46 PM
  2. 123 Flash Chat Server 9.3
    By java software in forum Java Software
    Replies: 0
    Last Post: 12-18-2011, 05:26 PM
  3. Chat Server
    By mrbrendano in forum New To Java
    Replies: 1
    Last Post: 09-19-2011, 11:08 PM
  4. Replies: 4
    Last Post: 03-31-2011, 10:37 PM
  5. midlet chat server
    By nfitte in forum Networking
    Replies: 0
    Last Post: 07-09-2009, 09:08 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •