Generics in J2ME

Are there any plans to generify the J2ME API? (CLDC/CDC/MIDP) If not, could you still use generics in your own J2ME code, compile it with 1.5, preverify it, and then run it on a MIDP1/MIDP2 device? Since the type arguments are erased, this could theoretically work, or not?
-- Niek

Theoretically, it should work. However, you might have
to hack the class files before preverification to
change the class file version number from 50 to 48.Don't forget the new APIs, folks: java.lang.Iterable and java.lang.Enum will be needed for the generated code for new-style for-loops and enums, respectively.
But as long as you don't use those features, you may be OK. Also see Toby Reyelts' post and the responses on this in this forum (1.5 code on 1.4 VM).

Similar Messages

  • Use of generics programmiing in J2ME

    Where can I find out when Netbeans will support generics programming for mobile J2ME applications?

    Post it in the J2ME forum to get better response

  • How to upload Generic j2me applicaton tested on Suns WTK  to mobile phone

    Hi,
    Pls help me on how to upload a Generic j2me application tested/working on suns WTK to a mobile phone...
    Example how to install Audiodemo located at the /WTK22/apps into my mobile...Assuming I am using a Nokia/Ericcson mobile phone...
    If anybody knows steps or ways/options on how this is done please let me know...
    Thanks in advance
    Regards,
    Psyeu

    Thanks guys for the info...Actually I'm currently
    using infrared port...err... forgot that thing (kinda obsolete thing to me though)...
    On the other hand, your solutions is almost
    similar...yes... but strange.. how u find that out !!!!
    just kiddin...

  • J2me and generics

    I received this error when compiling my midlet programm in netbeans 5.5
    use -source 5 or higher to enable generics
    this error is for trying to define a generic class such as
    public class NewClass<A, B> {
    but in a normal java application there is no such error!!
    now I want to know :
    does j2me have support for generics or not?

    generics arrived with java1.5 so it could not work properly with j2me which is a
    light java.
    if generics was enabled, you could create Vector<E> but, as you can see in the MIDP
    javadoc, you cannot !!!
    sup@reno

  • J2me help

    Hi
    i am new to the j2me tehnology.But i have been working in the j2ee tehnologies for last one year.In my appliacation we want to have mobile features like if any insertion occuerd in our data base we are showing those appoinments in the jsp.But those insertions also we are trying to show in mobile.Whh topic i should prepare?Pls any one help me in this regard or any one pls guide me .

    Using GCF (Generic Connection Framework) you can easily do what you want. With GCF in mobile you can send your request to its web counterpart (may be a JSP/Servlet/Bean etc) or an Webservice. When u have the response from the server you have to parse it yourself and show the result using a Canvas or some high-level display.
    You can find plenty of tutorials on GCF and also regarding lcdui (the UI) in internet.
    Regds,
    SD

  • Implementation of Shared Libraries on Palm Using J2ME

    Hi,
    I am currently working on the Palm Shared Libraries using C...Kind of drag....so I wonder is there any way to implement this on the Palm using J2ME...
    Thanks and Regards,
    Joseph

    From memory, I dont think that J2ME provides a an implementations at the moment that can access the Palm shared libraries, it's too specific for the generic implementation of MIDP, although I've heard of a PDA profile that SUN is working on, may or may not be true , but it's worth checking out : )
    Vance

  • Generic Connection Framework Optional Package for J2SE

    i have learnt that the Generic Connection Framework Optional Package can be used to make J2SE able to use J2ME classes. However, how can i implement the package so that i can do so.
    Thank you for your advice.

    http://developers.sun.com/techtopics/mobility/midp/articles/genericframework/

  • Signal 11 using thin driver with J2ME

    I'm trying to use JDBC in a client application on a linux appliance using J2ME (CDC, Foundation Profile with optional JDBC package), but when it tries to load the Oracle driver (oracle.jdbc.pool.OracleDataSource) there is a memory fault. I know it's not a memory allocation or memory size problem, because on my desktop it only allocates 300 K, and I have more than 10 Mb free RAM in the appliance, and I changed all possible memory parameters in the JVM initialization.
    At the end of the day, all I need is to connect to an Oracle 8.1.7 database from embedded Linux. Is it possible to use oracle.lite.poljdbc.POLJDBCDriver , the driver for Oracle Lite, instead of the driver in classes12.zip? Will the client work correctly?
    If you have some contact with Oracle and interest in J2ME, I would like to encourage you to visit
    http://jcp.org/aboutJava/communityprocess/final/jsr169/
    and ask your Oracle representative about its support for J2ME and JDBC.
    Regards,
    Gustavo Frederico
    gustavo.frederico at allstream dot com

    Wish to know whether there is a common way to connect to Oracle 11g server using SID or service name.
    Earlier I used jdbc:oracle:thin:@<<server>:<<port>>:<<SID>> for connecting to individual Oracle server instances.
    Now I need to connect to Oracle RAC which provides service names. So I need to use jdbc:oracle:thin:@<<server>:<<port>>/<<service name>>.
    This connection string is internally constructed by a program and user inputs <<server>>, <<port>> and <<SID>> or <<Service Name>>. Now this requires two different connection strings based on the input whether its SID or service name.
    Is there a common connection string for these two? Based on some articles like this, I understood that we can generically use jdbc:oracle:thin:@<<server>:<<port>>/<<service>>, whether for SID and service.
    When I tried this format with SID, I am getting the below error. What I tried is jdbc:oracle:thin:@myoracleserver:1521/ORCL, where ORCL is the SID
    java.sql.SQLException: Listener refused the connection with the following error:
    ORA-12514, TNS:listener does not currently know of service requested in connect descriptor
    Request your help in solving this. What I want is a single connection string whether its SID or service. Any help is of great value.
    Oracle has an entire book for JDBC: The JDBC Developer Guide.
    There are chapters that provide ALL of the connection properties and the rules for creating connection urls.
    http://docs.oracle.com/cd/E11882_01/java.112/e16548/urls.htm#BEIDBFDF
    See table 8-3 in that doc

  • J2ME Security Issue

    Hi,
    My J2ME is using a Password to encrypt/decrypt information.
    During the life of the program, the password is held in a variable in memory.
    This is posing a security problem - if there is another program reading the memory is may find the information.
    I'm looking for a way to "hide" the password.
    Of course, I could ask for the password each time it is required by the program, thus not keeping it in memory afterwards, but this is a usability issue and still the password will be held for a short time i9n memory.
    Another way I though about is - make sure there are no other program that are reading the memory.
    How can I find the currently running programs and suspend them ? How can I prevent a new program from starting ? or issue a message when one is behaving dangerously ?
    Any other idea ???
    Thanks,
    Arnnei

    Sorry, misread your OP and thought this was related to the Preview.app. AFAICT, but never using anything but list view with icon preview disabled, it's just a WAG, the normal ones reside within the apps, the ones with the legend, rtf, rtfd, txt. etc. must be using some generic file image and appending the extension to it.

  • Question about java 5.0 & j2me & wireless toolkit

    Hi,
    I maybe have a dumb question, but to me it's not totally clear. I am currently developing an application (for J2ME and J2SE) which uses RSA encryption. So I found out that before Java 5.0 RSA encryption wasn't supported, but starting from Java 5.0 it is. So my question now is. If I use the RSA encryption from Java 5.0, can I still use it in my cell phone? And which Java version runs in my cell phone?
    It not clear to me, but maybe someone will be so nice to respond...
    Can my/any cellphone run Java 5.0 code? So what if I use the mentioned RSA-cipher... or generics...enumerations... On what does it depend whether I can use it for my cell phone or not?
    Does it just depend on the compiler? the JVM on my phone? or even the wireless toolkit?
    Thank you very much in advance.
    Sincerely.

    bump...
    anyone?

  • Design Patterns, OO Design, and J2ME performance

    Hello- I am a J2ME newbie. I am a design patterny/OO kind of guy using J2SE. I'm trying to create a facade for the business logic on a project I'm working on which will work on both J2ME and J2SE. I have come up with an acceptable design, but I am afraid that the bytecode may end up being way too large for J2ME. For example, I used the command pattern for some functionality, which results in many small Command classes, which is nice for extensibility and functional encapsulation, but creates extra bytecode. Another example is I like to throw specific business exceptions, however, those also require a separate class for each exception. Another example is I like to use TypeSafe enumerations, again, new, unnecessary classes.
    I am aware of some workarounds (create a generic business exception, just put info into the message, don't use the command pattern, use bytes for non-typesafe constants), but I find myself resisting due to my hardcore OO/best practices tendencies. I guess J2ME is a whole different programming paradigm. How are you guys dealing with these issues? The most important issues with J2ME programming are small footprint and high performance, right? I guess I could write more procedural-ish code, but I am interested in any compromises that the OO guys here have come up with. Also, what size is an acceptable library/sdk in J2ME?
    thanks,
    Abraham

    I'm not an OO guy, but I can definitely say that you'll will have to find some comprmises in your designs (the generic business exeption is a very good example).
    Since you are making business apps, you do get some leeway on two issues:
    * As opposed to games, where every cycle counts, for a business app maintainability and scalability are you usually more important than performance, so OO techniques will often be a better choice than a slightly faster implementation.
    * You probably have more control over the devices you will be targetting. The most common limitation for MIDlet size these days is 64KB, so a library that more than 20-30KB probably won't be any good on these phones. But if you know your apps will be run on higher end phones you can make it a lot bigger, since they can often have MIDlets that are up to several MB in size.
    shmoove

  • How to integrate media player in j2me polish

    Hi,
    I have create a media player in j2me. Now I want to integrate media player code into j2me polish project. I tried to integrate the media player with j2me polish project and audio file is playing fine. but while playing video I am not getting the video picture, only voice is cming and it's also giving one exception like this -
    "[j2mepolish] Generic/AnyPhone: Uncaught exception java/lang/ClassCastException"
    If i am going to build.xml and changing the
    usePolishGui="true" to "false".. then I am getting video picture also without any Exception..
    Kindly help me out..
    Thanks,

    Hi,
    I have create a media player in j2me. Now I want to integrate media player code into j2me polish project. I tried to integrate the media player with j2me polish project and audio file is playing fine. but while playing video I am not getting the video picture, only voice is cming and it's also giving one exception like this -
    "[j2mepolish] Generic/AnyPhone: Uncaught exception java/lang/ClassCastException"
    If i am going to build.xml and changing the
    usePolishGui="true" to "false".. then I am getting video picture also without any Exception..
    Kindly help me out..
    Thanks,

  • Suggestion about writing a j2me Bookُ

    i want to write a book about j2me(not english) . I am confused about what topics really need to be covered. it won't be a reference book but a book with 300 pages that makes developers to enter j2me mood.
    I am posting my intended index of the book. Please let me know if you feel that a subject is not important to be covered or there is a subject that should be covered.
    Thanks!
    introduction to j2me
    introduction to CLDC and MIDP
    Architecture of a MIDP application
    high level user interface and events
    data persistency
    low level user interface
    generic connection framework
    optimizing j2me apps
    internationalization
    bluetooth and obex
    SMS and MMS
    Quick introduction to java programming language(Appendix)
    Sample Project(Appedix)

    what do you think about adding an introduction
    to wireless networks and/or m-commerce?I would think that your 2 introductory chapters would tell the readers just about everything they could do with j2me, kind of make them go -- Hey, if I can learn this stuff, I can do that! -- might even be a selling point, I at least glance though the opening chapters when I'm deciding which book to buy.
    That said, I would suggest that you go easy on any restricted API that requires a signed jar --- digital signatures don't come cheap, and your book seems to be targetted at pre-beginners who wouldn't need details on stuff they wouldn't even be able to test without a signature.
    Enough that they know it can be done, but that they can see results only on the emulator, not in the real world.
    Yes, a couple of simple examples on these topics might be well received -- but, within your 300 pages, not at the cost of stuff that the reader can actually build, install and use.
    :D
    edit frog got the [ i ] -- forgot the /
    Message was edited by:
    Darryl.Burke

  • Can I access a generic file from my phone application?

    Hi,
    actually I am writing a small app for my motorola V3i using Netbeans 4.1.
    I need to upload generic data files for my app. Is there any possibility to use non-packaged files in a j2me app? I need them readonly on my phone app, if write access would be possible its even better.
    I have a memory extension card for that phone, so I hoped to create my datafile on the computer in xml or similar format and copy it to the memcard in order to read it from my app.
    Is this possible?
    Thanks You for any helping answers!

    Hello Carmen1390,
    It sounds like you would like to print from your phone directly to a printer. This feature is called Airprint and your printer would need to support that function. Here is some more information on Airprint along with a list of compatible printers:
    AirPrint Basics
    http://support.apple.com/kb/ht4356
    Thank you for using Apple Support Communities.
    Regards,
    Sterling

  • J2ME for PalmOS and WinCE? GPRS?

    Hi all,
    I'm a Java developer for a couple of years, but I really know nothing about J2ME (or JME).
    As a J2ME newbie I'd like to know if there's support for J2ME on PalmOS and Windows CE (Pocket PC). Could somebody point me some resource describing the supported plataforms?
    Is it straightforward to do network communication using GPRS? Is it even possible?
    Thank you!

    Comments inlined:
    As a J2ME newbie I'd like to know if there's
    support for J2ME on PalmOS and Windows CE (Pocket
    PC). Could somebody point me some resource
    describing the supported plataforms?Below mentioned thread link would be helpful:
    http://forum.java.sun.com/thread.jspa?threadID=5150072&messageID=9564193#9564193
    Is it straightforward to do network communication
    using GPRS? Is it even possible?If the above query is pertaining to Java ME. Yes, you can communicate to an http server via GPRS with Java ME enabled device, The network layer and the connection framework is kept quite abstact from application developer perspective.
    Try Generic Connection Framework [ GCF ] in J2ME on the web you'll find plenty of articles.
    ~Mohan

Maybe you are looking for

  • RFC Connection Error (for end-to-end Monitoring)

    Hi, I am configure End-to-End monitoring in XI 3.0 SP20, PMI does't show data in end-to-end monitoring... anyway!!! I check RFC connection PMI RFC destination name: PMIXQA90020080827 in TEST connection I am getting an error: "Group PUBLIC not Found"

  • Confusion in Logical System, port & RFC Destination

    hi, I have still few doubts regarding Logical System, port and RFC destication My SAP ECC6.0 and XI configuration is: For ECC 6.0 : Logical system name : T03CLNT400 Client : 400 RFC Dest : XIDEST Port : XIPORT For XI 3.0 : Logical System name : WXI c

  • HSlider doesn't show initial decimal values

    I have this HSlider: <s:HSlider minimum="0" maximum="1" value=".7" stepSize=".1"/> When my app starts, the Slider ball is at the very far right of the component.  It's reporting the value (.7) properly to an item that's bound to it, it just doesn't d

  • How to make the 22 nd October(Saturday) as a working day

    Hi Experts, Could you please let me know the process to make  coming saturday as working day. As per work schedules..Saturday and sunday s are weekly offs. Due to mgt. s decision we want to make it as a working day. Kindly share your ideas to make ne

  • Windows 8.1 Client Support on SBS 2011 Essentials

    Does anyone know if Windows 8.1 Client PC's are supported or will be (with a forthcoming Update Roll-up) on a SBS 2011 Essentials network? By asking that i mean full support by using the Server Dashboard to manage it and setting up Backup and redirec