Android Open Source - AndroidWallet Main Activity






From Project

Back to project page AndroidWallet.

License

The source code is released under:

MIT License

If you think the Android project AndroidWallet 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.aurionx.wallet;
// w ww .j av  a2 s.co m
import java.security.Security;

import org.spongycastle.jce.provider.BouncyCastleProvider;

import android.os.Bundle;
import android.view.Menu;
import android.app.Activity;
import android.content.Intent;


public class MainActivity extends Activity {
  private GlobalState state;
  
  static {
    Security.addProvider(new BouncyCastleProvider());
  }
  
  
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //setContentView(R.layout.activity_main);
        
        state = ((GlobalState) getApplicationContext());

        Bundle extras  = getIntent().getExtras(); 
        Boolean clear = extras != null ? extras.getBoolean("clearData") : false;
        if (clear) {
          state.clearData();
          System.out.println("clear data");
          Intent intent  = new Intent(this, LoginActivity.class);
            intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); 
          startActivity (intent);
          finish();
          return;
        }
        
        if (state.pinRequired() && state.hasPin()) {
          Intent i = new Intent(MainActivity.this, PinActivity.class);
          i.putExtra("pinAuth", true);
          startActivityForResult (i, 2);
        }
        
        else {
          chooseActivity();
        }
    }
    
    @Override
    public void onRestart() {
      super.onRestart();
      System.out.println("restart main");
      //this.finish();
      //chooseActivity();
    }
    
    @Override
    public void onResume() {
      super.onResume();
      System.out.println("resume main");
      //this.finish();
      //chooseActivity();
    }
    
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {

      System.out.println(requestCode);
      System.out.println(resultCode);
      
      if (requestCode == 2) {
        if (resultCode == RESULT_OK) {chooseActivity();}  
        if (resultCode == RESULT_CANCELED) {finish();}
      }
    }
    
    private void chooseActivity ()
    {
    if (state.hasBlob()) {
      startActivity(new Intent(MainActivity.this, WalletActivity.class));
      finish();
      
      } else { 
            startActivity(new Intent(MainActivity.this, LoginActivity.class));
            finish();
        }      
    }
    
}




Java Source Code List

com.aurionx.wallet.BalanceItem.java
com.aurionx.wallet.BalancesListAdapter.java
com.aurionx.wallet.GlobalState.java
com.aurionx.wallet.LoginActivity.java
com.aurionx.wallet.MainActivity.java
com.aurionx.wallet.PinActivity.java
com.aurionx.wallet.SettingsActivity.java
com.aurionx.wallet.WalletActivity.java
com.aurionx.wallet.currencyName.java
com.codebutler.android_websockets.HybiParser.java
com.codebutler.android_websockets.SocketIOClient.java
com.codebutler.android_websockets.WebSocketClient.java
com.ripple.Account.java
com.ripple.Blobvault.java
com.ripple.NetworkState.java
com.ripple.NetworkUtil.java
com.ripple.RippleWS.java