Dealing with optional APIs in J2ME

On top of MIDP, there are optional packages that a phone may or may not support. Say, the MMAPI may not be supported by many phones.
I am trying to write an application which, after installation, either plays a video, or informs the user that "This application cannot play video on this phone".
Certainly System.getProperty("javax.microedition.media") may help, but what I am afraid of is that if an application has been compiled using "import javax.microedition.media", it may not even install on a device which doesnt support MMAPI, and all my user will get is an "Installation failed" message.
What is a solution to this. I dont want to have multiple versions of my midlet (ie, with and without MMAPI part of the code)

I believe you can use the fully qualified package location to get around this. Instead of importing, refer to the class directly when you need it. (Can you make a reference to it then?)
I did some research to kinda make sure: http://discussion.forum.nokia.com/forum/archive/index.php/t-36314.html

Similar Messages

  • How to deal with optional elements?

    Hi,
    I'm using clientgen to generate the client classes required for me to access a web service from an EJB. The web services is document-oriented and thus I just assemble the message by building up ordinary Java objects (which were generated by clientgen).
    SIDStructure s = new SIDStructure();
                        s.setSIDUniqueReference(createUniqueRef(findCriteriaTO));     s.setSIDOtherCriteria(createSIDOther(findCriteriaTO));
    where createUniqueRef and createSIDOther create the necessary objects to assign to the setters on the SIDStructure object.
    If I comment out the s.setSIDUniqueReference(..) line above, the XML sent over the wire is as follows:
    <SIDSearchCriteria>
    ..<SIDUniqueReference xsi:nil="true"/>
    ..<SIDOtherCriteria>
    ....<FamilyName>smith</FamilyName>
    ..<SIDOtherCriteria>
    ..</SIDSearchCriteria>
    </SIDSearchCriteria>
    But this doesn't conform to my schema. The schema says:
    <xs:complexType name="SIDSearchCriteriaStructure">
    ..<xs:sequence>
    ....<xs:choice>
    ......<xs:element ref="SIDUniqueReference"/>
    ......<xs:element ref="SIDOtherCriteria"/>
    ....</xs:choice>
    ..</xs:sequence>
    </xs:complexType>
    So my question is, how can I get WebLogic to not output an element for a field in the client classes that isn't set? i.e. I don't want it to send the element <SIDUniqueReference xsi:nil="true"/> over the wire.
    Thanks
    Nick
    Message was edited by:
    nasmith

    After speaking to BEA support it appears as though there is a partial solution to this issue. If you add the attributes minOccurs="0" nillable="true" to the elements then the SOAP message is correct. i.e.
    <xs:complexType name="SIDSearchCriteriaStructure">
    <xs:sequence>
    <xs:choice>
    <xs:element ref="SIDUniqueReference" minOccurs="0" nillable="true"/>
    <xs:element ref="SIDOtherCriteria" minOccurs="0" nillable="true"/>
    </xs:choice>
    </xs:sequence>
    </xs:complexType>
    I say that this is only a partial fix because elements cannot have minOccurs and nillable attribtes when they are references (as opposed to named elements - e.g. <xs:element name="SIDDNA" type="RestrictedStringType"/>). This is according to XMLSpy anyway. Don't know whether it's W3C legal though.
    Nick

  • Dealing with optional XML elements

    We have a template that will print certain tables based on whether or not an element is present in the incoming XML file.
    I have no problem displaying these tables conditionally on XML elements that are always present (i.e. I can say <?if:element='Y'?>) but I'm running into problems when I need to display a table/field based on whether or not an element is present.
    Also, when the element in question is not present, the template ignores my page break and prints the remainder of the document on the same page.
    Can anyone recommend a way to accomplish the above?
    Thanks.

    You should use <?if:element = ''?> or <?if:element != ''?>
    This should work also:
    <?if:text(element)?> or <?if:not(text(element))?>
    The condition is always true (false) when either the element is empty or does not
    exist. Let me know, if you need to differentiate between both (probably using name() instead of text will work in this case).
    If a pagebreak is inside the if statement than it is only shown when the condition is satisfied.
    Hope that helps,
    Klaus

  • How i can deal with oracle file by using php api

    how I can deal with oracle file by using php api ?

    What has this to do with Reflections and Reference Objects?

  • What's the deal with the swoosh sound when sending texts? IOS 5.1 needs to have an option to turn it off., What's the deal with the swoosh sound when sending texts? IOS 5.1 needs to have an option to turn it off.

    What's the deal with the swoosh sound when sending texts? IOS 5.1 needs to have an option to turn it off., What's the deal with the swoosh sound when sending texts? IOS 5.1 needs to have an option to turn it off.

    Trax and kirt are correct. I'm pretty good with technology, being an engineer and all, and I can tell you for a fact that this 'swoosh' sound (triggered by a successfully sent SMS) can NOT be disabled from ANY menu in iOS 5. The ONLY way to disable it is to flip the silent switch on the left hand side of the phone. This is extremely annoying for some people (like trax, kirt, and myself). For what we pay for Apple products and, in particular, this phone, we simply didn't expect to have to deal with such annoyances. That's why we're Mac users. Please fix this bug.
    I feel like I shouldn't have to say this but it bears repeating: turning off message sounds from the 'sounds' menu does not fix his problem. It still emits the swoosh noise. Whoever suggested this clearly didn't try it because it obviously doesn't work. Who posts a solution to a problem without knowing for a fact that their solution is correct? I find that response condescending because he writer is assuming we're not smart enough to have tried it. In reality, it's vice versa.

  • Open message to Apple - why the **** do you force us to deal with this Genius Playlist crap if using iTunes Match?? GET AN OFF OPTION INSTALLED.   I AM PAYING FOR MATCH SO QUIT FORCING YOUR INANE ATTEMPTS AT WHAT YOU THINK I LIKE!!!!!!

    Open message to Apple - why the **** do you force us to deal with this Genius Playlist crap if using iTunes Match?? GET AN OFF OPTION INSTALLED.   I AM PAYING FOR MATCH - SO QUIT FORCING YOUR INANE ATTEMPTS AT WHAT YOU THINK I LIKE ON ME !!!!!!  YOU ALREADY HAVE THE OPTION WHEN MATCH IS OFF.  HOW CAN YOU POSSIBLY THINK THERE IS A CONNECTION?????   LET ME ME ME DECIDE!
    IF anyone knows how to turn that Genius crap OFF WHILE MATCH IS 'ON' - Please let me know. Under 10.7
    I HATE THESE PLAYLISTS - NEVER USE THEM- WASTES MY SCREEN REAL ESTATE..

    At the moment it is not possible to disable Genius Playlists on iOS devices. However, these forums are user-to-user forums and no Apple employees participate here. You would be better to submit your polite feedback via the Apple Feedback page: http://www.apple.com/feedback/

  • Seeking for API to deal with XML processing instructions

    Hi all,
    I have a requirement to list all the processing instructions inside a xml document.
    E.g. For the document
    <?xml version="1.0" encoding="utf-8"?>
    <?AAA att1="att 1"?>
    <?BBB?>
    <?CCC?>
    <body>
      <empty>True</empty>
    </body>
    I need to print out PIs AAA, BBB, CCC.
    Two solutions i can find are:
    1. to treat the doc as a string and do a pattern search for <?*?>.
    2. use IF_IXML_DOCUMENT to traverse all the nodes and check their node types against IF_IXML_NODE=>CO_NODE_PI_PARSED and TYPE = IF_IXML_NODE=>CO_NODE_PI_UNPARSED.
    However, I am wondering if there's any xml API to deal with XML PIs.
    During my research on this, i got IF_IXML_DOCUMENT. It provides two creation APIs for XML PI: CREATE_PI_PARSED and CREATE_PI_UNPARSED. However, there is no corresponding getter API found.
    Does anybody know if there is such one?
    Thanks in advance.

    Never do yourself down Richard.
    Leave that to other people.
    It's quite common for smart developers to think they're not as good as they are.
    I coach a fair bit and it's a surprisingly common feeling.
    And to repeat.
    Never use anything ends .. provider.  They're for trivial demo apps.  Transform xml into objects and use them.  Write it back as xml.  Preferably, use a database.
    You want to read a little mvvm theory first.
    http://en.wikipedia.org/wiki/Model_View_ViewModel
    Whatever you do, don't read Josh Smiths explanation.  I used to recommend it but it confuses the heck out newbies. Leave that until later.
    Laurent Bugnion did a great presentation at mix10.  Unfortunately that doesn't seem to be working on the MS site, but I have a copy.  Download and watch:
    http://1drv.ms/1IYxl3z
    I'm writing an article at the moment which is aimed at beginners.
    http://social.technet.microsoft.com/wiki/contents/articles/30564.wpf-uneventful-mvvm.aspx
    The sample is just a collection of techniques really.
    I have a sample which involves no real data but is intended to illustrate some aspects of how viewmodels "do stuff" and how you use datatemplates to generate UI.
    I can't remember if I recommended it previously to you:
    https://gallery.technet.microsoft.com/WPF-Dialler-simulator-d782db17
    And I have working samples which are aimed at illustrating line of business architecture.  This is an incomplete step by step series but I  think more than enough to chew on once you've done the previous stuff.
    http://social.technet.microsoft.com/wiki/contents/articles/28209.wpf-entity-framework-mvvm-walk-through-1.aspx
    The write up for step2 is work in progress.
    https://gallery.technet.microsoft.com/WPF-Entity-Framework-MVVM-78cdc204
    Hope that helps.
    Recent Technet articles: Property List Editing;
    Dynamic XAML

  • Requesting guidance on how best to deal with removal of CreateElementSteps for tables when option to 'script validation for new constraints' is enabled during schema compare

    I have a DeploymentPlanModifer subclass that is responsible for removing certain tables from a deployment plan under specific conditions. It is relatively trivial to find the
    CreateElementSteps I need and subsequently remove them via
    DeploymentPlanModifier.Remove(), but...
    ... if in my comparison I have enabled the 'Script validation for new constraints' option, the deployment plan will contain a
    DeploymentScriptDomStep with a Batch containing AlterTableConstraintModificationStatements for tables with foreign key constraints. My problem starts here - there will be an orphaned
    AlterTableConstraintModificationStatement for each of the tables that I removed. Obviously, execution of the generated script comes to a grinding halt when asking SQL Server to to alter a table that is never created.
    I'm able to get around this by digging around in the aforementioned batches and removing the orphaned alter statements, but this seems really hacky, which makes me think I'm missing the proper way of dealing with this.
    So... if anyone is aware of a more correct way of avoiding this problem, I would really appreciate finding out more about it.
    Thanks in advance for any help. :-)

    Hi Greg. Unfortunately there is not an easy solution here. Walking the deployment model, spotting potential issues and excluding them really is what you have as an option here. The alternative is to pre-process the dacpac to have it in the form you want,
    but I'm not sure if this is an option in your case and it also has limitations.
    Regards,
    Kevin

  • ITunes randomly stops playing purchases that have previously viewed on the same hardware. It has an error message about HD. How can this issue be resolved?  What information is available besides the "learn more" option that does not deal with the problem?

    iTunes randomly stops playing purchases that have previously viewed on the same hardware. It has an error message about HD. How can this issue be resolved?  What information is available besides the "learn more" option that does not deal with the problem?
    Many people have the same problem. However, there is little or nothing readily available to users. This problem has existed for two or more years. Does anyone have anything to offer about this disturbing problem?

    Thanks for the suggestion kcell. I've tried both versions
    9.0.115 and 9.0.124 and both fail with the policy permission error.
    I also tried with and without your crossdomain.xml file but
    with the same result. It looks like this file is intended for URL
    policy, instead of socket policy. Recently Adobe separated the two.
    When I run with the files installed on my dev PC, it does
    work, which makes sense because the flash player isn't loaded from
    an unknown domain.
    I did get one step closer. If a crossdomain.xml in the server
    root exists and the socketpolicy file is loaded from the app folder
    then the first two warnings disappear. The logs now show:
    OK: Root-level SWF loaded:
    https://192.168.2.5/trunk/myapp.swf
    OK: Policy file accepted: https://192.168.2.5/crossdomain.xml
    OK: Policy file accepted:
    https://192.168.2.5/trunk/socketpolicy.xml
    Warning: Timeout on xmlsocket://192.168.2.5:843 (at 3
    seconds) while waiting for socket policy file. This should not
    cause any problems, but see
    http://www.adobe.com/go/strict_policy_files
    for an explanation.
    Warning: [strict] Ignoring policy file with incorrect syntax:
    xmlsocket://192.168.2.5:993
    Error: Request for resource at xmlsocket://192.168.2.5:993 by
    requestor from https://192.168.2.5/trunk/myapp.swf is denied due to
    lack of policy file permissions.
    Which basically says, everything is okay, but you stay out
    anyway.
    PS: I found the XML schema files here:
    http://www.adobe.com/devnet/flashplayer/articles/fplayer9_security_02.html
    and the socket policy schema:
    http://www.adobe.com/xml/schemas/PolicyFileSocket.xsd.
    UPDATE: When serving up the policy file on port 843 using the
    example perl script then the socket connection seems to be accepted
    and the connect succeeds. After that flex hangs trying to logon to
    the IMAP server.

  • API that deals with domain

    We are trying to migrate C++ application to JAVA. I need to find out JAVA api that deals with domain, such as list of user(group) name under one domain, list of all domain controllers...
    Under C++ world, it would be NetUserEnum, NetServerEnum...
    thanks in advance

    Not sure if this is what you are looking for , but give it a look. ..
    http://java.sun.com/products/jndi/overview.html
    http://java.sun.com/products/jndi/tutorial/

  • Insurance and options in dealing with faulty phone

    Hello.
    EE helping line is rather unclear for me and this seems to be the only place I can actually write about the problem (otherwise I'd be really grateful if somebody could provide me with appropriate email).
    I am a carer for a person with cerebral palsy. He is able to use the phone only if the screen is really big. His Samsung s6 is insured and since yesterday is just not responsive to charging - we've tried different chargers which are working on other phones, different a sockets and so forth. EE is giving him an option of either bringing that to the shop and waiting 40 days for the repair with the lone phone which is not possible for him to use or to pay £30 for the delivery of the new one. His mum dealing with his tight budget is not willing to do that. Is there any other option or people we could turn to to solve it otherwise?
    thank you for the help

    Have a look at the charging port on the phone.
    Is there anything stuck there? Use a pin to try and clean it out but be careful and gentle with it.
    If this doesn't help then the options given by EE is the only way, unless you want to try a factory reset first which I don't think would help.
    You may be on a tight budget so then the repair option would be best. OK you need a phone with a big screen but using a smaller phone for a few weeks is better than having an expensive paper weight.

  • Dealing with ExtendScript hangs and long processing times?

    Just curious if an ExtendScript for some reason hangs (or takes really long time to run), you just have to kill it externally right? Or is there some other Adobe scripting feature I'm not aware of that deals with that scenario?
    So I'm guessing the best option to deal with hangs or long processing time is to:
    have an external monitoring tool/service to check up on the ExtendScript execution and handle appropriately as needed (kill it, log info)
    use the COM API (e.g. VBScript, though other COM compatible languages ok) or Applescript API (called directly or called by other programming languages) instead of ExtendScript for their additional programming and/or multi-threading capabilities

    Using whose in Snow Leopard is a lot slower for some reason. SInce you are already using a shell script, you might try using find. Various shell scripts to copy, find, move, etc, can also use wildcard characters.

  • I need to reinstall my computer, how do I deal with Premiere pro and After effects?

    Hello,
    As my question states I need to reinstall my computer (laptop) and I'm not quite sure on how to deal with Premiere pro and After effects.
    I am thinking that I need to do some sort of backup and save my projects and footage on a sepparate drive.
    If I reinstall my computer, install my creative suit production premium, and move back all of my projects and footage, won't I have to re-link every single clip?
    I am currently workning on several different projects and having to re-link everything is something I don't even want to think about, that would take me days if not weeks.
    Another option on my mind would be to use Creative cloud. I do have the free version but I have never used it even once before and I'm not quite sure what the purpose of the cloud is and if this is a way to use it.
    I have no idea how to go about this computer reinstalation without either loosing tons of work or having to re-link every single clip used.
    I am videoediting only as a hobby so I have no experience working with other people and sharing projects or the like, wich is my understanding of what the cloud is for.
    Any and all help would be grealty appreciated, I know this is probably really easy but ever since i got my Suit I haven't reinstalled, upgraded och changed my computer so I am just clueless as to how to go about this.
    I have Creative suit production premium, I also have the free Creative cloud.
    It is only Premiere pro and After effects that I am using and am worried about.
    Thank you for any help.
    -Lisa Kajupank
    (and oh, I just notice my name - umustbejoking - I think I just wrote that cause they wouldn't let me use anything else, saying it was already taken. So nevermind that haha.)
    Message was edited by: umustbejoking

    If the computer's running Mac OS X, move the cursor to the very top of the computer's screen, click on Store, and choose Authorize this Computer.
    If the computer's running Windows, press the Alt and S keys and choose Authorize this Computer, or click here, follow the instructions, click on Store in the menu bar, and choose Authorize this Computer.
    (84620)

  • Where am I supposed to get help? 3 months dealing with tech support is NOT working

    I have been dealing with an ongoing connection issue for 3 months now and I'm at my wits end with trying to get help. I'm have the same problems others seem to be having here my internet keeps cutting out for a min or two and coming straight back on sometimes it works fine for a week sometimes I can't get online all day. I have spent countless hours on the phone with Verizon over these past three months being transferred from place to place, being hung up on and told multiple times they would "call me back"
    I've had three techs come to my house (money out of my paycheck taking off work) and each said the issue isn't at my home, I even spoke with a gentleman at the local dispatch center and he told me the same thing, he also told me when I had a 4th tech scheduled to come "sending another tech won't help we already know the issues isn't at your home so all a tech will do is come check the connection and if its working at that moment close the ticket out"
    Each and every time I call I get the exact same process, first they want to send a tech, then I explain that's not going to help, then I spend 15 min trying to get their "supervisor" on the line, each time I'm told "the ticket has been escalated and will be looked into expect a call back in 24-48 hours" each time I either don't get a call or they call and say its fixed just to have issues return a few days later.
    I've even managed to get a number to a supposed "supervisor" area that needs a pin number to get thorough, yet even when I call that number I'm dealing with being told they need to send another tech and being told I will get call backs.
    I've been told them replacing the modem fixed it, then told them fixing something at the end of my street fixed it, been told they switched me to another server or something Because mine was congested and that fixed it, was told they found another issue and that fixed it..None of these actually did fix it though..SO I've been down right LIED to by Verizon many many times already over this ordeal over the multiple false fixes and the numerous call backs I never got.
    No customer should have to spend 20+ hours on the phone (with each call being atleast 1+ hour most of it being on hold) to get a service they are paying for fixed so PLEASE who on earth do I contact to get this actually FIXED???? Because Each time I try to get somebody who is actually a real manager or something on the phone they are NEVER available and each time I ask to speak to somebody who is actually in MY COUNTRY let alone my state I get told its "not possible"
    Where I live don't have too many internet options and I'ma bout to have to move to a SLOWER service all Because Verizon has screwed me over for 3 months and refuses to fix a service I have paid for for YEARS.
    SO please if any verizon employee sees this or anybody else who knows who/what I need to to please I beg you tell me lol I'm tired of being toyed around...

    Your issue has been escalated to a Verizon agent. Please go to your profile page for the forum, and look in the middle, right at the top where you will find an area titled "My Support Cases".  You can reach your profile page by clicking on your name beside your post, or at the top left of this page underneath the title of the board.
    Under “My Support Cases” you will find a link to the private board where you and the agent may exchange information.  This should be checked on a frequent basis  as the agent may be waiting for information from you before they can proceed with any actions. Please keep all correspondence regarding your issue in the private support portal.
    If a forum member gives an answer you like, give them the Kudos they deserve. If a member gives you the answer to your question, mark the answer that solved your issue as the accepted solution.

  • How to deal with deadlock on wwv_flow_data table when http server times out

    There are some threads about a deadlock on the wwv_flow_data table. None of them contain a real explanation for this behaviour. In my case I will try to explain what I think is happening. Maybe it helps somebody who is hitting the same matter.
    In my case with APEX 3.2.1 I am navigating from one page to another. Doing this APEX will lock the table wwv_flow_data. As soon as the other page is shown the lock will be released. But now this other page contains a bad performing query (standaard report region). After 5 minutes the http server (modplsql) will time out and present the message "No response from the application server" on the screen. In the meanwhile the query is still running on the database server and the lock stays on the wwv_flow_data table.
    Normal user behaviour will be that the user will use the back button to return to the previous page and tries it again to navigate to the other page or
    the user will try to refresh the page with the bad performing query.
    And voila now you will have a deadlock on the wwv_flow_data table since a second session is trying to do the same thing while the first hasn't finished yet.
    How to deal with it?
    First of all. Have a good look at the bad performing query. Maybe you can improve it that it will succeed before the http server will timeout.
    In my case the 11gr1 optimizer couldn't handle a subquery factoring clause in the best way. After changing it back to a classical inline query the problem was solved.
    Secondly you could increase the timeout parameter of the http server. Although this not the best way.
    Maybe it would better if APEX in a next version would release the lock on the table wwv_flow_date earlier or do a rollback just before the moment that the http server is timing out.
    regards,
    Mathieu Meeuwissen

    Hello Shmoove,
    I saw your reply here and you probably understand the problems the HTTP 100 response may cause.
    I am trying to send image that was taken by getSnapshot. The problem is that the server respond with this HTTP 100 message.
    I suspect that the reason that my server doesn't recognize the file that I'm sending from J2me is that the "server to client" response to the 100 message comes after the second message of (see what the TCPIP viewer shows down here):
    POST /up01/up02.aspx HTTP/1.1
    Content-Type: multipart/form-data; boundary=xxxxyyyyzzz
    Connection: Keep-Alive
    Content-length: 6294
    User-Agent: UNTRUSTED/1.0
    Host: szekely.dnsalias.com:80
    Transfer-Encoding: chunked
    400: Client to Server (126 bytes)
    78
    --xxxxyyyyzzz
    Content-Disposition: form-data; name="pic"; filename="david.jpg"
    Content-Type: application/octet-stream
    400: Connected to Server
    400: Server to Client (112 bytes)
    HTTP/1.1 100 Continue
    Server: Microsoft-IIS/5.1
    Date: Wed, 23 Mar 2005 00:47:02 GMT
    X-Powered-By: ASP.NET
    Any help will be appreciated,
    David

Maybe you are looking for

  • Is there any guides on how to organize your videos?

    So I have a 60GB video Ipod. I also have PQ DVD to Ipod (converts DVD to mp4 - very easily and accurately). Anyways, when I transfer the converted movie file to the ipod using anapod explorer 8.9.5a (i still have itunes, in a rare, rare circumstance

  • Font "Verdana" is not working - Oracle forms 11g

    OS : Windows XP 32 bits - SP 3 Forms : 11.1.2.0 - Development I'm using the font "Verdana" for some items in a form. When i test it, forms keeps using another font (arial). However, other fonts do work. These are the lines in the registry.dat file: d

  • Will Microsoft Office (Word and Excel) work on OS 10.9.2 aka Mavericks?

    Will Microsoft Office (Word and Excel) work on OS 10.9.2 aka Mavericks?

  • After 10.5.7 Brother MFC-5460CN problems

    After installing the 10.5.7 update my Brother MFC-5460CN printer has gone crazy. For example if I set the quality of printing to anything less than Normal, such as "Fast Normal" or "Fast" the print job either expands or shrinks the print and sometime

  • Error with jar file

    Hi. I create a project that runs good, but when I package it in a jar file throws a NoClassDefFoundError: org/jdom/output/XMLOutputter. Why? Thanks PD:I call the project with java -jar MatchingXmlEditor.jar Uses 2 jar more: giosftware.jar jdom.jar Th