BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 08-02-2008, 10:24 AM   #1 (permalink)
CrackBerry Addict
 
Join Date: May 2005
Location: Golden, CO US
Model: 9700
Carrier: ATT
Posts: 684
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Here's how to start Google Maps with a landmark

Please Login to Remove!

Just FYI...

Basically, you start GoogleMaps with a URL like so...
Code:
http://gmm/x?action=LOCN&a=@latlon:35.0000,-105,0000&title=something&description=something
Code:
int mh = CodeModuleManager.getModuleHandle("GoogleMaps");
if (mh == 0) {
     throw new ApplicationManagerException("GoogleMaps isn't installed");
}
URLEncodedPostData uepd = new URLEncodedPostData(null, false);
uepd.append("action","LOCN");
uepd.append("a", "@latlon:"+l.getLatitude()+","+l.getLongitude());
uepd.append("title", l.getName());
uepd.append("description", l.getDescription());
String[] args = { "http://gmm/x?"+uepd.toString() };
ApplicationDescriptor ad = CodeModuleManager.getApplicationDescriptors(mh)[0];
ApplicationDescriptor ad2 = new ApplicationDescriptor(ad, args);
ApplicationManager.getApplicationManager().runApplication(ad2, true);
There are other actions and other ways to specify location but I'm still sifting through them.

Last edited by RemyJ : 08-02-2008 at 10:26 AM.
Offline  
Old 08-02-2008, 02:55 PM   #2 (permalink)
Thumbs Must Hurt
 
Join Date: Mar 2008
Location: Columbia, MD
Model: 8130
PIN: N/A
Carrier: verizon
Posts: 95
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Nice! I'll have to give it a shot.
Offline  
Old 08-02-2008, 04:53 PM   #3 (permalink)
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
Post Thanks: 20
Thanked 77 Times in 68 Posts
Default

Wirelessly posted (8820)

Thanks! Can't wait to try that out.
__________________
My other Blackberry is a PlayBook.
Offline  
Old 08-06-2008, 10:02 AM   #4 (permalink)
Talking BlackBerry Encyclopedia
 
Join Date: Oct 2006
Model: 7103
Carrier: Verizon
Posts: 259
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

RemyJ,
That's very helpful thanks. Do you know the parameters to use actual addresses instead of lat/long? They don't seem to be the same as the webapp, and I can't find much more on the mobile maps api
Offline  
Old 08-06-2008, 10:18 AM   #5 (permalink)
CrackBerry Addict
 
Join Date: May 2005
Location: Golden, CO US
Model: 9700
Carrier: ATT
Posts: 684
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

I thought it was "action=LOCN&a=someaddress" but I haven't tried it.
Offline  
Old 08-11-2008, 07:19 AM   #6 (permalink)
Thumbs Must Hurt
 
Join Date: Mar 2008
Location: Columbia, MD
Model: 8130
PIN: N/A
Carrier: verizon
Posts: 95
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

FYI - There is a problem if you attempt this with an older version of Google Maps (I was using 2.0.3). It caused my 8130 to lock up and I had to do a battery pull to get it back. The log showed an ArrayIndexOutOfBounds exception in Google Maps. Upgrading to the latest Google Maps (2.2) works fine tho.
Offline  
Old 11-11-2008, 11:01 PM   #7 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

Anybody know where this info came from? I searched the web for hours and can find no references to this data, other than this thread.

This appears to be a one-shot deal, since the GoogleMaps application remains running when the user presses "escape" to exit the application. Subsequent calls to the above code result in a "foreground" request to the running application, which displays the last map only and ignores any command-line parameters. In order to display a 2nd location, the user would have to select "Exit" from the menu, which actually ends the maps application.

Has anyone had any success with Google Maps? I'm looking for a BB Maps replacement for AT&T phones.
Offline  
Old 11-12-2008, 11:19 AM   #8 (permalink)
CrackBerry Addict
 
Join Date: May 2005
Location: Golden, CO US
Model: 9700
Carrier: ATT
Posts: 684
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

It's working correctly for me. If I use the escape key and then start the GM with a new landmark, it clears the last landmark and displays the new one.

This is Google maps 2.2.3 on a Sprint 8830, and 2.2.0 on an AT&T 8820.
Offline  
Old 11-12-2008, 11:57 AM   #9 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

I'm running Google Maps 2.3.2 on a TMO 8320, 4.2.1.180.

Care to divulge the source of your original parameter info?
Offline  
Old 11-12-2008, 12:43 PM   #10 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

On further testing, it looks like Google Maps will never "invoke" to the same location.

Example:
1. launch maps to location A - works OK
2. Launch maps to location B - works OK
3. Launch maps to location A again, this fails (maps remains on location B)

Another example:
1. Launch maps to location A
2. Move the map display to another location
3. Launch maps to Location A again, this fails (maps remains focused where you left it)
Offline  
Old 11-12-2008, 03:45 PM   #11 (permalink)
CrackBerry Addict
 
