473,383 Members | 1,859 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

J2ME: Invalid file using Connection.open()

I get an "Invalid file" in my MIDlet when I tried to read a .txt file,
using Connection.open(). My phone is a Nokia 3595 with mMode
technology by AT&T. Here is my source code in my MIDlet:

try
{
// Open File text file
String filename = "http://www.someurl.com/File.txt";
HttpConnection connection =
(HttpConnection)Connector.open(filename);
InputStream inputStream = connection.openInputStream();
connection.close(); // doesn't close input stream!
} catch (){
ex.printStackTrace();
}

It fails when I trying any combination of Connector.open(filename). I
can connect to my server, because that is how I download app. I also,
have txt mime types defined as plain/text. Using the J2ME emulator my
code works.

What to do?
Jul 17 '05 #1
0 2500

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: David | last post by:
¿How can I do this? Some sites need authentication through an username and password. In Internet Explorer you can do it with this URL: http://login:password@server But it doesn't work with J2ME....
2
by: Tommie Nygren | last post by:
For different reasons I am reading an array of bytes from a file in my ..jar-file and from this I want to create a PNG image using Image.createImage(myArray, 0 , myArray.length). I had a...
9
by: Tom John | last post by:
Hi I am storing images in an access database, based on an MSDN article. The code i use to store is as follows: <code> 'Create the command object Dim command As New...
3
by: rpearson | last post by:
I am new to J2ME programming. I finally got a program transferred to my Sony Ericsson w300i phone, installed, and running. I copied the .jar and .jad files to my "Other" folder, and installed it into...
1
by: neveen | last post by:
i want to open and read text file using j2me that can run on mobile 6630 then i want to make button called read that when pressed the data inside text display
0
by: dell05 | last post by:
I doing a mobile development using Java J2me, recently i found out that when using application that use socket connection to server, we must need Internet GPRS connection exist in the phone to make...
0
by: brum2008 | last post by:
Hello! Below is the Netbeans Mobility source code for my application (The application offers SPP service, and then just hangs waiting for a client to connect (using acceptAndOpen()). The other...
3
by: khalid galal | last post by:
Hi, i am having a problem in J2ME. I am using NetBeans 6.5 and my mobile is nokia 6600. I tried to deploy a helloworld applicaton to my device using the CLCD-1.0 and MIDP-2.0 as specified for nokia...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.