title: How to use webview or open URL in AndEngine - Android
body: <p>I'm utilizing a game engine called AndEngine (which I'm completely new to) in my Android app. I need to load a different URL from the application based on what position an onscreen joystick is in (uploading to a .cgi server). The dilemma is that I cannot open a URL connection! This may seem simple, but I've looked everywhere, tried multiple solutions and nothing's worked. In basic Android, I've always used a WebView (loadUrl() method), and it worked well. However, I have no idea to how to create a webview while also using AndEngine. My preference is that the connection did not show (loaded underneath the AndEngine scene?) because I will need the screen for other things. I've also tried other solutions. I just tried this code, but when I checked the server, nothing was opened:</p>
  
  <pre><code>    @Override
  public void onLoadResources() {
  
      //methods n/a to this question
  
      try {
          URL url = new URL(setUrl);
          HttpURLConnection con = (HttpURLConnection) url.openConnection();
          readStream(con.getInputStream());
      } catch (Exception e) {
          e.printStackTrace();
      }
  
      return scene; // AndEngine return statement
  }
  
  private void readStream(InputStream in) {
      BufferedReader reader = null;
      try {
          reader = new BufferedReader(new InputStreamReader(in));
          String line = "";
          while ((line = reader.readLine()) != null) {
              System.out.println(line);
          }
      } catch (IOException e) {
          e.printStackTrace();
      } finally {
          if (reader != null) {
              try {
                  reader.close();
              } catch (IOException e) {
                  e.printStackTrace();
              }
          }
      }
  }
  </code></pre>
  
  <p>**I've tried using the HTTPConnection class before (without AndEngine) to open up a URL, but to no avail. So it may be that I was just doing something wrong here. Using AndEngine GLES2. If more info is needed, let me know (this is my first question on SO).</p>
  
  <p>Also tried setting up my .xml layout on AndEngine using</p>
  
  <pre><code>@Override
  protected int getLayoutID() {
  return R.layout.main;
  }
  </code></pre>
  
  <p>but it says: "The method getLayoutID() of type Control must override or implement a supertype method"</p>
  
  <p><em><strong>Edit</em></strong> in response to Nicolas Gramlich: Internet permissions were set and compiler was originally at 1.6. Still don't know what the issue is. </p>