p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Android Application Development Cookbook: 93 Recipes for Building Winning Apps (http://p2p.wrox.com/forumdisplay.php?f=733)
-   -   Download the free updated Chapter 7 on Google Maps for Android v2.0 (http://p2p.wrox.com/showthread.php?t=90087)

weimenglee May 20th, 2013 05:35 AM

Download the free updated Chapter 7 on Google Maps for Android v2.0
 
As "Android Application Development Cookbook: 93 Recipes for Building Winning Apps" goes to press, version 1.0 of the Google Maps for Android was deprecated and replaced by version 2.0. As a service to my readers, I have worked together with Wrox to make the revised Chapter 7 featuring Google Maps for Android v2.0 available for download free of charge.

You can download the chapter here: http://www.wrox.com/WileyCDA/WroxTit...-DOWNLOAD.html.

Wei-Meng Lee,
Technologist & Founder,
Developer Learning Solutions
http://www.Learn2Develop.net
Tel: (65)-9-692-4065

Author of:
* Beginning Android 4 Application Development (Wrox)
* Beginning iOS 5 Application Development (Wrox)
* C# 2008 Programmer's Reference (Wrox)
Join our Facebook fan page now at:
http://www.facebook.com/DeveloperLearningSolutions

mumfie June 8th, 2013 05:59 PM

Source Code Download GoogleMaps_v2.0.zip
 
Quote:

Originally Posted by weimenglee (Post 291430)
You can download the chapter here: http://www.wrox.com/WileyCDA/WroxTit...-DOWNLOAD.html.

Thanks for the updated chapter.
The chapter refers to a source code download GoogleMaps_v2.0.zip
How do I download this file ?

henk July 23rd, 2013 03:14 PM

yeah.. How do we download this file ?
Chapter is no editable - you cannot to copy text.

weimenglee July 23rd, 2013 08:01 PM

Source Code for Google Maps For Android v2.0
 
Hi All:
You can now download the source code for the above at: https://dl.dropboxusercontent.com/u/...eMaps-v2.0.zip.

Thanks!
Wei-Meng Lee

Quote:

Originally Posted by weimenglee (Post 291430)
As "Android Application Development Cookbook: 93 Recipes for Building Winning Apps" goes to press, version 1.0 of the Google Maps for Android was deprecated and replaced by version 2.0. As a service to my readers, I have worked together with Wrox to make the revised Chapter 7 featuring Google Maps for Android v2.0 available for download free of charge.

You can download the chapter here: http://www.wrox.com/WileyCDA/WroxTit...-DOWNLOAD.html.

Wei-Meng Lee,
Technologist & Founder,
Developer Learning Solutions
http://www.Learn2Develop.net
Tel: (65)-9-692-4065

Author of:
* Beginning Android 4 Application Development (Wrox)
* Beginning iOS 5 Application Development (Wrox)
* C# 2008 Programmer's Reference (Wrox)
Join our Facebook fan page now at:
http://www.facebook.com/DeveloperLearningSolutions


NOTiFY March 3rd, 2014 12:31 PM

map.getMyLocation() returns null
 
The new Map example works fine, but one caveat.

If I chose menu_showcurrentlocation from menu it aways returns null

unless I chose menu_getcurrentlocation first.

Despite adding a call to a method the same as what 'menu_getcurrentlocation' does prior.

Any idea?

TIA

wolfenr September 26th, 2014 06:24 AM

Source code for Chapter 7
 
Well thanks for the updated chapter which I have (eventually) got working fine. I say eventually as I spent a day or so fiddling with some obscure bug in my google-play-services.lib which I won't go into.

However, what would have significantly helped the debug process would have been to have different downloadable source codes for each part of the chapter i.e. Google Maps 7.1 through to Google Maps 7.7. The reason I'm asking for this is that the at section 7.1 the code is relatively straightforward but has become much more complex with the supplied source code as it encompasses all the working sections of the chapter.

So if others are experiencing the same issue here is my source code for Section 7.1 which is where you're able to check that you've got your basic API, google-play-services.lib etc. etc. all set up OK...

activity_main.xml
Code:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <fragment
        android:id="@+id/map"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        class="com.google.android.gms.maps.MapFragment"
        android:clickable="true" />

</RelativeLayout>

MainActivity.java
Code:

package com.example.googlemaps;

import android.app.Activity;
import android.os.Bundle;

public class MainActivity extends Activity {

        @Override
        protected void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);
                setContentView(R.layout.activity_main);

        }
}

GoogleMapsManifest
Code:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.googlemaps"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="18" />

    <uses-feature
        android:glEsVersion="0x00020000"
        android:required="true" />

    <permission
        android:name="com.example.googlemaps.permission.MAPS_RECEIVE"
        android:protectionLevel="signature" />

    <uses-permission android:name="com.example.googlemaps.permission.MAPS_RECEIVE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="com.example.googlemaps.MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />
        <meta-data
            android:name="com.google.android.maps.v2.API_KEY"
            android:value="Your API key here...." />
    </application>

</manifest>



All times are GMT -4. The time now is 04:00 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.