在我的Android应用程序中获取灰色方块而不是谷歌地图

时间:2012-12-17 12:12:52

标签: java android

我正在创建基于Web的Android应用程序,我想在我的应用程序中集成G​​oogle Map。我也得到了我的api密钥,但我仍然得到灰色方块而不是实际的地图。还有我在下面给出的错误信息

在控制台中我收到此消息

[2012-12-17 17:37:28 - Google] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.google/.MapsActivity }
[2012-12-17 17:37:28 - Google] ActivityManager: Warning: Activity not started, its current task has been brought to the front 

这是我的logcat:

12-17 17:31:23.004: W/dalvikvm(301): threadid=1: spin on suspend #1 threadid=8 (pcf=0)
12-17 17:31:23.004: D/dalvikvm(301): Temporarily moving tid 313 to fg (was 0)
12-17 17:31:23.004: D/dalvikvm(301): Temporarily raised priority on tid 313 (19 -> 0)
12-17 17:31:23.013: W/dalvikvm(301): threadid=1: spin on suspend resolved in 1014 msec
12-17 17:31:23.013: D/dalvikvm(301): Restored policy of 313 to 0
12-17 17:31:23.013: D/dalvikvm(301): Restored priority on 313 to 19
12-17 17:31:23.444: D/dalvikvm(301): GC_FOR_MALLOC freed 5064 objects / 310440 bytes in 1440ms
12-17 17:31:23.864: D/dalvikvm(301): GC_FOR_MALLOC freed 9756 objects / 595416 bytes in 98ms
12-17 17:31:24.194: D/dalvikvm(301): GC_FOR_MALLOC freed 5164 objects / 335976 bytes in 135ms
12-17 17:31:24.374: D/dalvikvm(301): GC_FOR_MALLOC freed 6226 objects / 380088 bytes in 59ms
12-17 17:31:24.584: D/dalvikvm(301): GC_FOR_MALLOC freed 8548 objects / 652784 bytes in 52ms
12-17 17:31:24.744: D/dalvikvm(301): GC_FOR_MALLOC freed 6088 objects / 369232 bytes in 59ms
12-17 17:31:24.903: I/MapActivity(301): Handling network change notification:CONNECTED
12-17 17:31:24.903: E/MapActivity(301): Couldn't get connection factory client
12-17 17:31:28.734: D/dalvikvm(301): GC_FOR_MALLOC freed 5901 objects / 533024 bytes in 47ms
12-17 17:31:31.524: D/dalvikvm(301): GC_FOR_MALLOC freed 1368 objects / 166224 bytes in 41ms
12-17 17:31:36.544: D/dalvikvm(301): GC_FOR_MALLOC freed 1278 objects / 162584 bytes in 41ms
12-17 17:31:39.044: D/dalvikvm(301): GC_FOR_MALLOC freed 1278 objects / 162552 bytes in 42ms
12-17 17:31:41.594: D/dalvikvm(301): GC_FOR_MALLOC freed 1278 objects / 162512 bytes in 42ms
12-17 17:31:54.893: D/dalvikvm(301): GC_FOR_MALLOC freed 1278 objects / 162568 bytes in 43ms
12-17 17:32:25.104: D/dalvikvm(301): GC_FOR_MALLOC freed 1278 objects / 162568 bytes in 41ms
12-17 17:33:35.694: D/dalvikvm(301): GC_FOR_MALLOC freed 1278 objects / 162504 bytes in 42ms
12-17 17:36:25.954: D/dalvikvm(301): GC_FOR_MALLOC freed 1280 objects / 162560 bytes in 40ms

2 个答案:

答案 0 :(得分:0)

正如我在评论中提到的,这不是错误,也不与您的问题相关联。

您应该检查您是否遵循了new Android Maps的指南,同时检查您的api密钥是否写得很好。


编辑:您还可以查看this post了解详情。

答案 1 :(得分:0)

...或使用不需要任何API密钥或其他内容的免费库:https://sourceforge.net/projects/libwlocate/是轻量级的,支持OSM,Google地图,Google Sattelite,全面支持缩放/移动和示例演示功能的实现。