Reputation: 187
how can i import this packages (Libraries) in my android application
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
<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
<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
i can't understand the full meaning of this error 'coz i am new in android so please guys help me out here. thankx in advance
Upvotes: 0
Views: 1210
Reputation: 458
As to your description
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapView;
This is not in the right track, which should be
import com.google.android.gms.maps.MapView;
import com.google.android.gms.maps.MapFragment;
Just like:
Upvotes: 1
Reputation: 3854
I think the problem is that you haven't import/include/setup the Google Play Services Library. 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. You have already done some of them, but it seems that you missed some things too.
Upvotes: 0