Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Java Micro Edition
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Tim Cooke
Campbell Ritchie
paul wheaton
Ron McLeod
Devaka Cooray
Sheriffs:
Jeanne Boyarsky
Liutauras Vilda
Paul Clapham
Saloon Keepers:
Tim Holloway
Carey Brown
Piet Souris
Bartenders:
Forum:
Java Micro Edition
help needed open a website in mobile
lokesh jain
Ranch Hand
Posts: 58
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi all,
I am Lokesh. I want to open any website on Mobile using J2ME. I have written code for that. However I am not getting the result ( website is not opening). Please help me.
formInternet = new Form("Internet"); Browse = new TextField("Enter Website Address", "", 25, 0); String Url = Browse.getString(); try{ try { htc = (HttpConnection) Connector.open(Url); is = htc.openInputStream(); int len = (int)htc.getLength(); int ch; while ((ch = is.read()) != -1) { sb.append((char)ch); } }catch (IOException ex) { ex.printStackTrace(); } }finally { if (is != null) { try { is.close(); } catch (IOException ex) { ex.printStackTrace(); } } if (htc != null) { try { htc.close(); } catch (IOException ex) { ex.printStackTrace(); } }
thanks in advance
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
httpConnection limted?
Problem using http post over j2me
MY server just hanged
InputStream to fileReader
Need help with EOFException error
More...