Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
saravanakumaran
Posts: 139
Registered: ‎05-25-2009
My Device: Not Specified

How to use Google Map in Blackberry Application?

Dear Friends,

 

                Can anyone tell me how to use Google maps instead of Blackberry maps in blackberry application developement.If u have any idea about this pls share with me.If possible provide me some code snippet.

 

regards,

s.kumaran.

Developer
amardeepjaiman
Posts: 293
Registered: ‎02-25-2009
My Device: Not Specified

Re: How to use Google Map in Blackberry Application?

As far as my knowledge concerned, you can not .may be i  am wrong here.

 

if anyone else know, than suggest the way.

 

~Amardeep

www.impetus.com

New Developer
rodrifox
Posts: 35
Registered: ‎12-22-2009
My Device: Bold 9700

Re: How to use Google Map in Blackberry Application?

I was wondering if you could make this work with the BB JDK 5? Or did you just use the BlackBerry maps? Thanks!

-------------
Rodrigo Bravo
http://www.wilkonit.com
Developer
RexDoug
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: How to use Google Map in Blackberry Application?

[ Edited ]

You *can* launch google maps form a Blackberry app.

 

Please search the forum - I have posted this code on several occasions.

 

 

Edit: here is a good hack with source code:

 

http://www.blackberryforums.com/developer-forum/143263-heres-how-start-google-maps-landmark.html?hig...

 

Regular Contributor
amrinder_singh_003
Posts: 97
Registered: ‎09-21-2010
My Device: 8900

Re: How to use Google Map in Blackberry Application?

this code is not working 

 

only blank screen is coming

 

regards 

Amrinder 

Trusted Contributor
govind23
Posts: 112
Registered: ‎05-20-2011
My Device: 9800

Re: How to use Google Map in Blackberry Application?

Before running this you need to download googlemaps for blackberry and should be install
package com.hiddenbrains.startup;
import net.rim.blackberry.api.browser.URLEncodedPostData;
import net.rim.device.api.system.ApplicationDescriptor;
import net.rim.device.api.system.ApplicationManager;
import net.rim.device.api.system.ApplicationManagerException;
import net.rim.device.api.system.Bitmap;
import net.rim.device.api.system.CodeModuleManager;
import net.rim.device.api.system.Display;
import net.rim.device.api.ui.Field;
import net.rim.device.api.ui.UiApplication;
import net.rim.device.api.ui.component.BitmapField;
import net.rim.device.api.ui.component.SeparatorField;
import net.rim.device.api.ui.container.HorizontalFieldManager;
import net.rim.device.api.ui.container.MainScreen;
import net.rim.device.api.ui.container.VerticalFieldManager;
public class NewsTitlesScreen extends MainScreen{
private Bitmap img,img1,img2;
private BitmapField img_field1,img_field2;
public NewsTitlesScreen(){
VerticalFieldManager main_mgr=new VerticalFieldManager(VERTICAL_SCROLL|VERTICAL_SCROLLBAR){
protected void sublayout(int maxWidth, int maxHeight) {
super.sublayout(Display.getWidth(),Display.getHeight());
setExtent(Display.getWidth(),Display.getHeight());
}
};
 
int mh = CodeModuleManager.getModuleHandle("GoogleMaps");
if (mh == 0) {
    try {
throw new ApplicationManagerException("GoogleMaps isn't installed");
} catch (ApplicationManagerException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
URLEncodedPostData uepd = new URLEncodedPostData(null, false);
uepd.append("action","LOCN");
uepd.append("a", "@latlon:35.0000,-105,0000");
uepd.append("title", "govind");
uepd.append("description", "hellooooo");
String[] args = { "http://gmm/x?"+uepd.toString() };
ApplicationDescriptor ad = CodeModuleManager.getApplicationDescriptors(mh)[0];
ApplicationDescriptor ad2 = new ApplicationDescriptor(ad, args);
try {
ApplicationManager.getApplicationManager().runApplication(ad2, true);
} catch (ApplicationManagerException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
// img=Bitmap.getBitmapResource("orange.gif");
// img1=new Bitmap(60, 60);
// img.scaleInto(img1, Bitmap.FILTER_LANCZOS);
// for(int i=0;i<10;i++){
// VerticalFieldManager sub_mgr1=new VerticalFieldManager();
//
// HorizontalFieldManager hr_mgr=new HorizontalFieldManager();
// img_field1=new BitmapField(img1);
// hr_mgr.add(img_field1);
// sub_mgr1.add(hr_mgr);
// sub_mgr1.add(new SeparatorField(Field.FOCUSABLE));
// main_mgr.add(sub_mgr1);
// }
add(main_mgr);
}
}
Trusted Contributor
avi_yach
Posts: 184
Registered: ‎11-26-2010
My Device: Not Specified

Re: How to use Google Map in Blackberry Application?

I found this link very usefull and please check it if it would be of any use for you

 

http://supportforums.blackberry.com/t5/Java-Development/Reg-Invoking-maps-in-blackberry/m-p/1019495/...

 

 

A Y