1

如果我在 .png.tile 中有图块。是否可以将其包含在 .apk 中。我的目的是在我从市场下载应用程序后,当我打开应用程序时,它应该显示至少 1 个国家/地区(可能不大)的每个图块和每个缩放级别。PS。我使用 OSM。PS.2 对不起我的英语语法。

编辑:一个国家可能太大了。也许只是一个省或一个州和一些缩放级别。

EDIT2:这是我使用的功能,我可以对输入流做什么非常感谢。

    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();
    }
4

1 回答 1

1

是的,您可以通过将其放在 assets 文件夹中来包含它。有关访问资产,请参阅http://developer.android.com/reference/android/content/res/AssetManager.html

于 2012-03-06T02:27:43.003 回答