質問

In my blackberry application All screen have Ad image at the bottom of the screen (Banner image) .

In Simulator application working fine but when i install app in my Strom 2 (9550) application work fine without Banner image .

i get all Banner image URL from my web service but when i tried to encode image from URL for Display in screen i cant encode image from url so apps not looks good.

see my below code for encode image

connection = (HttpConnection) Connector.open(bannerImage[i], Connector.READ, true);  
                                        inputStream = connection.openInputStream();  
                                        byte[] responseData = new byte[10000];  
                                        int length = 0;  
                                        StringBuffer rawResponse = new StringBuffer();  
                                        while (-1 != (length = inputStream.read(responseData)))  
                                        {  
                                         rawResponse.append(new String(responseData, 0, length));  
                                        }  
                                        int responseCode = connection.getResponseCode();
                                        if (responseCode != HttpConnection.HTTP_OK)  
                                        {  
                                            throw new IOException("HTTP response code: "  
                                                    + responseCode);  
                                        }  
                                        final String result = rawResponse.toString();

                                         byte[] dataArray = result.getBytes();  
                                         encodeImageBitmap = EncodedImage.createEncodedImage(dataArray, 0, dataArray.length);

Thanks in Advance !!

役に立ちましたか?

解決

i got the ans for this . when we use internet using wifi than we have to pass :interface i add the this parameter to my image url and all works fine .

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top