سؤال

if I have tile in .png.tile. Is it possible to include it with .apk. my purpose is after I download app from market, when I open the app it should show every tile and every zoom level of at lease 1 country (maybe not big one). PS. I use OSM. PS.2 sorry for my english grammar.

EDIT: one country maybe too large. maybe just one province or one state and some of zoom level.

EDIT2:This is the function i used and what can i do about inputstream thank you very much.

    AssetManager assetManager = getAssets();

    try {
        files = assetManager.list("Map");
    } catch (IOException e) {
        Log.e("tag", e.getMessage());
    }
    try {
        firstField = (EditText) findViewById(R.id.firstId);
        firstField.setText(Integer.toString(files.length)
                + " file. File name is " + files[0]);

    } catch (Exception e) {
        e.printStackTrace();
    }

    try {
        inputStream = assetManager.open("Map/mapnik.zip");
        // String s = null;
        // s = readTextFile(inputStream);
        // secondField = (EditText) findViewById(R.id.secondId);
        // secondField.setText(s);
    } catch (IOException e) {
        Toast.makeText(this, "Error" + e.toString(), Toast.LENGTH_SHORT)
                .show();
    }
هل كانت مفيدة؟

المحلول

Yes, you can include it by placing it in the assets folder. See http://developer.android.com/reference/android/content/res/AssetManager.html for accessing assets.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top