Android Open Source - Android-Project-Manager New Account






From Project

Back to project page Android-Project-Manager.

License

The source code is released under:

GNU General Public License

If you think the Android project Android-Project-Manager listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.vaquerosisd.projectmanager;
//  ww  w. j a  va 2  s.  co  m
import com.vaquerosisd.object.JsonWrapper;
import com.vaquerosisd.object.User;

import android.app.Activity;
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;
import android.widget.Toast;

public class NewAccount extends Activity implements WebserviceCallback {
  
  public void callback(JsonWrapper response){
    System.out.println("Webserive code response: " + response.getInt("code"));
    
    // checar codigo de overtwrite?
    if (response.getCode() == 7)
    {
      setResult(RESULT_OK);
      finish();
      
      Toast.makeText(NewAccount.this, "Cuenta creada", Toast.LENGTH_SHORT).show();
    
    }
    else{
      Toast.makeText(NewAccount.this, "Usuario invalido", Toast.LENGTH_SHORT).show();
    }
  }
  
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_new_account);
    
    Button registerAccount = (Button)findViewById(R.id.newAccount_RegisterAccount);
    Button login = (Button)findViewById(R.id.newAccount_GoToLogin);
    final EditText accname = (EditText)findViewById(R.id.newAccount_AccountName);
    final EditText accpass = (EditText)findViewById(R.id.newAccount_Password);
    final EditText accmail = (EditText)findViewById(R.id.newAccount_Email);
    
    registerAccount.setOnClickListener(new OnClickListener() {
      @Override
      public void onClick(View v) {
        //intent
        //if result = invalid
        User user = new User(NewAccount.this, accname.getText().toString());
        
        user.createAccount(accpass.getText().toString(), accmail.getText().toString());
        
        
      }
    });
    
    login.setOnClickListener(new OnClickListener() {
      @Override
      public void onClick(View v) {
        Intent returnIntent = new Intent();
        returnIntent.putExtra("LogIn", true);
        setResult(RESULT_CANCELED, returnIntent);
        finish();
      }
    });
  }
  
  @Override
  public void onBackPressed() {
    moveTaskToBack(true);
  }
  
}




Java Source Code List

com.vaquerosisd.adapters.ProjectListViewAdapter.java
com.vaquerosisd.adapters.TaskListViewAdapter.java
com.vaquerosisd.adapters.VideoNoteGridViewAdapter.java
com.vaquerosisd.adapters.VoiceNoteGridViewAdapter.java
com.vaquerosisd.database.DatabaseHelper.java
com.vaquerosisd.database.ProjectOperations.java
com.vaquerosisd.dialog.CustomStatus.java
com.vaquerosisd.dialog.DatePickerFragment.java
com.vaquerosisd.dialog.DeleteDialog.java
com.vaquerosisd.dialog.DeletePhotoDialog.java
com.vaquerosisd.dialog.DeleteTaskDialog.java
com.vaquerosisd.dialog.EditProject.java
com.vaquerosisd.fragments.TaskDescriptionFragment.java
com.vaquerosisd.fragments.VideoNotesFragment.java
com.vaquerosisd.fragments.VoiceNotesFragment.java
com.vaquerosisd.object.JsonWrapper.java
com.vaquerosisd.object.PhotoRef.java
com.vaquerosisd.object.Project.java
com.vaquerosisd.object.Task.java
com.vaquerosisd.object.User.java
com.vaquerosisd.object.WebServiceManager.java
com.vaquerosisd.projectmanager.About.java
com.vaquerosisd.projectmanager.ContentTask.java
com.vaquerosisd.projectmanager.Login.java
com.vaquerosisd.projectmanager.MainActivity.java
com.vaquerosisd.projectmanager.NewAccount.java
com.vaquerosisd.projectmanager.NewProject.java
com.vaquerosisd.projectmanager.NewTask.java
com.vaquerosisd.projectmanager.OnSwipeListener.java
com.vaquerosisd.projectmanager.PhotoManager.java
com.vaquerosisd.projectmanager.ProjectList.java
com.vaquerosisd.projectmanager.TaskList.java
com.vaquerosisd.projectmanager.WebserviceCallback.java
com.vaquerosisd.utils.FileOperations.java
com.vaquerosisd.utils.OnSwipeListener.java
com.vaquerosisd.utils.SpinnerUtil.java
com.vaquerosisd.utils.TabListener.java