11-30-2008 10:17 AM
Hi all,
I need your help to get started. I have downloaded Eclipse with Blackberry plugins. So far I am able to compile and run all the sample examples for the Blackberry. However when I started doing my own application using java.util.Map package, I got the unresolved message 'the import java.util.Map cannot be resolved'.
Do you know what have I done wrong?
Thank you for your help.
11-30-2008 11:53 AM
java.util.Map does not exist on the MicroEdition platform.
See the Maps sample that comes with the JDE for an example of using maps on the RIM platform.
11-30-2008 12:38 PM
Hi RexDoug,
I wonder if we are we talking about the same thing? I was not refering to Maps and Location service.
I have a number of unresolved imports in my code like
import java.util.Map;
import java.util.regex.*;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.BufferedReader;
import java.util.zip.GZIPInputStream;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLEncoder;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.InetAddress;
All of them have unresolved import problem so I thought I must be missing some library configuration. If these package are not available on the blackberry then would you be able to point me to some similar packages that I could use?
Thanks!
11-30-2008 12:53 PM
You are importing from Java SE, not Java ME. None of these exist on the Micro Edition platform.
Are you trying to write for the BlackBerry, or for a desktop?
Again, see the samples that come with the various BlackBerry JDE distributions.
My guess is that you have configured your project as a "standalone desktop" rather than as a "BlackBerry" project.
11-30-2008 12:55 PM - edited 11-30-2008 12:56 PM
Simple Take a look at the Blackberry Api Reference, and you see, that java.net.* is not an included api
http://www.blackberry.com/developers/docs/4.7.0api
example:
instead of using "import java.util.Map;"
try "import net.rim.blackberry.api.maps" (dont know if this is the same...)
and so on.
you should always have a look at the Blackberry Api Refrence, not only on the Sun's one (cause not all apis
are included)
dognose
11-30-2008 01:17 PM
OK, I am trying to port an application from a PC and I guess that is the beginning of my problem. Isn't there a way to get around this problem? I am hoping not to have rewriting a lot of code, please tell me if I am wrong.
I am using the Blackberry project, not standalone desktop.
11-30-2008 01:22 PM
i dont know, if theres a automatic solution,
but i think you have to do the following:
replace the importet apis with the one you should refer in the Blackberry Enviroment.
find errors, where the Api didn't serve the requestet method / Object
then import the right one, or - if theres no one - take other code ^^
f.e. you use the java.io.file api. The object file in BB is reserved for signed aps,
so you have to úse the Fileconnector class, which will result in a bunch of new code... (or sign your
application)
regards,
dognose
11-30-2008 02:04 PM
OK, that explains the problem.
There is no magic when porting from SE to ME. The API support is similar but there are many things that are missing and/or different, especially with regards to networking and the UI library.
I would pull the existing classes over one at a time, researching the API support for each class and changing as needed.
03-17-2010 05:23 AM
redmapleleaf wrote:Hi RexDoug,
I wonder if we are we talking about the same thing? I was not refering to Maps and Location service.
I have a number of unresolved imports in my code like
import java.util.Map;
import java.util.regex.*;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;import java.io.BufferedReader;
import java.util.zip.GZIPInputStream;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLEncoder;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.InetAddress;
All of them have unresolved import problem so I thought I must be missing some library configuration. If these package are not available on the blackberry then would you be able to point me to some similar packages that I could use?
Thanks!
I've a problem with default library BlackBerry JRE, java.net not exist, java.io.BufferedReader to.
??
03-17-2010 07:15 AM
damien-jkr wrote:
I've a problem with default library BlackBerry JRE, java.net not exist, java.io.BufferedReader to.
??
As RexDoug has stated, this is Java ME not Java SE.
There are many resources for learning how to make a network connection (one of the best is the post at the top of the Java Development forum). There may be a lot but go through it slowly and you will find everything you need to know about network connections.