This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| emailVerificationResult result = null; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public final static String EXTRA_MESSAGE = "com.example.webapitutorial.MESSAGE"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| protected void onPostExecute(String result) { | |
| Intent intent = new Intent(getApplicationContext(), ResultActivity.class); | |
| intent.putExtra(EXTRA_MESSAGE, result); | |
| startActivity(intent); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| protected void onCreate(Bundle savedInstanceState) { | |
| super.onCreate(savedInstanceState); | |
| setContentView(R.layout.activity_result); | |
| Intent intent = getIntent(); | |
| String message = intent.getStringExtra(MainActivity.EXTRA_MESSAGE); |
OlderNewer