小编Apo*_*poz的帖子

引用google-play-services库

我正在使用Google Maps Android API v2开展项目,当我开始引用google-play-services_lib时遇到问题.我的项目图标上出现一个红色感叹号,我在"问题"选项卡中有一条错误消息(我正在使用Eclipse):

The container 'Android Dependencies' references non existing library 'C:\Users\Labo FMS\Documents\Applications\04-adt-bundle-windows-x86_64\sdk\extras\google\google_play_services\libproject\google-play-services_lib\bin\google-play-services_lib.jar'
Run Code Online (Sandbox Code Playgroud)

事实上,如果我去那个文件夹,我发现没有"google-play-services_lib.jar"文件.

我已经尝试重新安装库,我注意到它在安装时底部有一条错误消息:

[2013-04-09 13:54:32 - google-play-services_lib] Unable to resolve target 'android-8'
[2013-04-09 13:54:32 - google-play-services_lib] Unable to resolve target 'android-8'
[2013-04-09 13:56:18 - MainActivity] Unable to resolve target 'android-8'
Run Code Online (Sandbox Code Playgroud)

谁知道这一切意味着什么?

eclipse android google-maps libraries google-play-services

13
推荐指数
1
解决办法
4万
查看次数

将Drawable转换为位图以更改Google Maps Android API v2中标记的颜色

我正在将一个旧的应用程序从v1转换为v2,我的Marker图标的颜色有问题.我有一个基本的白色图标,它需要着色.

在v1中,我这样做了:

Drawable d = DrawableUtils.resizeImageToDrawable(
    MapViewFragment.mapviewActivity,
    Configuration.Display.getDrawableFix(i),
    Configuration.MapView.getWaypointIconWidth(),
    Configuration.MapView.getWaypointIconHeight());
d.setColorFilter(color, Mode.MULTIPLY);

overlay = new MyFplnFixListItimizedOverlay(d);
Run Code Online (Sandbox Code Playgroud)

由于v2 Markers不接受Drawables的图标,我想将Drawable转换为Bitmap,如下所示:

Drawable d = DrawableUtils.resizeImageToDrawable(
    MapViewFragment.mapviewActivity,
    Configuration.Display.getDrawableFix(i),
    Configuration.MapView.getWaypointIconWidth(),
    Configuration.MapView.getWaypointIconHeight());
d.setColorFilter(color, Mode.MULTIPLY);

Bitmap icon = ((BitmapDrawable) d).getBitmap();

Marker marker = MapViewFragment.map.addMarker(new MarkerOptions()
    .position(point)
    .title(Integer.toString(fplnType))
    .visible(true)
    .icon(BitmapDescriptorFactory.fromBitmap(icon)));
Run Code Online (Sandbox Code Playgroud)

但由于某种原因,它不起作用.图标保持白色.谁知道为什么?

提前致谢.

android google-maps drawable google-maps-android-api-2

6
推荐指数
1
解决办法
6287
查看次数

Android Listener用于检测屏幕被按下的时间

我的Android应用程序中有一个视图,应该在按下屏幕时不断更新.我发现大多数听众只在用户第一次触摸屏幕时或者当用户将手从屏幕上移开时才使视图无效.

只要屏幕被触摸,是否会持续触发听众?或者还有其他方法吗?我知道,这听起来很简单,但我还没有找到办法.

android listener touch

5
推荐指数
1
解决办法
8108
查看次数

如何在其他标记上显示 Google Maps Android Marker?

我的应用程序中有多个标记,有时它们中的一些位于相同的位置。我希望其中一些标记始终显示在其他标记之前。我应该如何进行?

先感谢您。

android google-maps google-maps-markers google-maps-android-api-2

3
推荐指数
1
解决办法
4672
查看次数

Google Maps Android API v2教程

我正在开发Google Maps Android API v2的教程:https://developers.google.com/maps/documentation/android/start

我只是试图在我的应用程序中显示一个简单的地图,但它不起作用(应用程序没有打开,并且有一个消息框"The"Test2"应用程序已停止.")我不知道为什么.我完全按照教程中的说法进行操作.

这是我的代码:

AndroidManifest.xml:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.test2"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="17" />

    <permission
        android:name="com.example.test2.permission.MAPS_RECEIVE"
        android:protectionLevel="signature"/>

    <uses-permission android:name="com.example.test2.permission.MAPS_RECEIVE"/>
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>

    <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/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >

        <activity
            android:name="com.example.test2.MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <meta-data
        android:name="com.google.android.maps.v2.API_KEY"
        android:value="The key"/>
    </application>

</manifest>
Run Code Online (Sandbox Code Playgroud)

activity_main.xml:

<fragment xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/map"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:name="com.google.android.gms.maps.MapFragment"/>
Run Code Online (Sandbox Code Playgroud)

MainActivity.java:

package com.example.test2;

import …
Run Code Online (Sandbox Code Playgroud)

android google-maps

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