title: routing from my location to a defined point in arcgis for android
body: <p>i've downloaded a project named RoutingSample from arcgis, then i tried to use it on my eclipse.
  it's running on my tablet without errors, but when it arrive to the command &quot;RouteTask.solve(rp);&quot; it raises an exception so it will not be able to calculate the route :</p>
  <blockquote>
  <p>'com.esri.core.io.EsriServiceException: Unable to complete  operation.</p>
  <p>Location &quot;Location 1&quot; in &quot;Stops&quot; is unlocated.  Location &quot;Location 2&quot; in &quot;Stops&quot; is &gt;unlocated.
  Need at least 2 valid stops.<br />
  &quot;Stops&quot; does not contain valid input for any route.'</p>
  </blockquote>
  <p>any ideas ?</p>
  <p>this is my location first :</p>
  <pre><code>public void onLocationChanged(Location loc) {
          if (loc == null)
              return;
          boolean zoomToMe = (mLocation == null) ? true : false;
          mLocation = new Point(loc.getLongitude(), loc.getLatitude());
          if (zoomToMe) {
          //  Point mapPoint = (Point) GeometryEngine.project(mLocation, SpatialReference.create(4326), map.getSpatialReference());
              Point p = (Point) GeometryEngine.project(mLocation, egs, wm);
              map.zoomToResolution(p, 20.0);
          }
      }
  </code></pre>
  <p>and this is the on long pess listener that i calculate the route in :</p>
  <pre><code>            // Clear the graphics and empty the directions list
              routeLayer.removeAll();
              hiddenSegmentsLayer.removeAll();
              curDirections = new ArrayList&lt;String&gt;();
              mResults = null;
  
              // retrieve the user clicked location
              final Point loc = map.toMapPoint(x, y);
  
              // Show that the route is calculating
              dialog = ProgressDialog.show(RoutingSample.this, &quot;&quot;,
                      &quot;Calculating route...&quot;, true);
              // Spawn the request off in a new thread to keep UI responsive
              Thread t = new Thread() {
                  @Override
                  public void run() {
                      try {
                          // Start building up routing parameters
                          RouteParameters rp = mRouteTask
                                  .retrieveDefaultRouteTaskParameters();
                          NAFeaturesAsFeature rfaf = new NAFeaturesAsFeature();
                          // Convert point to EGS (decimal degrees)
                          Point p = (Point) GeometryEngine.project(loc, wm,
                                  egs);
                      
                          // Create the stop points (start at our location, go
                          // to pressed location)
                          
                          StopGraphic point1 = new StopGraphic(mLocation);
                          StopGraphic point2 = new StopGraphic(p);
                          rfaf.setFeatures(new Graphic[] { point1, point2 });
                          rfaf.setCompressedRequest(true);
                          rp.setStops(rfaf);
                          // Set the routing service output SR to our map
                          // service's SR
                          rp.setOutSpatialReference(wm);
  
                          // Solve the route and use the results to update UI
                          // when received
                          mResults = mRouteTask.solve(rp);
                          mHandler.post(mUpdateResults);
                      } catch (Exception e) {
                          mException = e;
                          mHandler.post(mUpdateResults);
                      }
                  }
              };
              // Start the operation
              t.start();
              return true;
  </code></pre>