[英]how can i import this packages (Libraries) in my android application com.google.android.gms.maps.GoogleMap
how can i import this packages (Libraries) in my android application 我如何在我的android应用程序中导入此包(库)
com.google.android.gms.maps.GoogleMap;
when i add this in my Application it will show as an error 当我在应用程序中添加它时,它将显示为错误
but this imports are successful 但是这种导入是成功的
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapView;
import android.os.Bundle;
import android.view.Menu;
i used Eclipse kepler, compile with SDK API Google API(Google Inc.)API 19 minimum API level 14 already add Google APIs[Android[4.4] maps.jar i used Google Maps Android APIv2 in manifest file declare all permissions as follow 我使用Eclipse kepler,使用SDK API进行了编译Google API(Google Inc.)API 19最低API级别14已添加Google APIs [Android [4.4] maps.jar)我在清单文件中使用了Google Maps Android APIv2,声明所有权限如下
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="19" />
<permission
android:name="com.example.googlenewmap.permission.MAPS_RECEIVE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission
android:name = "com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-permission android:name="com.example.googlenewmap.permission.MAPS_RECEIVE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
and add MapAPI key obtain from https://code.google.com/apis/console and add into my layout file as follow 并添加从https://code.google.com/apis/console获取的MapAPI密钥,并如下所示添加到我的布局文件中
<com.google.android.maps.MapView
android:id="@+id/mapView"
android:layout_width="match_parent
android:layout_height="match_parent"
android:clickable="true"
android:enabled="true"
android:apiKey = "I have My APIKey here" />
i get only grids in my emulator as output and console shows this error 11-28 04:04:57.535: E/MapActivity(1555): Couldn't get connection factory client 我在仿真器中仅得到网格作为输出,并且控制台显示此错误11-28 04:04:57.535:E / MapActivity(1555):无法获得连接工厂客户端
i can't understand the full meaning of this error 'coz i am new in android so please guys help me out here. 我无法理解此错误的全部含义,因为我是android的新手,所以请大家在这里帮助我。 thankx in advance
预先感谢
As to your description 至于你的描述
import com.google.android.maps.MapActivity;
导入com.google.android.maps.MapActivity;
import com.google.android.maps.MapView;导入com.google.android.maps.MapView;
This is not in the right track, which should be 这是不正确的,应该是
import com.google.android.gms.maps.MapView;
导入com.google.android.gms.maps.MapView;
import com.google.android.gms.maps.MapFragment;导入com.google.android.gms.maps.MapFragment;
Just like: 就像:
I think the problem is that you haven't import/include/setup the Google Play Services Library. 我认为问题在于您尚未导入/包含/设置Google Play服务库。 This link will provide you with the steps to follow to achieve it.
该链接将为您提供实现它的步骤。 Next You should also check this page .
下一步您还应该检查此页面 。 It is the updated documentation to include Google Maps on your Project.
这是更新的文档,将Google Maps包含在您的项目中。 You have already done some of them, but it seems that you missed some things too.
您已经完成了其中一些操作,但是似乎您也错过了一些操作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.