Search in sources :

Example 1 with MapView

use of org.oscim.android.MapView in project graphhopper by graphhopper.

the class MainActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    mapView = new MapView(this);
    final EditText input = new EditText(this);
    input.setText(currentArea);
    boolean greaterOrEqKitkat = Build.VERSION.SDK_INT >= 19;
    if (greaterOrEqKitkat) {
        if (!Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
            logUser("GraphHopper is not usable without an external storage!");
            return;
        }
        mapsFolder = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS), "/graphhopper/maps/");
    } else
        mapsFolder = new File(Environment.getExternalStorageDirectory(), "/graphhopper/maps/");
    if (!mapsFolder.exists())
        mapsFolder.mkdirs();
    TextView welcome = (TextView) findViewById(R.id.welcome);
    welcome.setText("Welcome to GraphHopper " + Constants.VERSION + "!");
    welcome.setPadding(6, 3, 3, 3);
    localSpinner = (Spinner) findViewById(R.id.locale_area_spinner);
    localButton = (Button) findViewById(R.id.locale_button);
    remoteSpinner = (Spinner) findViewById(R.id.remote_area_spinner);
    remoteButton = (Button) findViewById(R.id.remote_button);
    // TODO get user confirmation to download
    // if (AndroidHelper.isFastDownload(this))
    chooseAreaFromRemote();
    chooseAreaFromLocal();
}
Also used : EditText(android.widget.EditText) MapView(org.oscim.android.MapView) TextView(android.widget.TextView) File(java.io.File)

Aggregations

EditText (android.widget.EditText)1 TextView (android.widget.TextView)1 File (java.io.File)1 MapView (org.oscim.android.MapView)1