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
Posts: 255
Registered: ‎05-03-2012
My Device: 9930
My Carrier: Vodafone
Accepted Solution

App running slow on Edge

[ Edited ]

My application using os 5 runs fine on wifi but it takes too much time to load when i run it on Blackberry edge network. How should i solve this problme?

Here is my code to connect to the server:

public static InputStream getInputStream(String url)
{
InputStream _is = null;
HttpConnection httpConnection = null;
try
{
ConnectionFactory factory = null;
ConnectionDescriptor descriptor = null;
factory = new ConnectionFactory();
descriptor = factory.getConnection(url);
if (descriptor != null)
httpConnection = (HttpConnection) descriptor.getConnection();
else
httpConnection = (HttpConnection) Connector.open(url);

final int iResponseCode = httpConnection.getResponseCode();
if(iResponseCode == HttpConnection.HTTP_OK)
_is = httpConnection.openInputStream();
else
return null;

}
catch (Exception e)
{
return null;
}
return _is;
}

Developer
Posts: 16,985
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: App running slow on Edge

do you execute the networking on a separate thread?
edge is slow, nothing to do about that, but your application should start as fast as ever with blocking operations done asynchronically.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 255
Registered: ‎05-03-2012
My Device: 9930
My Carrier: Vodafone

Re: App running slow on Edge

[ Edited ]

Yes it is in separate thread. I am using DOM parser to get the data. On EDGE, data is fluctuating. Sometimes i am gettng the data..sometimes not. What can be the reasons behind it? Is there any different condtion to be handled for slow network?

BlackBerry Development Advisor
Posts: 15,694
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: App running slow on Edge

What behaviour do you see when you don't get the data?  Is some exception thrown?

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Developer
Posts: 255
Registered: ‎05-03-2012
My Device: 9930
My Carrier: Vodafone

Re: App running slow on Edge

connection is fluctuated. on 1 screen connection is done. but while navigating to second scr

een in 1st call i m getting data bt on second call it takes too much time to connect and after smtime connection is lost.
Developer
Posts: 255
Registered: ‎05-03-2012
My Device: 9930
My Carrier: Vodafone

Re: App running slow on Edge

my HttpUtils class was static. i dont know why i removed static n my app is running fine.....
Developer
Posts: 255
Registered: ‎05-03-2012
My Device: 9930
My Carrier: Vodafone

Re: App running slow on Edge

[ Edited ]

Actually its not running fine. Its running more fast. Still have a problem. App runs on wi-fi fine. But between screen navigations i am facing network issue. My first screen consists of list with images and text while second one has lot of labels,couple of ObjectChoicefields.

1.I click on row of list of 1st screen n navigate to second screen. 

2.I press back and press refresh button(its in my app to refresh current screen).

3.After getting data(not everytime) i navigate to 2nd screen..this time connection is lost.

Developer
Posts: 255
Registered: ‎05-03-2012
My Device: 9930
My Carrier: Vodafone

Re: App running slow on Edge

Please someone help. I am stuck with this last 4 5 days.
Developer
Posts: 16,985
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: App running slow on Edge

i would suggest that you check if you clean up your connections properly.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 255
Registered: ‎05-03-2012
My Device: 9930
My Carrier: Vodafone

Re: App running slow on Edge

How to cleanup connections? Does it mean that i should close my connections after its use is over for a particular call?