Android Open Source - post-to-friendfeed Auth View






From Project

Back to project page post-to-friendfeed.

License

The source code is released under:

Copyright (c) 2010, Larry Myers All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: R...

If you think the Android project post-to-friendfeed 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.larrymyers.android.posttoff;
//from   ww  w .  ja  v a2 s  .co  m
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;

public class AuthView extends Activity implements OnClickListener {

    private AuthAdapter mAuthDb;
    
    private EditText mUsername;
    private EditText mRemoteKey;
    
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.auth);
        
        mAuthDb = new AuthPrefAdapter(this);
        
        Auth auth = mAuthDb.getAuth();
        
        mUsername = (EditText) findViewById(R.id.username);
        mRemoteKey = (EditText) findViewById(R.id.remotekey);
        
        if (savedInstanceState != null) {
            
        } else if (auth != null) {
            mUsername.setText(auth.getUsername());
            mRemoteKey.setText(auth.getRemoteKey());
        }
        
        Button saveButton = (Button) findViewById(R.id.save);
        saveButton.setOnClickListener(this);
    }

    public void onClick(View v) {
        String username = mUsername.getText().toString();
        String remoteKey = mRemoteKey.getText().toString();
        
        Auth auth = new Auth();
        auth.setUsername(username);
        auth.setRemoteKey(remoteKey);
        
        mAuthDb.createAuth(auth);
        
        finish();
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        
        if (mAuthDb != null) {
            mAuthDb.close();
        }
    }
}




Java Source Code List

com.larrymyers.android.posttoff.AuthAdapter.java
com.larrymyers.android.posttoff.AuthDbAdapter.java
com.larrymyers.android.posttoff.AuthPrefAdapter.java
com.larrymyers.android.posttoff.AuthView.java
com.larrymyers.android.posttoff.Auth.java
com.larrymyers.android.posttoff.EntryAdapter.java
com.larrymyers.android.posttoff.EntryDbAdapter.java
com.larrymyers.android.posttoff.EntryService.java
com.larrymyers.android.posttoff.EntryView.java
com.larrymyers.android.posttoff.Entry.java
com.larrymyers.android.posttoff.OpenFF.java