Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 484
  • Last Modified:

Android and Google Maps v2

Does anyone have a working example of google maps working for android?
I'm using tabs to navigate.  I followed the google maps page from google (https://developers.google.com/maps/documentation/android/start) but that doesn't work.  I keep getting an error about my fragment tag in my xml code.

<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"/>

Open in new window


also when i connect to the google play services lib, all my images that i get from the web don't show anymore.
0
BTMExpert
Asked:
BTMExpert
  • 5
  • 2
3 Solutions
 
Molnar IstvánHelpDesk / ProgrammerCommented:
0
 
BTMExpertAuthor Commented:
Those tutorials don't work with the google maps version 2.  Is there a working version of this that uses the Activity class instead of FragmentActivity, Fragment, or MapActivity?
0
 
girionisCommented:
Have you seen this tutorial?
0
Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

 
BTMExpertAuthor Commented:
Yea I've see that.  I've been trying to find some other way to work around this google map issue.  I can get the tutorials to work but in my app I'm using a FragmentPagerAdapter so I can only use Fragments now which I don't see any google maps using that class so I might be in trouble.
0
 
BTMExpertAuthor Commented:
Is this possible?  No Activity, no FragmentActivity.  Just a plain Fragment.  All I get is a blank screen.
0
 
girionisCommented:
Not sure if you can use only a fragment. The way I did it was to declare the google map inside a
com.google.android.maps.MapView

Open in new window

and inside my manifest file I declared a
<uses-library android:name="com.google.android.maps"/>

Open in new window

.
0
 
BTMExpertAuthor Commented:
i figured it out.

<fragment
        android:id="@+id/map"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        class="com.google.android.gms.maps.SupportMapFragment" />

Open in new window


using
MapView m;
	private GoogleMap googleMap;

Open in new window


manifest just like google's example and it works!!!
0
 
BTMExpertAuthor Commented:
I figured it out
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

  • 5
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now