首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在android上制作地图

在android上制作地图
EN

Stack Overflow用户
提问于 2016-08-02 00:43:06
回答 2查看 76关注 0票数 1

我正在尝试在android上制作一个应用程序,这只是一个使用智能手机GPS的典型地图,我计划使用Dijkstra的最短路径算法。

我计划做的是制作一个岛屿的俯视图地图,并从我的gps收集岛屿道路上每个十字路口的纬度和经度数据,将图像(我制作的岛屿地图)与纬度和经度数据连接起来,然后执行Dijkstra的最短路径算法。

有什么建议吗?

我该怎么做呢?

EN

回答 2

Stack Overflow用户

发布于 2016-08-02 01:15:22

第一个活动文件

getFragmentManager().findFragmentById(R.id.map)).getMap();= ((MapFragment) GoogleMap googleMap;googleMap =((MapFragment)googleMap

票数 0
EN

Stack Overflow用户

发布于 2016-08-03 14:33:41

遵循Getting Started

本指南是向Android应用程序添加地图的快速入门。Android Studio是使用Google Maps Android API构建应用程序的推荐开发环境。

步骤1.下载Android Studio

步骤2.安装Google Play服务SDK

步骤3.创建Google Maps项目

步骤4.获取Google Maps API密钥

第5步: Hello Map!看一下代码

第6步:连接Android设备

步骤7.构建并运行您的应用程序

启用GPS:

代码语言:javascript
复制
@Override
protected void onStart() {
super.onStart(); // Always call the superclass method first

// The activity is either being restarted or started for the first time
// so this is where we should make sure that GPS is enabled
LocationManager locationManager =
(LocationManager) getSystemService(Context.LOCATION_SERVICE);
boolean gpsEnabled = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER);

if (!gpsEnabled) {
// Create a dialog here that requests the user to enable GPS, and use an intent
// with the android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS action
// to take the user to the Settings screen to enable GPS when they click "OK"
}
}

希望这能有所帮助!

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/38703996

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档