02-15-2013 04:57 AM
Hi, i am useing this code to call a link, but not getting any responce..?
can any one help me..?
public class ConnectWebService
{
String _node,_element;
Connection _connectionthread;
String page;
String[] CategoryID_value = null;
String[] Date_value = null;
String str_value;
String str_name ;
String str_vanue ;
String str_start ;
String str_end ;
String[] _start = null;
String[] _end = null;
String[] _name = null;
String[] _venue = null;
public ConnectWebService()
{
}
public void WebServiceConnect(String page)
{
this.page = page;
_connectionthread = new Connection(page);
_connectionthread.start();
}
private class Connection extends Thread
{
String page;
public Connection(String page)
{
super();
this.page = page;
}
public void run()
{
Document doc;
StreamConnection conn;
try
{
String connectLink = "";
if(page.equals("News"))
connectLink = "http://api.search.yahoo.com/WebSearchService/V1/we
System.out.println("Link:: "+connectLink);
conn=(StreamConnection)Connector.open(connectLink)
DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder= docBuilderFactory.newDocumentBuilder();
docBuilder.isValidating();
doc = docBuilder.parse(conn.openInputStream());
doc.getDocumentElement().normalize();
NodeList CatIDlist = null;
CatIDlist = doc.getElementsByTagName("title");
NodeList DateIDlist = null;
DateIDlist = doc.getElementsByTagName("Date");
_node=new String();
_element = new String();
CategoryID_value = new String[CatIDlist.getLength()];
Date_value = new String[DateIDlist.getLength()];
_start = new String[CatIDlist.getLength()];
_end = new String[CatIDlist.getLength()];
_name = new String[CatIDlist.getLength()];
_venue = new String[CatIDlist.getLength()];
Object obj = Application.getEventLock();
for (int i=0;i<CatIDlist.getLength();i++)
{
synchronized(obj)
{
Element myNode = (Element) CatIDlist.item(i);
str_name = myNode.getAttribute("Name");
str_vanue = myNode.getAttribute("Venue");
str_start = myNode.getAttribute("Start_time");
str_end = myNode.getAttribute("End_time");
}
_start[i] = str_start;
_end[i] = str_end;
_name[i] = str_name;
_venue[i] = str_vanue;
/*System.out.println("str_name " + str_name);
System.out.println("str_vanue " + str_vanue);
System.out.println("str_value " + str_start);
System.out.println("str_value " + str_end);*/
}
conn.close();
}
catch (Exception e)
{
System.out.println(e.toString());
}
if(page.equals("Conf"))
{
UiApplication.getUiApplication().invokeLater(new Runnable()
{
public void run()
{
// ConferenceListView clv = new ConferenceListView(_start,_end,_name,_venue);
//UiApplication.getUiApplication().pushScreen(clv)
}
});
}
}
}
}
02-15-2013 05:06 AM
"http://feeds.feedburner.com/snmsiteupdates" this address in geeting problem to call
02-15-2013 05:11 AM
02-15-2013 07:33 AM
HI simon,
i didn't get it..
this web address is correctly working with android .but not working in blackberry. .
02-15-2013 08:26 AM
Just tried this URL:
http://feeds.feedburner.com/snmsiteupdates
on by BB device, got some data with the following error message:
This page contains the following errors:
error on line 486 at column 68:xmlParseEntityRef: no name.
Perhaps you are getting data and the data is not valid?
02-18-2013 03:12 AM