Skip to content

Instantly share code, notes, and snippets.

protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_result);
Intent intent = getIntent();
String message = intent.getStringExtra(MainActivity.EXTRA_MESSAGE);
protected void onPostExecute(String result) {
Intent intent = new Intent(getApplicationContext(), ResultActivity.class);
intent.putExtra(EXTRA_MESSAGE, result);
startActivity(intent);
}
public final static String EXTRA_MESSAGE = "com.example.webapitutorial.MESSAGE";
protected String doInBackground(String... params) {
String urlString=params[0];
String resultToDisplay;
emailVerificationResult result = null;
InputStream in = null;
// HTTP Get
try {
URL url = new URL(urlString);
HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();
private emailVerificationResult parseXML( XmlPullParser parser ) throws XmlPullParserException, IOException {
int eventType = parser.getEventType();
emailVerificationResult result = new emailVerificationResult();
while( eventType!= XmlPullParser.END_DOCUMENT) {
String name = null;
switch(eventType)
{
// Parse XML
XmlPullParserFactory pullParserFactory;
try {
pullParserFactory = XmlPullParserFactory.newInstance();
XmlPullParser parser = pullParserFactory.newPullParser();
parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, false);
parser.setInput(in, null);
result = parseXML(parser);
} catch (XmlPullParserException e) {
emailVerificationResult result = null;
private class emailVerificationResult {
public String statusNbr;
public String hygieneResult;
}
public void verifyEmail(View view) {
EditText emailEditText = (EditText) findViewById(R.id.email_address);
String email = emailEditText.getText().toString();
if( email != null && !email.isEmpty()) {
String urlString = apiURL + "LicenseInfo.RegisteredUser.UserID=" + strikeIronUserName + "&LicenseInfo.RegisteredUser.Password=" + strikeIronPassword + "&VerifyEmail.Email=" + email + "&VerifyEmail.Timeout=30";
new CallAPI().execute(urlString);
public final static String strikeIronUserName = "[email protected]";
public final static String strikeIronPassword = "strikeironpassword";
public final static String apiURL = "http://ws.strikeiron.com/StrikeIron/EMV6Hygiene/VerifyEmail?";