Android Open Source - prepGRE Mnemonic Retriever






From Project

Back to project page prepGRE.

License

The source code is released under:

MIT License

If you think the Android project prepGRE 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.abhimanbhau.prepgre.code;
/*w w w .  jav  a  2 s  .  com*/
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

import android.os.AsyncTask;

public class MnemonicRetriever extends AsyncTask<String, Void, String> {
  @Override
  protected void onPreExecute() {
  }

  @Override
  protected String doInBackground(String... arg) {
    String result = null;
    try {
      Document doc = Jsoup
          .connect(arg[0])
          .timeout(7000)
          .userAgent(
              "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36")
          .get();
      Elements elems = doc.getElementsByClass("span9");
      if (elems.size() == 0) {
        return "No data received!";
      }
      for (Element e : elems) {
        result += (e.text() + System.getProperty("line.separator") + System
            .getProperty("line.separator"));
      }
    } catch (Exception e) {
      return null;
    }
    result = result.replace("null", "");
    return result;
  }
}




Java Source Code List

com.abhimanbhau.prepgre.code.EtymologyRetriever.java
com.abhimanbhau.prepgre.code.MnemonicRetriever.java
com.abhimanbhau.prepgre.code.Utility.java
com.abhimanbhau.prepgre.ui.AboutFragment.java
com.abhimanbhau.prepgre.ui.HomeFragment.java
com.abhimanbhau.prepgre.ui.MainActivity.java
com.abhimanbhau.prepgre.ui.NavigationDrawerFragment.java
com.abhimanbhau.prepgre.ui.SettingsActivity.java
com.abhimanbhau.prepgre.ui.WordListFragment.java