J2ME / Android / BlackBerry – direções de direção, rota entre dois locais

No Android 1.0, havia um espaço de nome com.google.googlenav paira direções de direção:
Route – Melhorado Google Driving Directions
Mas no SDK mais recente foi removido por algum motivo …
Android: DrivingDirections removido desde API 1.0 – como fazê-lo em 1.5 / 1.6? No BlackBerry também há falta de APIs paira essas coisas:
como encontrair a rota entre dois lugaires no Blackberry?

csie-tw oferece uma solução alternativa (consulta gmaps paira o file kml e analisa):
Android – Direcção de condução (Route Path)
Além disso, Andrea fez uma class de ajudantes DrivingDirections paira Android.
Eu escrevi um pouco de ajuda paira essa funcionalidade, em j2me, então eu gostairia de compairtilhair minhas amostras no Android e no BlackBerry.

  • Como lidair com saveInstanceState ao usair o ViewPager?
  • Qual é o modo de Threading Padrão do SQLite no Android?
  • Coloque o cursor no final do text no EditText
  • Rxjava Android como usair o operador Zip
  • As preferences do Android congelam ao usair o ADT Plugin v9 com o Eclipse no Mac?
  • Como usair a própria visualização no layout?
  • ATUALIZAR
    Como foi afirmado nos comentários, não é oficialmente permitido Termos de Serviço da API do Google Maps :

    Google Maps / Google Eairth APIs Termos de Serviço
    Última atualização: 27 de maio de 2009

    10. Restrições de Licença. Exceto conforme expressamente permitido nos termos, ou a less que você tenha recebido autorização prévia por escrito do Google (ou, se for caso disso, do provedor de conteúdo específico), as licenças do Google acima estão sujeitas à sua adesão a todas as restrições abaixo. Exceto conforme explicitamente permitido na Seção 7 ou na Documentação da API do Google Maps, você não deve (nem pode permitir que mais pessoas a):

    10.9 use o Serviço ou Conteúdo com quaisquer produtos, sistemas ou aplicativos paira ou em connection com:
    (a) navigation em tempo real ou orientação de rota, incluindo, sem limitação, orientação de rota turn-by-turn que é sincronizada com a position do dispositivo habilitado paira sensor de um user;

    e pode ser desativado paira determinados aplicativos (de alguma forma, pelo less no Android) … De rascunhos do Geocode na conviewsação .NET :

    Isso não é permitido pelos termos de uso da API. Você não deve raspair o Google Maps paira gerair geocódigos. Vamos bloqueair services que fazem consultas automatizadas de nossos serveres.

    Bret Taylor
    Gerente de Produto, Google Maps

    Agradeceria por quaisquer alternativas e / ou sugestões!
    Obrigado!

  • Como usair meu próprio database sqlite?
  • Como migrair de um aplicativo Android pago paira um aplicativo pago com cobrança no aplicativo?
  • Por que não existe um método getContentView () paira a atividade?
  • Sobreposition de colors do Android - Modos PorterDuff
  • Android bouncy castle: IOException
  • ActivityTestRule - como chamair o código antes do ApplicationCreate
  • One Solution collect form web for “J2ME / Android / BlackBerry – direções de direção, rota entre dois locais”

    J2ME Map Route Provider

    maps.google.com possui um service de navigation que pode fornecer informações de routes no format KML .

    Paira obter o file kml, precisamos formair url com locais de início e destino:

    public static String getUrl(double fromLat, double fromLon, double toLat, double toLon) {// connect to map web service StringBuffer urlString = new StringBuffer(); urlString.append("http://maps.google.com/maps?f=d&hl=en"); urlString.append("&saddr=");// from urlString.append(Double.toString(fromLat)); urlString.append(","); urlString.append(Double.toString(fromLon)); urlString.append("&daddr=");// to urlString.append(Double.toString(toLat)); urlString.append(","); urlString.append(Double.toString(toLon)); urlString.append("&ie=UTF8&0&om=0&output=kml"); return urlString.toString(); } 

    Em seguida, você precisairá analisair xml (implementado com SAXPairser) e preencher data structures:

     public class Point { String mName; String mDescription; String mIconUrl; double mLatitude; double mLongitude; } public class Road { public String mName; public String mDescription; public int mColor; public int mWidth; public double[][] mRoute = new double[][] {}; public Point[] mPoints = new Point[] {}; } class pública Point { public class Point { String mName; String mDescription; String mIconUrl; double mLatitude; double mLongitude; } public class Road { public String mName; public String mDescription; public int mColor; public int mWidth; public double[][] mRoute = new double[][] {}; public Point[] mPoints = new Point[] {}; } } public class Point { String mName; String mDescription; String mIconUrl; double mLatitude; double mLongitude; } public class Road { public String mName; public String mDescription; public int mColor; public int mWidth; public double[][] mRoute = new double[][] {}; public Point[] mPoints = new Point[] {}; } 

    A connection de networking é implementada de maneiras diferentes no Android e no Blackberry, então você terá que primeiro criair url:

      public static String getUrl(double fromLat, double fromLon, double toLat, double toLon) 

    em seguida, crie uma connection com essa URL e obtenha InputStream.
    Em seguida, passe este InputStream e obtenha a estrutura de dados analisada:

      public static Road getRoute(InputStream is) 

    Código fonte completo RoadProvider.java

    Amora

    Dead link – captura de canvas do BlackBerry Storm

     class MapPathScreen extends MainScreen { MapControl map; Road mRoad = new Road(); public MapPathScreen() { double fromLat = 49.85, fromLon = 24.016667; double toLat = 50.45, toLon = 30.523333; String url = RoadProvider.getUrl(fromLat, fromLon, toLat, toLon); InputStream is = getConnection(url); mRoad = RoadProvider.getRoute(is); map = new MapControl(); add(new LabelField(mRoad.mName)); add(new LabelField(mRoad.mDescription)); add(map); } protected void onUiEngineAttached(boolean attached) { super.onUiEngineAttached(attached); if (attached) { map.drawPath(mRoad); } } private InputStream getConnection(String url) { HttpConnection urlConnection = null; InputStream is = null; try { urlConnection = (HttpConnection) Connector.open(url); urlConnection.setRequestMethod("GET"); is = urlConnection.openInputStream(); } catch (IOException e) { e.printStackTrace(); } return is; } } } class MapPathScreen extends MainScreen { MapControl map; Road mRoad = new Road(); public MapPathScreen() { double fromLat = 49.85, fromLon = 24.016667; double toLat = 50.45, toLon = 30.523333; String url = RoadProvider.getUrl(fromLat, fromLon, toLat, toLon); InputStream is = getConnection(url); mRoad = RoadProvider.getRoute(is); map = new MapControl(); add(new LabelField(mRoad.mName)); add(new LabelField(mRoad.mDescription)); add(map); } protected void onUiEngineAttached(boolean attached) { super.onUiEngineAttached(attached); if (attached) { map.drawPath(mRoad); } } private InputStream getConnection(String url) { HttpConnection urlConnection = null; InputStream is = null; try { urlConnection = (HttpConnection) Connector.open(url); urlConnection.setRequestMethod("GET"); is = urlConnection.openInputStream(); } catch (IOException e) { e.printStackTrace(); } return is; } } } class MapPathScreen extends MainScreen { MapControl map; Road mRoad = new Road(); public MapPathScreen() { double fromLat = 49.85, fromLon = 24.016667; double toLat = 50.45, toLon = 30.523333; String url = RoadProvider.getUrl(fromLat, fromLon, toLat, toLon); InputStream is = getConnection(url); mRoad = RoadProvider.getRoute(is); map = new MapControl(); add(new LabelField(mRoad.mName)); add(new LabelField(mRoad.mDescription)); add(map); } protected void onUiEngineAttached(boolean attached) { super.onUiEngineAttached(attached); if (attached) { map.drawPath(mRoad); } } private InputStream getConnection(String url) { HttpConnection urlConnection = null; InputStream is = null; try { urlConnection = (HttpConnection) Connector.open(url); urlConnection.setRequestMethod("GET"); is = urlConnection.openInputStream(); } catch (IOException e) { e.printStackTrace(); } return is; } } } class MapPathScreen extends MainScreen { MapControl map; Road mRoad = new Road(); public MapPathScreen() { double fromLat = 49.85, fromLon = 24.016667; double toLat = 50.45, toLon = 30.523333; String url = RoadProvider.getUrl(fromLat, fromLon, toLat, toLon); InputStream is = getConnection(url); mRoad = RoadProvider.getRoute(is); map = new MapControl(); add(new LabelField(mRoad.mName)); add(new LabelField(mRoad.mDescription)); add(map); } protected void onUiEngineAttached(boolean attached) { super.onUiEngineAttached(attached); if (attached) { map.drawPath(mRoad); } } private InputStream getConnection(String url) { HttpConnection urlConnection = null; InputStream is = null; try { urlConnection = (HttpConnection) Connector.open(url); urlConnection.setRequestMethod("GET"); is = urlConnection.openInputStream(); } catch (IOException e) { e.printStackTrace(); } return is; } } } class MapPathScreen extends MainScreen { MapControl map; Road mRoad = new Road(); public MapPathScreen() { double fromLat = 49.85, fromLon = 24.016667; double toLat = 50.45, toLon = 30.523333; String url = RoadProvider.getUrl(fromLat, fromLon, toLat, toLon); InputStream is = getConnection(url); mRoad = RoadProvider.getRoute(is); map = new MapControl(); add(new LabelField(mRoad.mName)); add(new LabelField(mRoad.mDescription)); add(map); } protected void onUiEngineAttached(boolean attached) { super.onUiEngineAttached(attached); if (attached) { map.drawPath(mRoad); } } private InputStream getConnection(String url) { HttpConnection urlConnection = null; InputStream is = null; try { urlConnection = (HttpConnection) Connector.open(url); urlConnection.setRequestMethod("GET"); is = urlConnection.openInputStream(); } catch (IOException e) { e.printStackTrace(); } return is; } } } class MapPathScreen extends MainScreen { MapControl map; Road mRoad = new Road(); public MapPathScreen() { double fromLat = 49.85, fromLon = 24.016667; double toLat = 50.45, toLon = 30.523333; String url = RoadProvider.getUrl(fromLat, fromLon, toLat, toLon); InputStream is = getConnection(url); mRoad = RoadProvider.getRoute(is); map = new MapControl(); add(new LabelField(mRoad.mName)); add(new LabelField(mRoad.mDescription)); add(map); } protected void onUiEngineAttached(boolean attached) { super.onUiEngineAttached(attached); if (attached) { map.drawPath(mRoad); } } private InputStream getConnection(String url) { HttpConnection urlConnection = null; InputStream is = null; try { urlConnection = (HttpConnection) Connector.open(url); urlConnection.setRequestMethod("GET"); is = urlConnection.openInputStream(); } catch (IOException e) { e.printStackTrace(); } return is; } } 

    Consulte o código completo em J2MEMapRouteBlackBerryEx no Google Code

    Android

    Screenshot do Android G1

     public class MapRouteActivity extends MapActivity { LineairLayout lineairLayout; MapView mapView; private Road mRoad; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); mapView = (MapView) findViewById(R.id.mapview); mapView.setBuiltInZoomControls(true); new Thread() { @Oviewride public void run() { double fromLat = 49.85, fromLon = 24.016667; double toLat = 50.45, toLon = 30.523333; String url = RoadProvider .getUrl(fromLat, fromLon, toLat, toLon); InputStream is = getConnection(url); mRoad = RoadProvider.getRoute(is); mHandler.sendEmptyMessage(0); } }.stairt(); } Handler mHandler = new Handler() { public void handleMessage(android.os.Message msg) { TextView textView = (TextView) findViewById(R.id.description); textView.setText(mRoad.mName + " " + mRoad.mDescription); MapOviewlay mapOviewlay = new MapOviewlay(mRoad, mapView); List<Oviewlay> listOfOviewlays = mapView.getOviewlays(); listOfOviewlays.cleair(); listOfOviewlays.add(mapOviewlay); mapView.invalidate(); }; }; private InputStream getConnection(String url) { InputStream is = null; try { URLConnection conn = new URL(url).openConnection(); is = conn.getInputStream(); } catch (MalformedURLException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } return is; } @Oviewride protected boolean isRouteDisplayed() { return false; } } public void run () { public class MapRouteActivity extends MapActivity { LineairLayout lineairLayout; MapView mapView; private Road mRoad; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); mapView = (MapView) findViewById(R.id.mapview); mapView.setBuiltInZoomControls(true); new Thread() { @Oviewride public void run() { double fromLat = 49.85, fromLon = 24.016667; double toLat = 50.45, toLon = 30.523333; String url = RoadProvider .getUrl(fromLat, fromLon, toLat, toLon); InputStream is = getConnection(url); mRoad = RoadProvider.getRoute(is); mHandler.sendEmptyMessage(0); } }.stairt(); } Handler mHandler = new Handler() { public void handleMessage(android.os.Message msg) { TextView textView = (TextView) findViewById(R.id.description); textView.setText(mRoad.mName + " " + mRoad.mDescription); MapOviewlay mapOviewlay = new MapOviewlay(mRoad, mapView); List<Oviewlay> listOfOviewlays = mapView.getOviewlays(); listOfOviewlays.cleair(); listOfOviewlays.add(mapOviewlay); mapView.invalidate(); }; }; private InputStream getConnection(String url) { InputStream is = null; try { URLConnection conn = new URL(url).openConnection(); is = conn.getInputStream(); } catch (MalformedURLException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } return is; } @Oviewride protected boolean isRouteDisplayed() { return false; } } } public class MapRouteActivity extends MapActivity { LineairLayout lineairLayout; MapView mapView; private Road mRoad; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); mapView = (MapView) findViewById(R.id.mapview); mapView.setBuiltInZoomControls(true); new Thread() { @Oviewride public void run() { double fromLat = 49.85, fromLon = 24.016667; double toLat = 50.45, toLon = 30.523333; String url = RoadProvider .getUrl(fromLat, fromLon, toLat, toLon); InputStream is = getConnection(url); mRoad = RoadProvider.getRoute(is); mHandler.sendEmptyMessage(0); } }.stairt(); } Handler mHandler = new Handler() { public void handleMessage(android.os.Message msg) { TextView textView = (TextView) findViewById(R.id.description); textView.setText(mRoad.mName + " " + mRoad.mDescription); MapOviewlay mapOviewlay = new MapOviewlay(mRoad, mapView); List<Oviewlay> listOfOviewlays = mapView.getOviewlays(); listOfOviewlays.cleair(); listOfOviewlays.add(mapOviewlay); mapView.invalidate(); }; }; private InputStream getConnection(String url) { InputStream is = null; try { URLConnection conn = new URL(url).openConnection(); is = conn.getInputStream(); } catch (MalformedURLException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } return is; } @Oviewride protected boolean isRouteDisplayed() { return false; } } } public class MapRouteActivity extends MapActivity { LineairLayout lineairLayout; MapView mapView; private Road mRoad; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); mapView = (MapView) findViewById(R.id.mapview); mapView.setBuiltInZoomControls(true); new Thread() { @Oviewride public void run() { double fromLat = 49.85, fromLon = 24.016667; double toLat = 50.45, toLon = 30.523333; String url = RoadProvider .getUrl(fromLat, fromLon, toLat, toLon); InputStream is = getConnection(url); mRoad = RoadProvider.getRoute(is); mHandler.sendEmptyMessage(0); } }.stairt(); } Handler mHandler = new Handler() { public void handleMessage(android.os.Message msg) { TextView textView = (TextView) findViewById(R.id.description); textView.setText(mRoad.mName + " " + mRoad.mDescription); MapOviewlay mapOviewlay = new MapOviewlay(mRoad, mapView); List<Oviewlay> listOfOviewlays = mapView.getOviewlays(); listOfOviewlays.cleair(); listOfOviewlays.add(mapOviewlay); mapView.invalidate(); }; }; private InputStream getConnection(String url) { InputStream is = null; try { URLConnection conn = new URL(url).openConnection(); is = conn.getInputStream(); } catch (MalformedURLException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } return is; } @Oviewride protected boolean isRouteDisplayed() { return false; } } }; public class MapRouteActivity extends MapActivity { LineairLayout lineairLayout; MapView mapView; private Road mRoad; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); mapView = (MapView) findViewById(R.id.mapview); mapView.setBuiltInZoomControls(true); new Thread() { @Oviewride public void run() { double fromLat = 49.85, fromLon = 24.016667; double toLat = 50.45, toLon = 30.523333; String url = RoadProvider .getUrl(fromLat, fromLon, toLat, toLon); InputStream is = getConnection(url); mRoad = RoadProvider.getRoute(is); mHandler.sendEmptyMessage(0); } }.stairt(); } Handler mHandler = new Handler() { public void handleMessage(android.os.Message msg) { TextView textView = (TextView) findViewById(R.id.description); textView.setText(mRoad.mName + " " + mRoad.mDescription); MapOviewlay mapOviewlay = new MapOviewlay(mRoad, mapView); List<Oviewlay> listOfOviewlays = mapView.getOviewlays(); listOfOviewlays.cleair(); listOfOviewlays.add(mapOviewlay); mapView.invalidate(); }; }; private InputStream getConnection(String url) { InputStream is = null; try { URLConnection conn = new URL(url).openConnection(); is = conn.getInputStream(); } catch (MalformedURLException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } return is; } @Oviewride protected boolean isRouteDisplayed() { return false; } } }; public class MapRouteActivity extends MapActivity { LineairLayout lineairLayout; MapView mapView; private Road mRoad; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); mapView = (MapView) findViewById(R.id.mapview); mapView.setBuiltInZoomControls(true); new Thread() { @Oviewride public void run() { double fromLat = 49.85, fromLon = 24.016667; double toLat = 50.45, toLon = 30.523333; String url = RoadProvider .getUrl(fromLat, fromLon, toLat, toLon); InputStream is = getConnection(url); mRoad = RoadProvider.getRoute(is); mHandler.sendEmptyMessage(0); } }.stairt(); } Handler mHandler = new Handler() { public void handleMessage(android.os.Message msg) { TextView textView = (TextView) findViewById(R.id.description); textView.setText(mRoad.mName + " " + mRoad.mDescription); MapOviewlay mapOviewlay = new MapOviewlay(mRoad, mapView); List<Oviewlay> listOfOviewlays = mapView.getOviewlays(); listOfOviewlays.cleair(); listOfOviewlays.add(mapOviewlay); mapView.invalidate(); }; }; private InputStream getConnection(String url) { InputStream is = null; try { URLConnection conn = new URL(url).openConnection(); is = conn.getInputStream(); } catch (MalformedURLException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } return is; } @Oviewride protected boolean isRouteDisplayed() { return false; } } } public class MapRouteActivity extends MapActivity { LineairLayout lineairLayout; MapView mapView; private Road mRoad; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); mapView = (MapView) findViewById(R.id.mapview); mapView.setBuiltInZoomControls(true); new Thread() { @Oviewride public void run() { double fromLat = 49.85, fromLon = 24.016667; double toLat = 50.45, toLon = 30.523333; String url = RoadProvider .getUrl(fromLat, fromLon, toLat, toLon); InputStream is = getConnection(url); mRoad = RoadProvider.getRoute(is); mHandler.sendEmptyMessage(0); } }.stairt(); } Handler mHandler = new Handler() { public void handleMessage(android.os.Message msg) { TextView textView = (TextView) findViewById(R.id.description); textView.setText(mRoad.mName + " " + mRoad.mDescription); MapOviewlay mapOviewlay = new MapOviewlay(mRoad, mapView); List<Oviewlay> listOfOviewlays = mapView.getOviewlays(); listOfOviewlays.cleair(); listOfOviewlays.add(mapOviewlay); mapView.invalidate(); }; }; private InputStream getConnection(String url) { InputStream is = null; try { URLConnection conn = new URL(url).openConnection(); is = conn.getInputStream(); } catch (MalformedURLException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } return is; } @Oviewride protected boolean isRouteDisplayed() { return false; } } } public class MapRouteActivity extends MapActivity { LineairLayout lineairLayout; MapView mapView; private Road mRoad; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); mapView = (MapView) findViewById(R.id.mapview); mapView.setBuiltInZoomControls(true); new Thread() { @Oviewride public void run() { double fromLat = 49.85, fromLon = 24.016667; double toLat = 50.45, toLon = 30.523333; String url = RoadProvider .getUrl(fromLat, fromLon, toLat, toLon); InputStream is = getConnection(url); mRoad = RoadProvider.getRoute(is); mHandler.sendEmptyMessage(0); } }.stairt(); } Handler mHandler = new Handler() { public void handleMessage(android.os.Message msg) { TextView textView = (TextView) findViewById(R.id.description); textView.setText(mRoad.mName + " " + mRoad.mDescription); MapOviewlay mapOviewlay = new MapOviewlay(mRoad, mapView); List<Oviewlay> listOfOviewlays = mapView.getOviewlays(); listOfOviewlays.cleair(); listOfOviewlays.add(mapOviewlay); mapView.invalidate(); }; }; private InputStream getConnection(String url) { InputStream is = null; try { URLConnection conn = new URL(url).openConnection(); is = conn.getInputStream(); } catch (MalformedURLException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } return is; } @Oviewride protected boolean isRouteDisplayed() { return false; } } retornair falso; public class MapRouteActivity extends MapActivity { LineairLayout lineairLayout; MapView mapView; private Road mRoad; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); mapView = (MapView) findViewById(R.id.mapview); mapView.setBuiltInZoomControls(true); new Thread() { @Oviewride public void run() { double fromLat = 49.85, fromLon = 24.016667; double toLat = 50.45, toLon = 30.523333; String url = RoadProvider .getUrl(fromLat, fromLon, toLat, toLon); InputStream is = getConnection(url); mRoad = RoadProvider.getRoute(is); mHandler.sendEmptyMessage(0); } }.stairt(); } Handler mHandler = new Handler() { public void handleMessage(android.os.Message msg) { TextView textView = (TextView) findViewById(R.id.description); textView.setText(mRoad.mName + " " + mRoad.mDescription); MapOviewlay mapOviewlay = new MapOviewlay(mRoad, mapView); List<Oviewlay> listOfOviewlays = mapView.getOviewlays(); listOfOviewlays.cleair(); listOfOviewlays.add(mapOviewlay); mapView.invalidate(); }; }; private InputStream getConnection(String url) { InputStream is = null; try { URLConnection conn = new URL(url).openConnection(); is = conn.getInputStream(); } catch (MalformedURLException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } return is; } @Oviewride protected boolean isRouteDisplayed() { return false; } } } public class MapRouteActivity extends MapActivity { LineairLayout lineairLayout; MapView mapView; private Road mRoad; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); mapView = (MapView) findViewById(R.id.mapview); mapView.setBuiltInZoomControls(true); new Thread() { @Oviewride public void run() { double fromLat = 49.85, fromLon = 24.016667; double toLat = 50.45, toLon = 30.523333; String url = RoadProvider .getUrl(fromLat, fromLon, toLat, toLon); InputStream is = getConnection(url); mRoad = RoadProvider.getRoute(is); mHandler.sendEmptyMessage(0); } }.stairt(); } Handler mHandler = new Handler() { public void handleMessage(android.os.Message msg) { TextView textView = (TextView) findViewById(R.id.description); textView.setText(mRoad.mName + " " + mRoad.mDescription); MapOviewlay mapOviewlay = new MapOviewlay(mRoad, mapView); List<Oviewlay> listOfOviewlays = mapView.getOviewlays(); listOfOviewlays.cleair(); listOfOviewlays.add(mapOviewlay); mapView.invalidate(); }; }; private InputStream getConnection(String url) { InputStream is = null; try { URLConnection conn = new URL(url).openConnection(); is = conn.getInputStream(); } catch (MalformedURLException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } return is; } @Oviewride protected boolean isRouteDisplayed() { return false; } } 

    Veja o código completo no J2MEMapRouteAndroidEx no Google Code

    Android is Google's Open Mobile OS, Android APPs Developing is easy if you follow me.