Android Open Source - EatDudeAndroid Restaurant Search

From Project

Back to project page EatDudeAndroid.


The source code is released under:

GNU General Public License

If you think the Android project EatDudeAndroid 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.wileynet.eatdude;
/*www. j  a  va  2 s  . c  o m*/
import java.util.Map;
import java.util.Vector;

import com.wileynet.eatdude.xml.SAXHelper;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

//import android.widget.Toast;

public class RestaurantSearch extends Activity {

  public static Restaurant r;
  public static Vector<String> orders = new Vector<String>();
  private String menu_id;
  public static int dbClear = 0;

  protected void onCreate(Bundle savedInstanceState) {

    // Proguard will rename the onClick method and break it unless you
    // specifically tell it not to,
    // or you can just turn off proguard which is easier.

    // I got this error from the xml layout for a ImageButton. I was using
    // api 3 which apparently
    // does not support this attribute. Simply going to api 4 resolved this
    // problem.

    // public void selfDestruct(View view) {
    // Kabloey
    // }

    final Button button = (Button) findViewById(;
    button.setOnClickListener(new View.OnClickListener() {
      Intent i;

      public void onClick(View v) {
        if (loadRestaurantXML()) {
          if (r.getMenu().size() > 1) {
            i = new Intent(RestaurantSearch.this,
          } else {
            for (Map.Entry<String, String> entry : r.getMenu()
                .entrySet()) {
              menu_id = "" + entry.getKey();
            i = new Intent(RestaurantSearch.this,
            i.putExtra("menu_id", menu_id);
        } else {
              "Internet Connection Error", Toast.LENGTH_SHORT)



  protected boolean loadRestaurantXML() {

    Boolean success = true;
    try {
      String url = "";
      SAXHelper sh = new SAXHelper();

      r = new Restaurant(sh.restaurant_id, sh.restaurant_name,,
          sh.menu_category, sh.menu_item);
      // sh = null;
    } catch (Exception e) {
      success = false;

    return success;


Java Source Code List