Jsr 82 and portability

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,
Torben

try this link
http://www.jcp.org/aboutJava/communityprocess/final/jsr082/

Similar Messages

  • How can I install a trial version of cs6 on both main station and portable?

    How can I install a trial version of cs6 on both main station and portable?

    Run the installer on both computers?  If this is not what you are looking for can you please provide a few more details regarding your inquiry?

  • IDE-specific files and portability

    I am looking for an IDE that will produce files that are portable among different J2EE servers. It seems that some IDEs produce the files (other than java's generic files like .class, .jws...) that won't run on the J2EE server other than the IDE vendor's. Correct me if I am wrong please....
    I am trying BEA weblogic workshop, it seems like a proper environment for my project, but I am not sure the application will work on the J2EE server other than BEA's (for example on JRun) , since BEA workshop produces some specific files(e.g. jcx, jsr files)? The same issue is seen in JBuilder (it also produces files with suspicious portability, specific Database connectors, etc...) and I am concerned about the portability of the IDE-specific files among the servers.
    Can someone help me with IDEs? I hope my thesis of non-portable files is not true.

    When you build a WAR file, it is built for a specific web server. There is no standard way to deploy such an application between servers.
    There may be a tools which supports a generic deployment. Try google.

  • I need to buy a new MB for college! I'm thinking of getting a 13" MBA w/ the external DVD/CDROM drive and portable/external/whatever it's called memory. Where should I buy, Best Buy or Apple Store?

    So basically a BB employee told me that instead of giving me the apple giftcard (one that would given to me for the back-to-school deal at apple) they would discount that off. Also, she says that their insurance policy (instead of apple care) would replace my macbook "then and there" if anything were to happen to it. Sounds too good to be true since I've had MANY MANY troubles with BB when I bought my first and only white MB 4 years ago. They were horrible. But she said the policy has changed since then and that people come in to exchange MBs daily. Can anyone help me! :3 Thank you <3
    ALSO, (sorry for being a pain) is the MBA a good choice if I'm getting an external/portable hardrive as well as a DVD/CD-ROM drive? I need a MB for college stuff: writing papers, projects, presentations, other general college stuff. MBA doesn't have moving parts, which is a huge plus since I am not careful with my things, and will probably drop my MB a million times.

    MacBook Air is a perfect choice for a college student. I have used a MBA as my only machine for several years now and am a professional in the advertising industry. I write a lot, do some (little) graphics work, code, and create presentations and videos. It's more than capable.
    I have an external CDRW/DVDRW but I got mine from Amazon it's not Apple-branded. It works great but was a fraction of the cost. Also if you buy the Air from Amazon you can get free shipping and pay no sales tax, which may come out to less than getting the educational discount. However, if you qualify for both the $100 gift card and the educational discount you'll probably come out better getting it at Apple.
    Here's the top of the line Air at Amazon: https://www.amazon.com/dp/B00746YD24/ref=as_li_ss_til?tag=beley-20&camp=0&creati ve=0&linkCode=as4&creativeASIN=B00746YD24&adid=0PNV1Q2S073PY61NZQZX&
    And a good DVD burner: https://www.amazon.com/dp/B004ZMVQRA/ref=as_li_ss_til?tag=beley-20&camp=0&creati ve=0&linkCode=as4&creativeASIN=B004ZMVQRA&adid=1GWB9HRMSW1VW92SD9WF&

  • Mass storage device and portable device ERROR code 31 41 HP PAVILION s5123w Desktop PC

    I am using windows vista home premium 32 bit First time I pluged nikon camera into computer. Says installing device driver software but it does not install. Device manger under portable device digital still camera yellow question mark error code 31 under mass storage device error code 41. The device driver loads and installs on my daughters Laptop so ther is some thing wrong with my PC Every time I reboot computer  windows need to intall driver software for your Microsoft WPD file system volume driver. Loacate and install driver software recomended says installing driver says successfully installed. I have to click Safely remove hardware usb mass stoage device multi flash reader usb device generic volume f  I click stop says safe to remove I do not have a reader plugged in my computer. this happens every time I reboot> If you don't understand what I am talking about Let me know.
    thanks Scott

    Hey poochokid,
    I'm sorry you're running into this issue. For the camera, if it's newer (made in the last 3 or 4 years) you may need to go to the Nikon website and find the camera software that is made for Vista. I could try to help you find that, if you could give me the model of camera you have. 
    For the Microsoft WPD file system volume driver issue take a look at this thread from another forum. 
    I hope this information helps! Let me know what the results are

  • External and Portable Hard Dirves

    Could anyone tell me what they think is the best External and/or Portable Hard Drive. I have a Macbook Core Duo with 100GB of space. I have about 4GB left due to all my movies I have converted and stored on my computer, photos and music. Could anyone help please!

    External drives are getting cheaper and cheaper. When I first started looking, around March of '07, it was give or take a dollar a gig. An 80 gig drive would cost you $80, maybe $90. A 120 gig drive would cost you between $100 and $150, depending on brand.
    At the beginning of May, I bought a Comstar USB drive at Future Shop, and get this: 250 gigs, for $109.
    Almost all drives will work with the Macbook, I believe. Pretty compatible.
    Decide if you need portability (not having to plug into a wall socket) or bigger storage, as that is the major price trade-off.
    You should also decide on USB or Firewire.
    Check out your local computer store, wherever you live. You should be able to find something that will fit.

  • Network users in mixed desktop and portable environment: Best Practices

    Hello,
    When using Server 4.0 in a network that includes both Mac desktops and Macbook devices, what is the recommended setup for network users and their Home directories?
    The environment I'm building would best be suited for a "Local Only" Home folder setup due to the frequent use of large files, such as iPhoto stores, by many users. However, how does that function with the portables? When on the network, the user has all files accessible locally, but once off site, the user is not available. I know that a user may be converted into a Mobile Account so that it is available both on and off the network. However, my understanding is that this is more suited for syncing Home folder, i.e. when the Home folder is on a network share. Will a mobile account also function this a "Local Only" Home folder setup?
    Essentially, I'm using the server to manage network users, not to serve files for the Home directories.
    Thank you.

    Bump?

  • Create a standalone and portable database

    Until now, i have been coding my programs in visual basic 6, and i am used to create my desktop applications building an exe file and attaching a .dbm database beside it.
    That way, it was easy to port them to another computers.
    Now im trying to do something similar with java, and some people recommended me to use JavaDB - But i think i cannot achieve the same portability as i described i was using until now.
    Does anyone have any idea on how to do this?
    Thanks!

    Yes, JavaDB is another embeddable database. It's delivered with the JDK, if I remember correctly (never used it). Be aware that it's not installed with the JRE, however. So if you want to distribute your application, you'll have to distribute the JavaDB jar file as well.
    A third candidate would be H2.

  • Creative Cloud on stationary and portable?

    Is it possible, with a teachers edition, to use the same license on your stationary AND your portable computer? Is it possible as long as it is not used on the same time?

    Have you signed in using your Adobe ID?
    http://forums.adobe.com/thread/1002689

  • IPhone 3G - Iphone does not show up as Camera and Portable Devices in Windo

    I have 2 iphones and both are 3g, I will name them A & B for the sake of this conversation. when I plug in A, windows 7 recognizes it as a camera and so does itunes. but when I plug in B, itunes recognizes it but windows 7 does not. I am not able to transfer the pictures from ipone B. Please suggest. Iphone B was on 3.1.2 and I upgraded it to 3.1.3 and still no luck. I am thinking of clean wiping iphone B, but need to know for sure that the pictures are backed up in the itunes backup.
    Regards,
    Sameer Jaffer

    Occassionally if a picture is saved from an email, an MMS or copied from a website, it has had the tendency to create an error when trying to import the pictures from the camera roll. If that is the case on phone "B", then it is suggested that you email the offfending photos and then delete them from the camera roll. Once that is done, most will then appear in Windows. Not sure if this is the case for you, but that is generally the first fix.

  • Forms 6i and Portable Java Components

    Hello
    Where do I have to place my Java classes (PJCs) for the Forms 6i to find them.
    Now i place them in c:\ora\FORMS60\java but Forms 6i cant load them and my bean areas are empty.
    Can somebody help please.
    I cant run PJC demos for forms 6i for the same reason
    Bye.

    Joro,
    the location is correct. Did you add the jar file name to teh archive tag in formsweb.cfg ?
    archive_jini=f60all_jinit.jar, <pjc_archive_name>.jar
    Frank

  • Benefits and portability of DB

    Dear forum
    I have started to learn some basics about databases as I know nothing of it, and I am overwhelmed by all information there is of this. There are so many choices I cannot adequately take, and I feel I maybe should wait with DB. Nontheless, I would appreciate if you could help me with some questions:
    1) What are the benefits of using a DB over using Collections to store/retrieve data? Specifically, I will have to store large amounts of data, but it does not need to be persistent (only available for a session). I keep getting "heap memory" errors when reading this data..
    2) Is there a DB inside JWM? If I want to use a DB, and install my program on another machine, must I also install the DB on that machine, or is there some simple DB already available in Java?
    Yes, I assume these questions are naive, but so am I :) I would appreciate any answer on these questions.
    Message was edited by:
    herreminsjel

    1) What are the benefits of using a DB over using
    Collections to store/retrieve data?DBs allow you to do complex queries of the data.
    Specifically, I
    will have to store large amounts of data, but it does
    not need to be persistent (only available for a
    session). I keep getting "heap memory" errors when
    reading this data.. Then you may need to allocate more memory to your JVM. A database is not necessary if you merely want to retain information - it is merely useful if you want to search that information.
    2) Is there a DB inside JWM? If I want to use a DB,
    and install my program on another machine, must I
    also install the DB on that machine, or is there some
    simple DB already available in Java?Not yet. The next major release of Java is going to include an embedded database implementation called "Derby". You may choose to download and investigate that.
    (edited)

  • Firefox and portable JRE?

    Hi,
    is it possible to let Firefox Portable run applets with a shipped, non-modified JRE?
    Are there any applet parameters supplied with the next generation java plugin to specify an absolute path to a (non-installed) JRE?
    If not:
    In my opinion it shouldn't be hard, for example, to read the parameters from a shipped Firefox config plugin file instead of the registry.
    Would this violate any license agreements?
    How are chances that such a mechanism gets integrated into one of the next Firefox Portable versions?
    Thank you.

    What is the goal you want to achieve? Are you trying to run Applets with Firefox Portable?Exactly. Imagine a company whose members are allowed to execute a web application within Firefox Portable but not allowed to install or update a Java JRE.
    My goal is to enable them to run a Java 1.5 applet being part of this web application.
    See known issues: http://portableapps.com/support/firefox_portable#known_issues
    Thanks. I already knew this article. I hoped that this issue might have been fixed.
    Thank you anyway for your response!

  • Starz Play and portable devices

    I've been using Starz Play on my Windows PC for about a month now.  In addition, I've been trying to use it on my Sansa E250 media player.  The E250 never seems to connect.  Any suggestions?

    1] Login to verizon.net with your primary e-mail address.
    2] Click on "My Account" on top of the page.
    3] Click on "Manage Broadband and Essentials Extras" on left panel of the Page.
    It should be listed there.

  • Balance between hardware, sample libraries and portability

    OK, tough one this for me. I have started getting into Logic Pro and I am really enjoying using it alongside light sample libs like GPO4 etc. I have installed numerous loops and stuff from various sites and have not suffered any problems using it on my MacBook Pro 13"
    Now, my MBP 13" is latest model with 250gb but only running at 5400 speed. However, it works and with a lot of screen tweaking and a prolific use of kbd shortcuts I am finding it easy to use.
    Don't get me wrong - if I use Logic on my Mac Pro with it's 30" cinema display and 2nd monitor it's a lot easier but that's at work and the MBP is my home machine.
    Problem is (maybe) is that I want to buy some more major libraries like the EWQL Symphonic Orchestra Platinum and the Choirs and I think I maybe just pushing it too far for my lovely little MBP
    I can't afford to buy a stomping great 8 core, 16gb Mac Pro for home - divorce would ensue. And I don't want to anyway - I like linking up the MBP to my midi controller and just messing around. Once done, I crash on the couch with MBP and mix/add effects/mess around with everything - usual stuff
    I guess what I am asking for (in a rambling way - apologies) is will I be able to run EWSQL SO Platinum and Choir on my MBP? Forget HD for now - I know the Platinum takes up 200gb - so I may have to go for the Gold Edition
    The MBP meets minimum specs so I think it could be OK. However, I am worried I will get massive slow down/crashes once I get past 6 or so tracks through PLAY?
    I know I can "freeze" the tracks (whatever that means) and I can obviously bounce say 4 or 5 tracks at a time - maybe keeping the original work in a different project in case I need to come back and tweak it later and then output/import as an audio track into the main project?
    I was also wondering - re the HD issues - about getting a FW800 connect external HD for installing the platinum edition? But I guess that would really slow everything down trying to read from one of those instead of the internal SATA drive?
    Maybe someone can point me to a 1TB SSD drive for the MBP for under £400/$600 If only! As I reckon that would help!
    Oh, the MBP is the base model too with 2.33 processor and 4gb ram, 250GB HD.
    What's kind of annoying is when I went to the apple store to buy I had decided on a more expensive 15" machine that had 320gb hd and an i5 processor OR the top of the range MacBook Air with SSD etc - the guy in the store talked me out of it and I agreed the 13" base model would more than meet my needs. He was right - don't get me wrong! But my needs changed within 2 months!! Once I had played with Garage Band I just had to try out Logic and loved it - then I started finding out all this other cool stuff!
    Any advice on how I could squeeze usage of libs like EWQL into my little MBP 13"?
    I am not a musical pro - just a hobbyist - so have to justify everything financially nowadays!
    Thanks in advance

    I have been hitting the credit card recently. Last year I bought a Sony Vaio because I couldn't justify all that money when the new line of MBP's finally came out. Sold it 10 months later - they are meant to be a great build quality? Don't think so!
    So, 3 or 4 weeks ago I bought a 13" MBP for browsing and a little mixing with Logic - works nicely - until I start hammering it - but it's good for learning.
    Anyway - this new iMac replaced my old 21" 2007 model - wow What a dream!
    But you know what I always like, every time I open up one of these boxes? The smell! What is it with Apple? Do they spray something in the box? I think they do!
    As for how the migration went - pretty good.
    Right now though I still have OS and apps on the 256gb SSD and all the data is now on the 1TB HD. Works so well that I don't know whether there is any point in changing it to be honest. I'm sure I could improve read speed by putting all the logic samples on the SSD but I have over 350gb of them so not sure there's much point!