Join Date: May 2005
Location: Golden, CO US
Model: 9700
Carrier: ATT
Posts: 684
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

I tried both your scenarios and they worked as expected. I'm not sure what to tell you. Maybe GM 2.3.2 has a bug or they changed the invocation string.

I got the info with some google searches. Honestly, I don't remember how.
Offline  
Old 11-12-2008, 04:01 PM   #12 (permalink)
CrackBerry Addict
 
Join Date: May 2005
Location: Golden, CO US
Model: 9700
Carrier: ATT
Posts: 684
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Just downloaded 2.3.2 and am still not seeing the same problem as you are.
Offline  
Old 01-29-2009, 08:31 PM   #13 (permalink)
CrackBerry Addict
 
ashworth's Avatar
 
Join Date: Jun 2006
Location: Ontario, Canada
Model: 9000
OS: 4.6
Carrier: Rogers
Posts: 625
Post Thanks: 0
Thanked 0 Times in 0 Posts
Smile

Do we know if we can add more then GPS location?

Also do we know if we can force the Zoom level, and Satellite view?

If we could that would be GREAT?

I will start Googling and see if I can find anything. If I do I will post it here.

I would like to try to get this working for my GPS Golf Application. I got the single point to work in testing with this but it would be nice to plot all of my GPS points for a single hole on the satellite view.

Thanks,
Ash
__________________
Cheers,
Ash


My BlackBerry GPS Golf Application | Mileage Calculator
Offline  
Old 03-06-2009, 05:35 PM   #14 (permalink)
New Member
 
Join Date: Feb 2008
Model: 7730
PIN: N/A
Carrier: tmobile
Posts: 2
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hey there!

Has anyone found out a little bit more in the meanwhile?
I can use the LOCN sample very good, without any problems. No i wanna start a route, but the parameters from the url or from the mapki wiki site doesnt work...
Replacing the LOCN with ROUT will open the route dialog, but the saddr and daddr seems to be not supported.
A shame for google to not getting a api documentation for mobile apps online...

Bye,
Matthias
Offline  
Old 04-03-2009, 05:08 PM   #15 (permalink)
Knows Where the Search Button Is
 
Join Date: Feb 2008
Model: none
Carrier: sprint
Posts: 24
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Wirelessly posted

Thanks, it works.... but I am having a problem that sometimes the ZOOM is terrible, it shows the address on the map of the whole USA. Is there a way to specify the zoom in the parameters?
Lionscribe
Offline  
Old 04-05-2009, 09:51 AM   #16 (permalink)
Knows Where the Search Button Is
 
Join Date: Nov 2008
Model: Pearl
PIN: N/A
Carrier: T-Mobile
Posts: 22
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Have you tried adding a zoom element with an integer from 1 to 23 in there? Like this

uepd.append("zoom", "10");

I'm trying to use this snippet as well and I'm getting this error:

unreported exception net.rim.device.api.system.ApplicationManagerExcept ion; must be caught or declared to be thrown
ApplicationManager.getApplicationManager().runAppl ication(ad2, true);

Am I missing something here? I copied everything exactly how it was in the beginning of the thread.

EDIT: I just wrapped it in a try catch block and that error went away. Weird.

Last edited by GasBot : 04-05-2009 at 09:52 AM.
Offline  
Old 04-05-2009, 03:07 PM   #17 (permalink)
New Member
 
Join Date: Apr 2009
Model: BOLD
PIN: N/A
Carrier: ATT
Posts: 1
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

It works. Thanks. Has anyone tried to plot multiple locations on the map? I blindedly tried different URL formats without any luck.
Offline  
Old 04-05-2009, 04:05 PM   #18 (permalink)
Knows Where the Search Button Is
 
Join Date: Feb 2008
Model: none
Carrier: sprint
Posts: 24
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by GasBot View Post
I just wrapped it in a try catch block and that error went away. Weird.
No, not weird. Obviously you are coming over from C++. In Java any method that declares itself that it throws an Exception, then the calling function has to catch it or pass it on. Otherwise you will get a compile error.

Did you ever get the zoom problem I mentioned?
Offline  
Old 04-06-2009, 01:00 AM   #19 (permalink)
Knows Where the Search Button Is
 
Join Date: Nov 2008
Model: Pearl
PIN: N/A
Carrier: T-Mobile
Posts: 22
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by lionscribe View Post
No, not weird. Obviously you are coming over from C++. In Java any method that declares itself that it throws an Exception, then the calling function has to catch it or pass it on. Otherwise you will get a compile error.

Did you ever get the zoom problem I mentioned?
Nope, I haven't tried it yet though so I'm sure once I get there, I'll probably have the same problem.
Offline  
Old 04-27-2009, 07:59 AM   #20 (permalink)
New Member
 
Join Date: Feb 2009
Model: 9000
PIN: N/A
Carrier: Project Trainee
Posts: 1
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi to all

can i plot multiple points on google maps?
For single location it is working fine.

Thanks
Vaikunth

Last edited by vaikunth : 04-27-2009 at 08:33 AM.
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.