I puzzled over this tutorial for some time but eventually got it to
work. (I'm using version 1.6 of the SDK on Windows Vista.)

I hope the following notes help ... I've put ***!!!*** where I think
the tutorial is incomplete, unclear or incorrect

Part 1

(Step 1)
In New Project ticked Google APIs Platform 1.5 API level 3 (this
caused Min SDK version to be changed from 2 to 3)

In AndroidManifest.xml:
(Step 2)
inserted <uses-library android:name="com.google.android.maps" /> after
</activity>
(Step 3)
inserted <uses-permission android:name="android.permission.INTERNET" /
> after <uses-sdk android:minSdkVersion="3" />

(Step 4)
***!!!***
My main stumbling block getting the Google API key was that I thought
I read that keytool.exe was in the Android tools directory. This left
me stumped for some time. In fact the tool filed is under C:\Program
Files\Java

(Step 5)
Straightforward

(Step 6)
Inserted the whole text between the penultimate { and before the last
{
(i.e. after the OnCreate method but before the end of the HelloMapView
class definition.)

[At this stage I ran the app to check that the map was displayed and
could be panned.]

(Step 7)
Inserted the text in main.xml between the last two lines, i.e. after /
> and before </RelativeLayout>

(Step 8)
Inserted text before the first @Override (before the onCreate method.)

(Step 9)
Inserted these lines inside the onCreate method after the
setContentView statement.
***!!!***
Eclipse put a line through getZoomControls and told me that this
method is deprecated. It suggested a fix, which I chose, to insert an
@SuppressWarnings statement before the @Override statement before the
onCreate method.

[I ran the app again. The zoom control appeared when I clicked on the
map so I could now zoom in and out and pan.]

--------------------
Part 2

(Step 1)
I now encountered my second major problem.
***!!!***
In order to create the new class I right-clicked on HelloMapView in
Package Explorer. After following the instructions Eclipse reported
numerous errors which stemmed from the fact that the new class was
created, not in the com.example.hellomapview package, but in a
separate default package so Eclipse couldn't follow references to the
new class when inserted in the HelloMapView class.
The solution to this problem is either to start by right-clicking on
com.example.hellomapview in the Project Explorer or by typing
com.example.hellomapview in the Package box in the New Java Class
window.

(Step 2)
Inserted the statement after the public class HelloItemizedOverlay ...
line and before the constructor public HelloItmizedOverlay().

***!!!***
Eclipse again came up with a warning about ItemizedOverlay needing to
be parameterized. I again chose the option to add an @SuppressWarnings
statement.

(Step 3)
***!!!***
The next mystery occurred here. The instructions mentioned something
called defaultMarker (probably a Drawable) which was not defined
anywhere. The constructor had a Drawable parameter called arg0. I
proceeded on the basis that defaultMarker was the parameter so changed
arg0 to defaultMarker. I then overwrote the super(arg0) statement as
specified in the instructions.

(Step 4)
I inserted the whole addOverlay method after the HelloItemizedOverlay
constructor and before the createItem method.

(Step 5)
I substituted the return statement from the instructions for the
return statement in the createItem method.
***!!!***
Again the parameter didn't match up so I selected the quick fix to
change i to arg0.

(Step 6)
I substituted the return statement from the instructions for the
return statement in the size() method.

--------------------
Part 3

I saved the Android image file into my Downloads folder then dragged
it from Windows Explorer onto the res_drawable in the Package
Explorer.

(Step 1)
I added these statements aftter the ZoomControls mZoom; statement
before the onCreate method.

(Step 2)
I added these statements after the linearLayout.addView(mZoom);
statement before the end of the onCreate method.
***!!!***
Because capitalisation in the instructions was inconsistent I had to
change itemizedoverlay to itemizedOverlay

(Step 3)
No comment

(Step 4)
***!!!***
The capitalisation of itemizedoverlay again had to be corrected
(twice).

[The program ran!]

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en

Reply via email to