相关疑难解决方法(0)

如何从OpenStreetMap离线创建地图图块,在Android上显示?

我想要的是使用OpenStreetMap显示一个简单的离线地图.我无法在网络上找到正确的工具来创建地图图块并使用它来在Android中显示地图.我已经下载了不同的资源,但似乎我不知道从哪里开始.我想使用JOSM整合来自OpenStreetMap的图像,但我不知道我是否可以在Android上使用它.

我可以使用Mapnik吗?你的帮助将非常感谢你.

java android map openstreetmap

19
推荐指数
2
解决办法
2万
查看次数

Android:下载大文件

我正在尝试从Internet下载大文件(> 20Mb)

private class DownloadTask extends AsyncTask<DatabaseInfo, Integer, String> {

    private DatabaseInfo info;

    protected String doInBackground(DatabaseInfo... dbInfo) {

        int count;
        info = dbInfo[0];

        try {

            URL url = new URL(dbInfo[0].dbPath);

            InputStream input = new BufferedInputStream(url.openStream());
            OutputStream output = new FileOutputStream("/sdcard/db.zip");

            byte data[] = new byte[1024];
            int total = 0;

            while ((count = input.read(data)) != -1) {

                //output.write(data, 0, count);

                total += count;

                if (total % 10240 == 0) {
                    publishProgress(total);
                }
            }

            output.flush();
            output.close();
            input.close();
        } 
        catch (Exception e) { …
Run Code Online (Sandbox Code Playgroud)

android asynchronous download android-asynctask

11
推荐指数
1
解决办法
5231
查看次数