AddActivity.java revision 86e135c855819d5be9f078716baf68756f747460
/*
* FreeOTP
*
* Authors: Nathaniel McCallum <npmccallum@redhat.com>
*
* Copyright (C) 2013 Nathaniel McCallum, Red Hat
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public class AddActivity extends Activity implements View.OnClickListener, CompoundButton.OnCheckedChangeListener {
private final int SHA1_OFFSET = 1;
private ImageButton mImage;
private Spinner mAlgorithm;
private RadioButton mHOTP;
super.onCreate(savedInstanceState);
// Select the default algorithm
// Setup the Counter toggle
mHOTP.setOnCheckedChangeListener(this);
// Setup the buttons
mImage.setOnClickListener(this);
// Set constraints on when the Add button is enabled
}
break;
finish();
break;
// Get the fields
// Create the URI
"otpauth://%sotp/%s:%s?secret=%s&algorithm=%s&digits=%d&period=%d",
// Add optional parameters.
}
try {
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
}
// Add the token
finish();
break;
}
}
}
if (resultCode == RESULT_OK) {
}
}
}