×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Regular Contributor
    Join Date
    Jul 2008
    Posts
    97

    Question How to test file reading/writing and web server app in emulator?

    Hi friends,
    I am using Netbeans 6.1 mobility pack IDE for j2me midp app development with S60 2nd edition feature pack 2 MIDP sdk. i hav written some code to read a file from device drive location and show it on phone screen, but I can actually test it on device.How can test thia app on emulator which comes with netbeans IDE (SUN WTK). That means I should provide the file location on the emulator drive and the app should be able to read/write file in the emulator drive so that the app can be tested on emulator before device?

    where is the emulator'd drives (root path where i shall keep the file for reading/writing for emulator test)wre located in netbeans 6.1 mobility pack? plz guide me to test such app on emulator first...

    Later I want some web services to run at some server so that my device connects to the server using HTTPConnection for GET/POST.how can I test such web serverices on emulator? Say on emulator where can I run the server to listen for clients request before doing it on actual device with internet access...plz provide me some pointers/Refs to follow so I can test such app on emulator...

    Another problem is my netbenas IDE does not detect the device emulator which comes with s60 2nd fp2 midp sdk..i hav integrated the sdk with netbeans ide bt it does not fing the device name which i specified in emulator configuration in the iDE...how to remove such errors becoz when i run any app with the s60 emulator it says..unable to fine emulator(device name not found)..

    plz bear me with such lengthy mail,but i wanted to make the scenario clear before you..

    thanks and regards,
    sanjay

  2. #2
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,406

    Re: How to test file reading/writing and web server app in emulator?

    Hi sanjay,

    the WTK emulator filesystem default root is usually located under:

    <WTK_INSTALLATION_PATH>\appdb\<USED_EMULATOR>\filesystem\root1\

    where WTK_INSTALLATION_PATH is the path where you've installed WTK (e.g.: "C:\wtk", and USED_EMULATOR is the emulator you're using (e.g.: 'DefaultColorPhone').

    About testing your application on emulators, you can easily do it: the only requirement, if you want your application to access Web-based resources, is that your PC is connected to network.

    Also, if you want some infos and code about handling HTTP connections in Java ME, you can look at this Forum Nokia Wiki article:

    http://wiki.forum.nokia.com/index.ph...tps_in_Java_ME

    Pit

  3. #3
    Regular Contributor
    Join Date
    Jul 2008
    Posts
    97

    Re: How to test file reading/writing and web server app in emulator?

    Hi,
    thanks for the early reply. I hav the SUN WTK come with Netbeans Mobility 6.1 pack and in that the SUN WTK's file root is located at C:\Program Files\NetBeans 6.1\mobility8\WTK2.5.2\j2mewtk_template\appdb\DefaultColorPhone\filesystem\root1. So I can use the location to keep my files there and read/write from there to test on emulator,,,am i right?

    Yes, I have PC connected to inetrnet...so plz tell me how to configure the WTK which comes with Netbeans to access internet to connect to a web server on some IPort...Later I will have to test the client-server app on my device, so I want to test it emulator first...plz reply this Question at least..

    And abt the integration of MIDP SDK, the error comes as "Device not found" when run with the SDK emulator.In project configuration of Netbeans I hav given Emulator platform as S60_2nd_FP2_MIDP_SDK and Device as MIDPDevice which is a dummy given name specified by me...I think the device name is not proper ..also after SDK installation, in command prompt this SDK device is not shown...plz tell me wht went wrong..FYI i have S60_2nd_fp2 C++ SDK installed on my PC and devices command on command prompt recognizes that SDK emulator...

    Waiting for ur valuable replies..
    thanks and regards,
    sanjay

  4. #4
    Regular Contributor
    Join Date
    Jul 2008
    Posts
    97

    Re: How to test file reading/writing and web server app in emulator?

    plz read my previous reply. Itried with creating to folders like CFCard/ and SDCard/ under \filesystem\ folder of emulator and tried to read the file in /CFCard/SomeText.txt , but the emulator is not taking reading the file from that location...where lies the problem..plz tell me how to set up for reading this file in amulator..i gave this in my program to read the file---
    Code:
    FileConnection fc = (FileConnection)Connector.open("file:///CFCard/SomeText.txt");
                    if (fc.exists()) {
                        InputStream is = fc.openInputStream();
    regards,
    sanjay

  5. #5
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,406

    Re: How to test file reading/writing and web server app in emulator?

    Hi sanjay,

    just noticed that in WTK2.5.2 the emulator filesystem root location has been changed. You should be able to find it under:
    C:\Documents and Settings\<YOUR_USERNAME>\j2mewtk\2.5.2\appdb\<EMULATOR_NAME>\filesystem\
    Pit

  6. #6
    Regular Contributor
    Join Date
    Jul 2008
    Posts
    97

    Re: How to test file reading/writing and web server app in emulator?

    Hi jappit,
    thanks for the much valuable info. still after specifying the location of the txt file it is not creating any xml file there what I want to make in the filesystem/ folder. the code snippet is
    Code:
    FileConnection fcXml = (FileConnection)Connector.open("file:///root1/LocationInfo.xml", Connector.READ_WRITE);
                        if(!fcXml.exists()) {
                            fcXml.create();
                        }
    And in Netbeans, i m getting "Warning: To avoid potential deadlock, operations that may block, such as
    networking, should be performed in a different thread than the
    commandAction() handler.
    " as warning..plz tell me how to avoid that.. I have opened three file connection streams in a method to do various operations on a file one after another in a serial manner..where lies the problem in creating the file..
    regards.
    sanjay

  7. #7
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,406

    Re: How to test file reading/writing and web server app in emulator?

    Hi sanjay,

    this is a common issue: you can find a lot of threads on these Boards that talk about it. Briefly said, you should perform (like the warning message says itself) all blocking operations in separate threads, so that the application main thread does not get blocked.

    You could start by reading these detailed articles about threading, that explain how to avoid and handle these situations:

    http://developers.sun.com/mobility/m...les/threading/
    http://developers.sun.com/mobility/m...es/threading2/

    Pit

Similar Threads

  1. Replies: 5
    Last Post: 2006-04-26, 07:08
  2. Uploading JAR file into sun Application server
    By bvsbh in forum Mobile Java General
    Replies: 1
    Last Post: 2005-12-02, 16:18
  3. Replies: 0
    Last Post: 2005-06-02, 11:07
  4. Uploading File From Series-60 Phone To Web Server Thru C++ Application?
    By periakaruppan in forum Symbian User Interface
    Replies: 0
    Last Post: 2005-06-02, 11:05
  5. Uploading File From Series-60 Phone To Web Server Thru C++ Application?
    By periakaruppan in forum Symbian Tools & SDKs
    Replies: 0
    Last Post: 2005-06-02, 11:04

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×