Maybe you are looking for

  • No Certificates Found by Certificate Server - Though they exist in ADSI

    I've been racking my head on and off for over a month on trying to stand up a PKI in my lab environment. I used this guide to setup my PKI and after a few modifications it worked perfect! http://www.derekseaman.com/2014/01/windows-server-2012-r2-two-

  • Color a single cell in ALV using OO

    Dear Gurus , I tried to color a cell using OO in ALV but i can't . I think my code is correct but i can't find the problem ... Look my code please ... DATA: BEGIN OF ITAB OCCURS 0,            PERNR    LIKE PTRV_HEAD-PERNR,            ENAME    LIKE PA

  • How to disable XML´s DTD validation in Weblogic10?

    Hello folks, we are trying to upgrade our server to Weblogic10, but it´s XML parser is validating XML´s DTD and ´cause we are behind a firewall we receive a error like: Tried all: ´6´ address, but could not connect over HTTP to server: 'www.w3.org',

  • Payment Method Status

    We are running payroll Run, after that prepayments.We have only two payment methods Cash And Bank Deposit.After running pre-payments system is showing payment status as Unpaid.How to Make it Paid

  • Processing system files

    Hi, I want to process file that is located in system files. My code takes this file as a parameter, but how can I process the file directly since it locates in different drive -- not in the same directory where I have my code.