FileConnection API JSR 75
I am trying this api on the WTK emulator and ther is an issue with show the valid roots and dir and files inside the roots.
In the emulator there is one default root, this one:
"/<toolkit>/appdb/DefaultColorPhone/filesystem/root1/"
inside this root, there is one dir and one file, if run my code it shows well the root and its content. But if i create manually a dir or a file in the root, those arent show.
I havent do a test on a real device but in the emulator it didnt work.
What could be the problem ?
this is my code:
try {
FileConnection fc = (FileConnection)
Connector.open("file:///root1/");
System.out.println
("List of files and directories under root1:");
Enumeration filelist = fc.list("*", true);
while(filelist.hasMoreElements()) {
String fileName = (String) filelist.nextElement();
fc = (FileConnection)
Connector.open("file:///root1/" + fileName);
if(fc.isDirectory()) {
System.out.println("\tDirectory Name: " + fileName);
} else {
System.out.println
("\tFile Name: " + fileName +
"\tSize: "+fc.fileSize());
fc.close();
} catch (IOException ioe) {
System.out.println(ioe.getMessage());
}Thanx
I think you should use netbeans, open Sample Project for J2ME (PDADemo) and build it to jar file, then copy it to your mobile. Run it. You will see the path, you can config the path to your app.
Hope this help!
Similar Messages
-
How to Use the Scalable Vector Graphics API (JSR 226)
im doin an Application with Maps and locations...
i need 2 use the Scalable Vector Graphics API (JSR 226)..
can anyone plz guide me to get it and use the API.. Im using netBeans 5.0
it will be great help :)
Regards
Muhammedh aka MNMThanks Rohan :)
i did read some stuff from the URLs u gav me :)
and I manage 2 solve the prob i had :) (Thank God)
1. downloaded latest version of netBeans (5.5)
2. Java SDK 6 :D...
3. the key thing: Wireless tool kit for CLDC 2.5 Beta
now when u create a project make sure u set the above given tool kit :)
when u set it.. u get an option 2 select the APIs frm a List.. Check on SVG API :)...
Other APIs Such as,
* wireless Messaging API
* Location API
and many more...
Cheers 2 Every1 :)
regards
Muhammedh -
Using fileConnection API on j9
Hi,
I am trying to use fileconnection API on IBM j9 but there is no success. I have successfully installed WSDD on my PC and j9 on PDA (WM 2003 SE). Then I updated to include optional package of PDAP-FC for both wm2003 and windows x86 as mentioned. After that I copied fileconn.dll and fileconn.jar to right place on PDA.
But still now, on my PC, as soon as I type javax.microedition.io.file, wsdd start showing at as an error. Could anyone, who has an experience of using FCAPI, please throw some light on it.
Regards,
pushHi Dan,
Thanks for posting!
According to error message, the process of audience may be occurred something wrong on azure platform. And consider to suspicious nature of the request, I suggest you could try oath to verify your account. So you could try this method supported by google
(https://developers.google.com/gdata/docs/auth/oauth?csw=1 ). Also, I think this same thread may helpful, please refer to it (http://stackoverflow.com/questions/7471024/accessing-google-docs-with-gdata).
Regards,
Will
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Use Location API (JSR 179)
Hello everybody!
I'm studying JavaME and its APIs, especially the API JSR 179 (Location). Until I found tutorials on the Internet, though, as I am beginner, I can not locate me in code.
The code was to take pictures, and imbuing it the geographical location of latitude and longitude, and write to a specific folder. However, only that the program captures the Latitude, Longitude and Altitude, and throw in the display.
I ask your help to solve this problem.
Thanks
PS = To determine the speed, the API Mobility would be better, right?following tutorial will help you.
http://wiki.forum.nokia.com/index.php/Mini_App_With_Location_API_and_Google_Maps_in_Java_ME
Edited by: 795848 on Nov 20, 2010 1:15 AM -
JDBC API ( JSR 169 ) Implementation for accessing oracle lite database
We are developing an application using IBM J9 (CDC and Foundation Profile) on Pocket PC 2003 environment with SWT as the front end development. We are using Oracle Lite 9i as the Client database.
We have sucessfully installed Oracle Lite and was able to create tables in the database.. however we could not find the JDBC API (java.sql and javax.sql packages which is JSR 169 JDBC 2.0/3.0) inorder to load the JDBC driver(OLITE40.jar) and access the oracle Lite Database on Pocket PC.
IBM J9 Micro Environement does not have this support.
I am wondering if Oracle provides this implementation.
If not is there a get around.
the client database is crucial to the application and i would really appreciate an answer to our problem.Check out
http://groups.google.com/groups?hl=en&lr=&threadm=cjgl3g%248hhm%241%40news.boulder.ibm.com&prev=/groups%3Fhl%3Den%26lr%3D%26ie%3DUTF-8%26group%3Dibm.software.websphere.studio.device-developer
I have had the same issue before.
Regards,
Ron -
Using JSR 75 FileConn API + JSR 135 to display an image
Hi Guys:
How would one select an image file (let's say JPEG) from a folder that is exposed on a device and then resize and display on screen using a midlet.
Do you read the file using JSR 75 FileConn API and the transform it using JSR 135 and the display?
Also can reading a large or high res image file cause an out of memory exception?
Thanks in advance!I don't know if your already found a solution.
You are correct about the fact that you need JSR75 to load the file. Then to show it on screen you can use the Image class and use a form or a canvas to show it. What I don't know is how to resize it to fit the screen. And also I guess you can't open large files with it.
To load the image i use this code:
public Image image;
DataInputStream is;
is = new DataInputStream(Connector.openDataInputStream(fileName));
image=Image.createImage(is);Take into account that every time a file is opened, a security warning will appear asking for permission. As far as I know it can't be avoided unless you sign your application with a certificate.
Is it useful for you?
Marc -
Portlet API: JSR 168 / 286 vs Vendor Extensions
Currently evaluating Websphere 5.1 vs WebLogic 8.1 Portal software.
It seems like both IBM and BEA push you towards using their Portal extensions as "value add" features. I am really interested in sticking to JSR 168 for portability.
Does anyone have any experience with these tools developing JSR 168? I would appreciate your observations about using the vendor extensions vs JSR 168 support in these tools. Please add any comments on other portal software you have had success with.
Any idea when will JSR 286 come out with final spec?
Message was edited by:
java@financesorry.Correction.I am using Oracle portal 10.1.4 .
-Vid- -
Deployment API (JSR-88)
I'm trying to code a client to deploy a Web app using the Deployment API implementation in Sun Java System Application Server 8.1.
I'm able to get an object returned by DeploymentFactoryManager.getDeploymentManaget(...), but, when I try to invoke getTargets() on this DeploymentManager object I receive IllegalStateException indicating a disconnected state.
Isn't getDeploymentManager() supposed to return a connected deployment manager?
And this is the full exception message::
java.lang.IllegalStateException: access denied (javax.management.MBeanPermission com.sun.appserv.management.config.DomainConfig#getStandaloneServerConfigObjectN ameMap[amx:j2eeType=X-DomainConfig,name=na] invoke)Which factory are you using ? The one present in the manifest of install_dir/lib/deployment/sun-as-jsr88-dm.jar ? What uri, user and password are you using to get deployment manager ? Here is some code that works for me :
try {
File file = new File(System.getProperty("installRoot")
+ File.separator+ "lib" + File.separator + "deployment"
+ File.separator + "sun-as-jsr88-dm.jar");
Manifest mf = new java.util.jar.JarFile(file).getManifest();
String className = mf.getMainAttributes().getValue("J2EE-DeploymentFactory-Implementation-Class");
URL[] urls = new URL[]{file.toURL()};
URLClassLoader urlClassLoader = new java.net.URLClassLoader(urls, getClass().getClassLoader());
Class factory = null;
try {
factory=urlClassLoader.loadClass(className);
} catch (ClassNotFoundException cnfe) {
cnfe.printStackTrace();
Object df = null;
try {
df = factory.newInstance();
} catch (Exception ie) {
ie.printStackTrace();
if (df instanceof DeploymentFactory) {
DeploymentFactoryManager.getInstance().registerDeploymentFactory((DeploymentFactory) df);
} else {
System.exit(-1);
DeploymentManager dm = DeploymentFactoryManager.getInstance().getDeploymentManager("deployer:Sun:AppServer::localhost:4848",
"admin", "admin123");
Target[] allTargets = dm.getTargets();
} catch (Exception ex) {
.. -
FileConnection API problem ......
I tried this example on emulator and it gives the expected output.
But when i tried this on N70 and 6230i ...it shows only the root directories . And it does not show the file's contents. Can u pls tell me what the problem might be ?
(when i ran this on emulator i changed the : "c:/" to "foldername")
package test_file;
import javax.microedition.lcdui.*;
import javax.microedition.io.file.*;
import javax.microedition.io.*;
import java.io.*;
import java.util.*;
public class Displayable2
extends Form
implements CommandListener {
StringItem stringItem1;
String root = "";
StringBuffer sb = new StringBuffer();
StringItem stringItem2;
byte by[] = null;
/** Constructor */
public Displayable2() {
super("Displayable Title");
try {
jbInit();
catch (Exception e) {
e.printStackTrace();
/**Component initialization*/
private void jbInit() throws Exception {
// Set up this Displayable to listen to command events
stringItem1 = new StringItem("", "");
stringItem2 = new StringItem("", "");
stringItem1.setText("");
setCommandListener(this);
// add the Exit command
addCommand(new Command("Exit", Command.EXIT, 1));
this.append(stringItem1);
this.append(stringItem2);
getRoots();
createFile();
showFile("mynewfile.txt");
private void getRoots() {
try {
Enumeration drives = FileSystemRegistry.listRoots();
System.out.println("The valid roots found are: ");
while (drives.hasMoreElements()) {
root = (String) drives.nextElement();
sb.append(root + "\n");
stringItem1.setText(sb.toString());
System.out.println("\t" + root);
catch (Exception ex) {
System.out.println(ex);
public void createFile() {
try {
FileConnection filecon = (FileConnection)
Connector.open("file:///C:/mynewfile.txt");
// Always check whether the file or directory exists.
// Create the file if it doesn't exist.
if (!filecon.exists()) {
filecon.create();
OutputStream is = filecon.openOutputStream();
String s = new String("we are the best kept secret of the universe,our mission is to monitor extra terrestrial activities onearth");
byte b[] = s.getBytes();
by = s.getBytes();
is.write(b, 0, b.length);
filecon.close();
catch (Exception ioe) {
System.out.println("EE "+ioe);
public void showFile(String fileName) {
try {
FileConnection fc = (FileConnection)
Connector.open("file:///C:/" + fileName);
if (!fc.exists()) {
throw new IOException("File does not exist");
InputStream is = fc.openInputStream();
byte b[] = by;
int length = is.read(b, 0, b.length);
stringItem2.setText("Content of " + fileName + ": " +
new String(b, 0, length));
System.out.println
("Content of " + fileName + ": " + new String(b, 0, length));
catch (Exception e) {
/**Handle command events*/
public void commandAction(Command command, Displayable displayable) {
/** @todo Add command handling code */
}hi,
i too got this same security exception.and i followed this below procedure. using this u can get rid of this security exception in the emulator.
C:\WTK22\wtklib\devices\Nokia_Prototype_SDK_2_0\devices\
Prototype_2_0_S60_MIDP_Emulator\bin\security_config.xml
Within the <function name="Read User Data Access"> tag and the <function name="Write User Data Access"> tag you will find a setting that says "untrusted mode=0". Change it to "untrusted mode=4".
i think to get rid of this pbm in mobile better dont use self signed certificate.without signing the midlet nothing happens other than everytime the permission for reading the file .
do u have any idea regarding file saving in nokia 6255 -
CHAPI Content Handler Api JSR-211
Hi,
I'm searching to use chapi and i have build 2 midlet, the first do the invocation specifing the url of a servlet on a web server that will return a png image. The second midlet is registered for handling png images and it should handle the invocation of the first midlet for download and show png image.
The problem is when the fisrt midlet make the invocation and call the notifyDestroyed method because the AMS don't pass the control to the second midlet automatically. If then i run the second midlet manually it handle correctly the invocation.
If someone knows how resolve this problem automatically please write me.
Thank'sI'm having the same problem with WTK 2.5.2.
Could you elaborate on how to get the content handler running before invoking it?
Isn't that the job of the AMS, so that the invoking application does not need to have knowledge/responsibility of whichever application is to handle a certain content? According to the spec, the AMS should queue the invocation, invoke it on a content handler, then after it's done, re-start the invoking application to return any response if required.
Anyone has any success with this?
Thanks -
Mobile list for fileconnection
hi friends...
I am using fileConnection Api in my application. So I want to know the mobile phones which are supported by JSR 75 (FileConnection) Api.
Please help me to know that.visit this link:
http://developer.sonyericsson.com/wiki/display/leftnav/The+FileConnection+API+(JSR+75) -
How would you access resources, such as media (mp3) stored on the device (flash card), list available such resources, download and save (rather than to the record store) etc.?
A little summery for future ref:
Intro
"The FileConnection API [JSR-075] gives access to file systems and support for file-oriented operations. The API assumes the existence of a file system in the device that can be located, for example, in removable memory cards, flash memory, or other types of persistent storage. This API is not meant to be a replacement for the Record Management System (RMS) but rather a complement to it allowing MIDlets to interact with native applications. For example, a MIDlet could access and manipulate images previously captured by a native application using a built-in digital camera. Those images are commonly stored in the device�s memory and with the FileConnection API they are made accessible to CLDC/CDC1 applications."
"The API is very simple containing just one class, two interfaces, and two exceptions. The most important part is the FileConnection interface, which extends the Connection interface and gives access to directories and individual files. Implementations of FileConnection are created using the Connector.open() method. The argument of the open() method is a URL with the format file://<host>/<path>, as defined in RFC 1738 [RFC 1738] and RFC 2396 [RFC 2396], where host is normally left empty and path starts with the root of the file system down to a particular file or directory. An example of a typical file URL in a Symbian device looks like the following: file:///C:/Nokia/Images/Image(001).jpg The roots of the file system are device-specific and they don�t necessarily correspond to physical memory units since they are logically defined by the device�s operating system."
"Since the FileConnection API is an optional extension, a system property has been added to indicate the API�s presence. The microedition.io.file.FileConnection.version system property contains the implemented version of the API. Currently this property should have the value 1.0 to indicate the current status of the API or null if the API is not present."
supporting environments:
IBM's J9, PalmOS 5, Windows Mobile 2003.
Some mobile phones supporting FileConnection are listed here: http://www.benhui.net/modules.php?name=Midp2Phones
Links:
http://www-128.ibm.com/developerworks/library/j-pda-op/
http://jcp.org/aboutJava/communityprocess/final/jsr075/index.html
http://itpapers.techrepublic.com/abstract.aspx?docid=104503
http://forum.java.sun.com/thread.jspa?threadID=524143&tstart=210 -
Does anyone know if Netweaver supports the J2EE Deployment API (JSR-88)?
I'm trying to figure out a programmatic way of deploying/controlling my application on Netweaver in the same way I could on Tomcat or WebSphere.
Thanks,
AnilHi,
There is no official statement about when this release will be available.
Keep an eye on SDN and the other SAP information portals about that.
Regards,
Mariela -
Hello,
I'm currently writing a MIDP application which uses some
optional packages, namely JSR 75 (FileConnection API) and
JSR 82 (Bluetooth API).
I'm aware you can test the presence of those APIs with
<code>
System.getProperty("microedition.io.file.FileConnection.version")
</code>
and since there is no System property to indicate JSR 82 presence
you can try to load a class from that package:
<code>
try{Class c = Class.forName("javax.bluetooth.DiscoveryAgent")} catch (ClassNotFoundException e) {}
</code>
Now that I know that JSR 82 is present, I could use a btspp:// connection to communicate with a server. If JSR 82 not present,
then I would use a socket:// connection.
But my code fails, if JSR 82 is not present. It's somewhat strange --
I can use the LocalDevice and DiscoveryAgent classes in my code
when I make sure they are not reached if JSR 82 not present (see code below). I Think this is only possible, because the KVM itself doesn't verify if all classes as this is done in a preverification process. So using these classes is not a clean solution, but I have no other idea right now.
<code>
if (jsr82present) {
//do device discovery
LocalDevice local = LocalDevice.getLocalDevice();
local.setDiscoverable(DiscoveryAgent.GIAC);
DiscoveryAgent agent = local.getDiscoveryAgent();
//fails in the next line, although this code is
//never reached when jsr 82 not present
agent.startInquiry(DiscoveryAgent.GIAC, new DiscoveryListener(){
//interface methods here
} else {
//establish socket connection
</code>
My code fails as soon as I use "new" to instantiate a DiscoveryListener (which is also part of JSR 82) -- even if the instance will never be created, since a device with no JSR 82 support would never reach this code. See my problem now?
Does this mean I have to write two different applications, one for bluetooth communication and the other one for sockets?
I've tried to get around this with dynamic classloading, but didn't work either:
<code>
Class c = Class.forName("mypckg.MyDiscoverListener");
c.newInstance(); //<-- fails here
</code>
Has anyone an idea how to write one application for different devices with different optional packages installed, which uses all functionality
the device offers through it's optional packages?
Or is it just impossible?
Regards,
Torbentry this link
http://www.jcp.org/aboutJava/communityprocess/final/jsr082/ -
JSR 205 support in blackberry device
Please tell me the Blackberry device model which support JSR 205 MMS?
Here's how i figure that out.
i run the following code on the device itself
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
public class SystemProperties extends MIDlet implements CommandListener {
private static final String[] SYSPROPLISTS = {
"CLDC&MIDP", "Optional packages", "MMAPI", "Bluetooth API",
"FileConnection API", "WMA", "SATSA", "Other"};
private static final String[] CLDC_MIDPPROPS = {
"microedition.profiles", "microedition.configuration", "microedition.locale",
"microedition.platform", "microedition.encoding", "microedition.commports",
"microedition.hostname", "microedition.jtwi.version"};
private static final String[] OPT_SYSPROPS = {
"microedition.media.version", "microedition.pim.version",
"microedition.io.file.FileConnection.version", "microedition.m3g.version",
"microedition.location.version", "microedition.global.version",
"microedition.chapi.version", "microedition.sip.version"};
private static final String[] MMAPI_SYSPROPS = {
"supports.mixing", "supports.audio.capture", "supports.video.capture",
"supports.recording", "audio.encodings", "video.encodings",
"video.snapshot.encodings", "streamable.contents"};
private static final String[] BT_SYSPROPS = {
"bluetooth.api.version", "bluetooth.l2cap.receiveMTU.max",
"bluetooth.connected.devices.max", "bluetooth.connected.inquiry",
"bluetooth.connected.page", "bluetooth.connected.inquiry.scan",
"bluetooth.connected.page.scan", "bluetooth.master.switch",
"bluetooth.sd.trans.max", "bluetooth.sd.attr.retrievable.max"};
private static final String[] FILE_API_SYSPROPS = { "fileconn.dir.photos",
"fileconn.dir.videos", "fileconn.dir.tones", "fileconn.dir.memorycard",
"fileconn.dir.private", "fileconn.dir.photos.name", "fileconn.dir.videos.name",
"fileconn.dir.tones.name", "fileconn.dir.memorycard.name", "file.separator"};
private static final String[] WMA_SYSPROPS = {
"wireless.messaging.sms.smsc"};
private static final String[] SATSA_SYSPROPS = {
"microedition.smartcardslots"};
private static final String[] OTHER_SYSPROPS = {
"com.nokia.mid.dateformat", "com.nokia.mid.timeformat",
"com.nokia.network.access", "com.nokia.mid.imei"};
private List list;
private SysPropForm cldcmidpform;
private SysPropForm optform;
private SysPropForm mmapiform;
private SysPropForm btform;
private SysPropForm fileapiform;
private SysPropForm wmaform;
private SysPropForm satsaform;
private SysPropForm otherform;
private Command exitCommand;
protected boolean bt = false;
public SystemProperties() {
list = new List("System properties", List.IMPLICIT, SYSPROPLISTS, null);
exitCommand = new Command("Exit", Command.EXIT, 1);
list.addCommand(exitCommand);
list.setCommandListener(this);
Display.getDisplay(this).setCurrent(list);
protected void startApp() throws MIDletStateChangeException {
protected void pauseApp() {
protected void destroyApp(boolean p1) {
public void commandAction(Command c, Displayable d) {
if (c == List.SELECT_COMMAND) {
int index = list.getSelectedIndex();
if (index == 0) {
cldcmidpform = new SysPropForm(SYSPROPLISTS[0], this, CLDC_MIDPPROPS);
Display.getDisplay(this).setCurrent(cldcmidpform);
if (index == 1) {
optform = new SysPropForm(SYSPROPLISTS[1], this, OPT_SYSPROPS);
Display.getDisplay(this).setCurrent(optform);
if (index == 2) {
mmapiform = new SysPropForm(SYSPROPLISTS[2], this, MMAPI_SYSPROPS);
Display.getDisplay(this).setCurrent(mmapiform);
if (index == 3) {
bt = true;
btform = new SysPropForm(SYSPROPLISTS[3], this, BT_SYSPROPS);
Display.getDisplay(this).setCurrent(btform);
if (index == 4) {
fileapiform = new SysPropForm(SYSPROPLISTS[4], this, FILE_API_SYSPROPS);
Display.getDisplay(this).setCurrent(fileapiform);
if (index == 5) {
wmaform = new SysPropForm(SYSPROPLISTS[5], this, WMA_SYSPROPS);
Display.getDisplay(this).setCurrent(wmaform);
if (index == 6) {
satsaform = new SysPropForm(SYSPROPLISTS[6], this, SATSA_SYSPROPS);
Display.getDisplay(this).setCurrent(satsaform);
if (index == 7) {
otherform = new SysPropForm(SYSPROPLISTS[7], this, OTHER_SYSPROPS);
Display.getDisplay(this).setCurrent(otherform);
if (c == exitCommand) {
quitApp();
public void quitApp() {
destroyApp(true);
notifyDestroyed();
protected void showList() {
Display.getDisplay(this).setCurrent(list);
import javax.microedition.lcdui.*;
import javax.bluetooth.LocalDevice;
public class SysPropForm extends Form implements CommandListener {
private Command backCommand;
private Command exitCommand;
private SystemProperties midlet;
public SysPropForm(String title, SystemProperties midlet, String[] list) {
super(title);
this.midlet = midlet;
backCommand = new Command("Back", Command.BACK, 1);
exitCommand = new Command("Exit", Command.EXIT, 1);
addCommand(backCommand);
addCommand(exitCommand);
setCommandListener(this);
for (int i = 0; i < list.length; i++) {
append(list[i] + ":\n");
if (midlet.bt) {
append(LocalDevice.getProperty(list) + "\n");
else append(System.getProperty(list[i]) + "\n");
public void commandAction(Command c, Displayable d) {
if (c == backCommand) {
midlet.showList();
midlet.bt = false;
if (c == exitCommand) {
midlet.quitApp();
cheers
Maybe you are looking for
-
ITunes wont open and wont install or update!! Need help!!
Everytime I try to open my itunes I get a pop-up saying "QuickTime version 7.0d0 is installed, iTunes requires QuickTime version 7.1.3 or later. Please reinstall iTunes." This message also appears whenever I try to update my itunes or reinstall it. C
-
Error :CANT USE MY ITUNES WONT OPEN OR RUN
THE FILE "iTUNES Library.itl" cannot be read because it was created by a newer version of iTunes. i have Windows 8 64 bit operating system
-
Camera not found after upgrade to snow leopard
when i try to open the iphoto, photobooth it says "camera cannot be found". I am very upset now, what happened? I just update to ios 10.6.. Please help! Thanks!
-
Hi there! I have Mac OSX 10.5.8. I really need mac osx snow leopard!!! 3 days ago a shop assistant in the offical apple shop said that i can dowload snow leopard from official apple site ? Can i? How?
-
Hi i am using a Mac OS X 10.5.2 (Leopard) Operating system in my computer. Since I updated my Nokia N77's firmware to version 3.0747.2.0.3 yesterday, I couldn't make a successful Bluetooth connection on my Macbook Pro laptop. isync does not work, sen