Solved

Android and Google Maps v2

Posted on 2013-06-24
8
406 Views
Last Modified: 2013-08-18
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
Comment
Question by:BTMExpert
  • 5
  • 2
8 Comments
 
LVL 13

Assisted Solution

by:Molnar István
Molnar István earned 250 total points
Comment Utility
0
 

Author Comment

by:BTMExpert
Comment Utility
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
 
LVL 35

Expert Comment

by:girionis
Comment Utility
Have you seen this tutorial?
0
 

Author Comment

by:BTMExpert
Comment Utility
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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:BTMExpert
Comment Utility
Is this possible?  No Activity, no FragmentActivity.  Just a plain Fragment.  All I get is a blank screen.
0
 
LVL 35

Assisted Solution

by:girionis
girionis earned 250 total points
Comment Utility
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
 

Accepted Solution

by:
BTMExpert earned 0 total points
Comment Utility
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
 

Author Closing Comment

by:BTMExpert
Comment Utility
I figured it out
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
speed up...android. 9 126
Connect Samsung S5 to PC via USB 13 65
Emulate the Android platform on PC 4 35
Migrating From Parse To Back4App 7 69
A short article about a problem I had getting the GPS LocationListener working.
The case of the missing phone talks about the way a small electronic gadget (the mobile phone) has penetrated into our lives and has made us addicted to it.
This video is in connection to the article "The case of a missing mobile phone (https://www.experts-exchange.com/articles/28474/The-Case-of-a-Missing-Mobile-Phone.html)". It will help one to understand clearly the steps to track a lost android phone.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now