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
developer_aman_arora
Posts: 354
Registered: ‎06-05-2013
My Device: Blackberry Z10
My Carrier: Vodafone

Re: Static map API

yes he is not adding ";deviceside=false;ConnectionType=< >" at the end of url
Please use plain text.
Contributor
sparon
Posts: 45
Registered: ‎07-09-2013
My Device: Blackberry 9220
My Carrier: Airtel

Re: Static map API

I am using below that code.I got class cast exception....Pls suggest me how to view google map in blackberry application?

 

 

httpConn =(HttpsConnection)Connector.open("http://maps.googleapis.com/maps/api/staticmap?center=New+York,NY&zoom=13&size=100x100&key=AIzaSyCZ69... );
int rc = httpConn.getResponseCode();
Dialog.alert("response:" + rc );
if (rc != HttpsConnection.HTTP_OK) {
Dialog.alert("HTTP response code: " + rc);
}
InputStream input = httpConn.openInputStream();
byte[] dataArray = IOUtilities.streamToBytes(input);
googleImage = Bitmap.createBitmapFromBytes(dataArray, 0, -1, 1);
BitmapField bmf= new BitmapField(googleImage);
add(bmf);
}
catch (IOException e)
{
e.printStackTrace();
}

Please use plain text.
Contributor
sparon
Posts: 45
Registered: ‎07-09-2013
My Device: Blackberry 9220
My Carrier: Airtel

Re: Static map API

I am using this code .But I got Application registery error.Please tell me how to solve that?

 

 

String a="http://maps.googleapis.com/maps/api/staticmap?center=New+York,NY&zoom=13&size=100x100&key=AIzaSyCZ69...
VerticalFieldManager manager = new VerticalFieldManager(VerticalFieldManager.VERTICAL_SCROLL);
BrowserField browserField = new BrowserField();
browserField.requestContent(a);
manager.add(browserField);
add(manager);

Please use plain text.
Developer
developer_aman_arora
Posts: 354
Registered: ‎06-05-2013
My Device: Blackberry Z10
My Carrier: Vodafone

Re: Static map API

at end of url add this ;deviceside=false
Please use plain text.
Contributor
sukanyak
Posts: 21
Registered: ‎07-10-2013
My Device: Blackberry simlator 9220
My Carrier: Airtel

Re: Static map API

Its not working....

Please use plain text.
Contributor
sparon
Posts: 45
Registered: ‎07-09-2013
My Device: Blackberry 9220
My Carrier: Airtel

Re: Static map API

Am using that..that time also is not working

Please use plain text.
Developer
developer_aman_arora
Posts: 354
Registered: ‎06-05-2013
My Device: Blackberry Z10
My Carrier: Vodafone

Re: Static map API

[ Edited ]

add ;deviceside=false;ConnectionType={Removed}

 

 

Please use plain text.
Developer
developer_aman_arora
Posts: 354
Registered: ‎06-05-2013
My Device: Blackberry Z10
My Carrier: Vodafone

Re: Static map API

[ Edited ]

use hyphen ( -) instead of ( _ ) in {Removed}

 

 

Please use plain text.
Developer
peter_strange
Posts: 19,603
Registered: ‎07-14-2008
My Device: Not Specified

Re: Static map API

[ Edited ]

Just to coonfirm, to use BIS-B you need to have been approved by BlackBerry.  One of the conditions of approval is that you do not publically disclose how you use BIS-B. 

 

There is more here:

http://developer.blackberry.com/java/documentation/intro_networking_1984362_11.html

 

To get access to BIS-B, you can apply for PUSH, as documented in the page above. 

 

Now getting back to this problem.

 

@developer_aman_arora.  Not trying to be rude, but I suggest you stop providing "quick fix" solutions to these (and other) questions and instead concentrate on resolving your own problems, such as this one:

http://supportforums.blackberry.com/t5/Java-Development/Encryption-Decryption-in-Blackberry/m-p/2462...

 

@sparon - there are no quick fix solutions to networking on the BlackBerry.  You need to do some research and understand the problem yourself.  Don't cut and paste in other people's code - in this area it will go wrong and it will cause you grief.  There is a lot of very dodgy BlackBerry networking code out there that will only work in specific circumstances. 

 

See my previous post for how I recommend you proceed. 

Please use plain text.