Solved

Android and Google Maps v2

Posted on 2013-06-24
8
437 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
ID: 39275640
0
 

Author Comment

by:BTMExpert
ID: 39285669
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
ID: 39293019
Have you seen this tutorial?
0
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:BTMExpert
ID: 39293055
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
 

Author Comment

by:BTMExpert
ID: 39358939
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
ID: 39395500
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
ID: 39404531
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
ID: 39417752
I figured it out
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Android Box Xibo software 3 132
Apps on mobile : future? 1 108
Windows Tool to Build Android and iOS App 3 94
moto4g plus phone finger print 3 16
Working settings for French ISP Orange "Prêt à Surfer" SIM cards for data connections only. Can't be found anywhere else !
Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
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.
This video demonstrates how to sync Microsoft Exchange Public Folders with smartphones using CodeTwo Exchange Sync and Exchange ActiveSync. To learn more about CodeTwo Exchange Sync and download the free trial, go to: http://www.codetwo.com/excha…

790 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