Android Open Source - amanaje New Sms Activity






From Project

Back to project page amanaje.

License

The source code is released under:

Apache License

If you think the Android project amanaje 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.amanaje.activities;
/*from w w w  . j  ava  2  s  . c  om*/
import android.app.Activity;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

import com.amanaje.R;
import com.amanaje.asynctasks.AsyncTaskManager;
import com.amanaje.commons.Constants;
import com.amanaje.entities.SmsEntity;

public class NewSmsActivity extends Activity {
  
  private Activity thisActivity = null;
  private TextView to = null;
  private EditText sms = null;
  private Button send = null;
  private String extraNick = null;
  private String extraNumber = null;
  private String extraPubKey = null;
  private String extraSeed = null;
  private SmsEntity smsEntity = null;
  private AsyncTaskManager aTaskMan = null;

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_new_sms);
    
    thisActivity = this;
    
    to = (TextView) findViewById(R.id.targetTv);
    sms = (EditText) findViewById(R.id.smsEt);
    send = (Button) findViewById(R.id.sendMsgBt);
    
    Bundle extras = getIntent().getExtras();
    if (extras != null) {
      extraNick = extras.getString("nick");
      extraNumber = extras.getString("number");
      extraPubKey  = extras.getString("pubKey");
      extraSeed  = extras.getString("seed");
      
      smsEntity = new SmsEntity();
      smsEntity.setAddress(extraNumber);
      
      smsEntity.setPubKey(extraPubKey);
      smsEntity.setSeed(extraSeed);
      
    }
    
    to.setText(extraNick+": "+extraNumber);
    
    send.setOnClickListener(new OnClickListener() {
      
      @Override
      public void onClick(View v) {
        
        smsEntity.setBody(sms.getText().toString());
        
        aTaskMan = new AsyncTaskManager(thisActivity, Constants.SEND_SMS_TYPE, smsEntity);
        aTaskMan.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, null);
      }
    });
    
  }
  
  @Override
  public void onBackPressed() {
    Intent intent = new Intent(this, PrivContactsActivity.class);
    this.startActivityForResult(intent, 0);
  }

}




Java Source Code List

com.amanaje.activities.ContactDetailActivity.java
com.amanaje.activities.MainActivity.java
com.amanaje.activities.MessageActivity.java
com.amanaje.activities.NewSmsActivity.java
com.amanaje.activities.PrivContactsActivity.java
com.amanaje.activities.SettingsActivity.java
com.amanaje.activities.package-info.java
com.amanaje.asynctasks.AsyncTaskManager.java
com.amanaje.asynctasks.package-info.java
com.amanaje.commons.ActivityHelper.java
com.amanaje.commons.AppException.java
com.amanaje.commons.AppMessages.java
com.amanaje.commons.Constants.java
com.amanaje.commons.StaticObj.java
com.amanaje.commons.Utils.java
com.amanaje.commons.package-info.java
com.amanaje.crypto.CryptoUtils.java
com.amanaje.crypto.TotpImpl.java
com.amanaje.crypto.package-info.java
com.amanaje.entities.ConfigEntity.java
com.amanaje.entities.CryptoAlgoEntity.java
com.amanaje.entities.OpenPgpEntity.java
com.amanaje.entities.SmsEntity.java
com.amanaje.entities.package-info.java
com.amanaje.view.adapters.RowContactAdapter.java
com.amanaje.view.adapters.StableArrayAdapter.java
com.amanaje.view.adapters.package-info.java
org.jdamico.bc.openpgp.utils.PgpHelper.java
org.jdamico.bc.openpgp.utils.RSAKeyPairGenerator.java
org.jdamico.bc.openpgp.utils.package-info.java