- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在一个项目中,我想在 Google map 中显示车辆的位置。我从 Json Web 服务获取车辆的纬度和经度,显示标记和设置位置没有问题。
我的问题是应用程序在 ICE CREAM SAND WITCH 和 Jelly Bean OS 手机上运行良好,当我尝试将应用程序放入 Gingerbread OS 中时,它被强制关闭。
在我的应用程序中,我使用 map fragment 和 API V2。我已将 android-support v 13 jar 文件添加到我的库中。
这是我的 list 代码。
enter code here
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="info.tekguc.umut.googlemapsmapsandroidv2"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="4"
android:targetSdkVersion="19"
/>
<permission
android:name="com.example.androidmapsv2.permission.MAPS_RECEIVE"
android:protectionLevel="signature"></permission>
<uses-permission
android:name="com.example.androidmapsv2.permission.MAPS_RECEIVE"/>
<uses-permission
android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-permission
android:name="android.permission.INTERNET"/>
<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission
android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission
android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>
<application
android:allowBackup="true"
android:icon="@drawable/goo"
android:label="@string/app_name"
android:theme="@style/Translucent" >
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyDXAFrfJnmvVqOJFQ4w5WPajngNoeZpDMI"/>
<activity
android:name="info.tekguc.umut.googlemapsmapsandroidv2.LoginActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="info.tekguc.umut.googlemapsmapsandroidv2.HelpActivity"
android:label="@string/app_name" >
</activity>
<activity
android:name="info.tekguc.umut.googlemapsmapsandroidv2.MainActivity"
android:label="@string/app_name" >
</activity>
</application>
</manifest>
请任何人帮助我如何在旧版本的 Android 操作系统中运行此应用程序..
提前致谢。
最佳答案
首先将com.example.androidmapsv2
替换为manifest.xml中的包名
然后
对 <3.0 版本使用 SupportMapFragment
,因为 fragment 可从 API 11(3.0) 获取
<fragment
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="com.google.android.gms.maps.SupportMapFragment" />
您的 Activity 类应该如下所示
public class SupportMapFragmentActivity extends FragmentActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_support_map_fragment);
FragmentManager fmanager = getSupportFragmentManager();
Fragment fragment = fmanager.findFragmentById(R.id.map);
SupportMapFragment supportmapfragment = (SupportMapFragment)fragment;
GoogleMap supportMap = supportmapfragment.getMap();
}
}
关于java - 如何在旧版本的 Android 操作系统中使用 API V2 显示 GoogleMap(iam 使用 map fragment ),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20089588/
我正在尝试将 Google map 集成到我的 xcode 项目中。我严格按照说明here .不幸的是我得到一个错误: error: 'GoogleMaps/GoogleMaps.h' file no
对不起,我是 iOS 开发新手。我使用来自 here 的库在谷歌地图中获取两个地方的方向。我曾经使用过谷歌地图。导入 Google Maps Framework 后,仍然出现错误... 问题是: 如何
我的应用程序有问题。 当我尝试在 上构建它时Android Studio 一切正常,但是当我尝试在 上构建它时Xcode 我遇到错误并且构建失败。 原因似乎来自AirMaps: 词法或预处理器问题'G
昨天我收到一封来自谷歌的电子邮件,说我可以访问 ios 的 map api,我从应用程序控制台生成了我的 key ,然后我按照 https://developers.google.com/maps/d
我想使用谷歌地图显示一些标记。信息(坐标)存储在本地 *.csv 文件中(我想使用“资源文件”)。 如何读取这个 *.csv 文件?如果我使用“jQuery.get('myFile.csv', fun
我正在尝试找出为什么谷歌地图在一天后的表现与一天前有所不同。 我最近将客户的网站上线。地理定位出现错误,我已修复它。但没有在测试站点上修复它。 今天,在两侧(固定一侧和测试一侧)我的地理位置开始显示非
我正在尝试使用地理编码来获取地址,计算出经度和纬度,然后在 map 上显示叠加层。 我正在使用下面的代码,但是日志条目 Log.e("Found",""+lat);永远不会触发,我不知道为什么。有人可
我尝试了大约 4 个小时,但没有发生。尝试开发一个应用程序来显示谷歌地图中的特定位置。 执行以下代码: GooglemapsActivity.java package com.example.gps2
我在尝试显示 googlemaps 时遇到错误 如果我加载 googlemaps javascript 源 我在 Firebug 中得到这个错误 syntax error [Break on this
我正在尝试在 swift 上创建一个 View Controller 来显示用户所在的位置。我已经实现了谷歌地图,所以现在我所要做的就是插入正确的代码。这样做时,我不断收到这两条错误消息,然后应用程序
我正在构建一个出租车应用程序,我设法将所有带有出租车标记图标的汽车添加到它们的确切位置。 但不知为何,所有的图标都看错了方向, 这是我想要实现的目标: 但我得到: 我的代码: 在这里,我只是将我从服务
问题是我向我的应用程序添加了 GoogleMap Activity ,我什至获得了 key ,但 map 只显示在模拟器中。当我在不同的设备上下载我的应用程序时, map 无法使用。我所能看到的只是一
我有两个动画要按顺序在谷歌地图上执行。所以在动画 1 完成后,动画 2 可以继续。 这可以通过这样的回调轻松完成: googleMap.animateCamera(CameraUpdateFacto
最近我的客户想添加这样的功能:当用户有 Internet 连接时, map 会正常显示,但当用户离线启动应用程序时(即使刚刚安装后), map 不会显示,但他仍然可以看到其区域上的标记,但带有自定义背
我正在处理一个处理 map Activity 的项目。我正在运行一个由单个 Activity MaptestActivity 组成的测试应用程序,它扩展了 MapActivity 并且什么都不做。我将
在我的应用程序中,我使用 GoogleMap (play-services-maps:10.2.1)。我已将 map 的位置固定在特定位置,但我不希望我的用户能够移动 map 。我只希望他能够放大它。
我是 java 和 android 的新手。我遇到了一个基本问题。 在这个给定的 fragment 中,我可以将 GoogleMap 对象添加为 parcelable 而无需任何额外的 pracela
我用 googlemap api 制作了一个 android 应用程序,并在叠加层上绘制了一些 16x16 png(大约 200 个)。当我移动或放大/放大 map View 时,经常出现“内存不足”
我正在关注https://developers.google.com/maps/documentation/javascript/directions到目前为止, map 计算特定点之间的距离,但我需
我的 VueJS/Laravel 应用程序没有像我预期的那样正确加载到 GoogleMaps 中。我不明白为什么不调用回调。该功能可用并且应该加载。你能帮助我吗?我没有发现我的错误。我不希望看到 ma
我是一名优秀的程序员,十分优秀!