Adding OpenStreetMap to HelloWorld in 10.2.2

Discussion created by pattyjula on Mar 30, 2014
Latest reply on Apr 8, 2014 by doneill-esristaff
Hello, I want to add an OpenStreetMap tile service layer to the Esri Android HelloWorld app. I'm following the OpenStreetMap documentation here. Find the relevant code below:

public class HelloWorld extends Activity {
  MapView mMapView;

  // Called when the activity is first created.
  public void onCreate(Bundle savedInstanceState) {
    mMapView = (MapView)findViewById(;
    String[] tileServerURL = {"{KEY}/1/256"};
    OpenStreetMapLayer tileLayer = new OpenStreetMapLayer(tileServerURL, 1, 16, "CloudMade", true);
    mMapView.addLayer(tileLayer); //when this line is commented out the app runs just fine

LogCat gives an EsriServiceException and the app closes when I include the code above in the app. I'm probably missing something minor? Can someone clue me in?

Thanks! Patty