Will �cross platform app� run on one platform?

Hi there,
please forgive my stupidity but if I have a J2ME app which contains one function calling functions from Blackberry library. Can this app be installed and run ok on non Blackberry phones, such as Nokia (suppose that Blackberry related code will not be called under this non-Blackberry phone), within Nokia emulator environment, or real Nokia phones?
It would be much appreciated if someone could shed some light here so that my time and effort to try it out could be saved.
Many thanks in advance,
qmei from London

Here, let me actually be helpfull...
It depends on the phone.
To be able to use the exact same app in multiple devices, when some are calling device specific code is possible, but it really does depend on a few factors...
1) You must not ever reference or instantiate any classes that import the device specific libraries. If any such classes are referenced directly in your application, the offending class will be loaded into memory, at which point the device's VM will notice that it's trying to reference a library that it doesn't recognize, and likely crash out.
2) You must only load such offending classes by name, and even then, there must only reference offending classes through an interface. So if you have a canvas class that imports nokia libraries, as well as other canvas classes that import other manufacturer libraries, you must make them all implement the same interface, and do something like this...
try{
Class cls = Class.forName("com.nokia.mid.ui.FullCanvas");
cls = Class.forName("NokiaGameScreen");
Object o = (cls.newInstance());
gameScreen = (GameScreen)o;
gameScreen.init(this);
}catch(Exception e){
//cant' use nokia!
//try another manufacturer...
}... so I'll explain in greater detail...
1) Class cls = Class.forName("com.nokia.mid.ui.FullCanvas");This line with throw an exception if no class matches the supplied argument. Generally you'd do something like this to check for the existance of one of the classes you intend to import. If this line does not throw an Exception, than instantiating the desired display should be fine. In this case, if we don't throws an Exception, we can be sure that we are running on a Nokia device.
2) cls = Class.forName("NokiaGameScreen");This line actually grabbs the class you intend to instantiate, which contains the offending import. Only when we reach this point does the VM load the class into memory, and validate it's imports. We have already determined that we are running on a Nokia device from the previous line.
3) Object o = (cls.newInstance()); Get an instance of the desired class.
4) gameScreen = (GameScreen)o;gameScreen is of the type 'GameScreen', which is an interface I defined and is implemented by all of my different manufacturer/device specific Canvas's.
5) gameScreen.init(this);I am simply calling the 'public void init(Midlet)' function I created that is exposed through my 'GameScreen' interface.
As you can see in the above example, I never directly reference the 'NokiaGameScreen' class, and instead indirectly reference it through an interface it's implementing called 'GameScreen'.
This type of 'cross platform' coding works well on many, but not all devices. It's a headache, but some devices go through the entire .jar file and validate each and every .class file during the installation process. These annoying phones will cancel the install if they find any imports that are not recognized. So even if the class is simply accidentally left in the .jar, with no possible way to ever load or instantiate it, the device may decide it won't let you run or install.
Because of the problem devices, I always create a separate build for each manufacturer, and exclude the other manufacturer's classes from the build entirely.
Message was edited by:
hooble

Similar Messages

  • Multiple Java apps running in one VM

    I have one VM that runs one application with GUI, database. It also spawns another VM to run more apps through Sockets.
    Is there a way to run several Java apps within a single VM? If so, I can get rid of those interprocess communication stuff and make things easier.
    Thanks in advance.
    Lee

    Yes you can do what to want to do. It is actually very benificail. Take a look at this article:
    http://java.sun.com/docs/books/performance/1st_edition/html/JPClassLoading.fm.html#24732
    here is code to do it as well:
    package com.ist.system;
    import com.ist.util.LogMsg;
    import java.io.IOException;
    import java.io.OutputStream;
    import java.lang.reflect.Method;
    import java.net.InetAddress;
    import java.net.Socket;
    * This class was pulled from:
    * http://java.sun.com/docs/books/performance/1st_edition/html/JPClassLoading.fm.html#24732
    * It was written to provide the ability to launch many applications in the
    * same JVM.  By doing this, it will save on system resources like RAM.  When
    * the <code>launch</code> method is called, it will check to see if there is a
    * VM already running.  If there is, it will launch the new application in the
    * currently running VM.  If there isn't, it will create a process that will
    * keep a VM alive until there are no more applications running.  Once there are
    * no more applications running, this service will System.exit. 
    public class Launcher {
        static final int socketPort = 9876;
         * This method will launch a new instance of the passed in className
         * in an already running JVM if one is already running.  If one is not
         * running, this application will create one.
         * @param className the class which you wish to launch
        public void launch(String className) {
            LogMsg.shortDebug("Trying to launch: " + className);
            Socket s = findService();
            if (s != null) {
                LogMsg.shortDebug("Launcher found service");
                try {
                    OutputStream oStream = s.getOutputStream();
                    byte[] bytes = className.getBytes();
                    oStream.write(bytes.length);
                    oStream.write(bytes);
                    oStream.close();
                    LogMsg.shortDebug(className);
                } catch (IOException e) {
                    LogMsg.warn("Launcher couldn't talk to service");
            } else {
                LogMsg.event("Starting new service");
                Launcher.go(className);
                Thread listener = new ListenerThread();
                listener.start();
                LogMsg.shortDebug("Started service listener");
        protected Socket findService() {
            try {
                Socket s = new Socket(InetAddress.getLocalHost(),
                socketPort);
                return s;
            } catch (IOException e) {
                // couldn't find a service provider
                return null;
        public static synchronized void go(final String className) {
            LogMsg.shortDebug("Launcher running a " + className);
            Thread thread = new Thread() {
                public void run() {
                    try {
                        Class clazz = Class.forName(className);
                        Class[] argsTypes = {String[].class};
                        Object[] args = {new String[0]};
                        Method method = clazz.getMethod("main", argsTypes);
                        method.invoke(clazz, args);
                    } catch (Exception e) {
                        LogMsg.shortDebug("Launcher coudn't run the " + className);
            }; // end thread sub-class
            thread.start();
            runningPrograms++;
        static int runningPrograms = 0;
         * All programs wishing to exit should call this method and NOT
         * use System.exit.  Calling System.exit will kill all the applications
         * running in this VM.
        public static synchronized void programQuit() {
            runningPrograms--;
            if (runningPrograms <= 0) {
                System.exit(0);
        public static void main(String[] args) {
            LogMsg.setupTraceLevel();
            Launcher l = new Launcher();
            l.launch(args[0]);
    }

  • Will my java app run on winXP win 2000 ?

    or do they need to first install the jvm ?

    Java platform runs on any operating system. Install JVM and you are done
    http://www.skillipedia.com

  • Will Creative Cloud apps run on a laptop with an Intel Celeron N2820 processor?

    I need to know if my Creative Cloud apps, specifically Photoshop, Illustrator and Dreamweaver, will run on a laptop with these specs:
    Intel® Celeron® processor N2820
    Features a 1MB cache and up to 2.39GHz processor speed.
    4GB DDR3L memory
    For multitasking power, expandable to 8GB.
    Battery Type6-cell lithium-ion
    Display TypeHigh-definition widescreen LED-backlit TFT with TruBrite technology (1366 x 768)
    Screen Size (Measured Diagonally)15.6"
    Cache Memory1MB
    System Memory (RAM)4GB
    System Memory (RAM) Expandable To8GB
    Type of Memory (RAM)DDR3L
    Hard Drive TypeSATA (5400 rpm)
    Computer Hard Drive Size500GB
    Optical DriveDouble-layer DVD±RW/CD-RW
    Optical Drive SpeedsDrive speeds not specified
    Direct-Disc LabelingNo
    Digital Media Reader or SlotsYes, digital media card reader
    GraphicsIntel® HD

    Yes, it supports all the necessary features, it just won't be particularly speedy or smooth in resource-hungry programs like PS.
    Mylenium

  • Will xfinity mobile app run on a tablet

    I just bought a Digiland Microsoft Tablet. I can't open my comcast e-mail. I can get onto the comcast mail but when I try to open the e-mail, it won't allow me. Would the xfinity mobile app work on my tablet?

    rpgirard wrote:
    I just bought a Digiland Microsoft Tablet. I can't open my comcast e-mail. I can get onto the comcast mail but when I try to open the e-mail, it won't allow me. Would the xfinity mobile app work on my tablet?   I think you'll need to use the browser to log into your Xfinity account and then you'll   be able to watch that way. Good luck!

  • APP RUN REVERSAL

    Hi,
    Is there a possibility of reveresing all the postings of a successful APP Run at one go. What is the procedure to be followed for deleting the earlier check information and updating with new check information.
    Regards,
    Murthy

    Hi,
    You can try transaction code FCHD. Also see the documentation at the link:
    http://help.sap.com/saphelp_erp2004/helpdata/EN/01/a9d134455711d182b40000e829fbfe/frameset.htm
    Thanks
    Murali.

  • Can you run SCO UNIX platform apps on 10.4?

    Just wodering if it is possible to run SCO UNIX platform apps on a Mac?
    I have 2 applications designed to run on SCO UNIX and I would be interested to see how they work.
    I don't know anything about the us of UNIX BTW
    G4   Mac OS X (10.4.4)  

    Hi Atlantean,
       It's certainly not possible to run a precompiled binary and SCO isn't exactly known for their open source community spirit. They'd probably sue you. I'm a little surprised that you'd mention them in polite company.
    Gary
    ~~~~
       "Spare no expense to save money on this one."
             -- Samuel Goldwyn

  • I need to uninstall Captivate update 7.0.1 becuase my quizzes will no longer run on any platform bro

    I need to uninstall Captivate update 7.0.1 becuase my quizzes will no longer run on any platform browser.
    The reason they do not run is becuase LMS API will not load the quiz. because of a java script error (see image below)
    The new update 7.0.1 has drastically changed the following files:
    imsmanifest.xml
    index_SCORM.html
    SCORM_utilities.js
    Utilities.js
    The new script just will not run on Firefox 26
    Internet Explorer 10 and 11
    Chrome 31.0.1650.63m
    Safari 5.1.7
    How do I uninstall this update and get back to the earlier version or is there something that will fix this?
    Claire

    you would uninstall your current version and then reinstall the previous version, but there may be a better way to handle that error.
    post on the captivate forum to check, http://forums.adobe.com/community/adobe_captivate

  • Slowness of Netbeans Platform Apps - how to mitigate?

    Hi,
    We are developing a commerical application (pretty complex) in java using Netbeans IDE. We have 2 options in netbeans to create it-
    1. Develop Java desktop app
    2. Netbeans Platform app
    We have requirement that application startup and response times should be very very fast, should be modular etc. We did Proof of Technology by creating apps using both approaches mentioned above. We found Netbeans platform apps are very slow during startup and during screen navigation compared to pure Swing based desktop apps. We tried to implement suggestions provided at http://wiki.netbeans.org/Category:Performance:FAQ and in other blogs and forums to improve on speed of the app but were not successful.
    We feel for creating a complex desktop app Netbeans platform app would be better suited, but its not meeting our performance requirements (startup and response times, memory footprints, CPU usage guidelines etc).
    Can any one guide us on how to mitigate our problem of improving performance of Netbeans Platforms apps?
    Thanks in advance for your help..
    - bhan

    This question really belongs in a Netbeans forum for any serious answers. That being said I can still give my opinion.
    I really doubt that you can improve it through software. Netbeans has to initialize and validate a complex module system during startup and the more modules that have to be started, to more time it will take. Recently OSGi support was added to Netbeans as an alternative to Netbeans' native module system; perhaps that can help, but again I doubt it.
    Let me put it in another way: I was following the 10 example videos that demonstrate how to use the Netbeans platform, and even the small test applications that were developed took several seconds to boot. It is one of the arguments I have for myself to not adopt the platform myself - not that I care about the startup time of the end product, but because I already predict high annoyance levels during development.

  • How can i register my New Ipad with two different device running on windows platform.

    can i register my ipad with my home lappy and my office desktop running on windows platform.so that there will be no issue while syncing my ipad with two differenr device.

    Bernard Baz wrote:
    Is there a 3rd party app that could help and that would not relie on iTunes.
    Use iCloud to backup the iPad. Many users don't use their iPads with iTunes at all anymore. Personally, I would never rely only on iCloud, but I would guess that millions of iOS users are now using only iCloud and not backing up with iTunes at all.
    iOS: How to back up and restore your content - Support - Apple

  • Know more detail about the Remote Support Platform for SAP Business One ?

    SAP Business One 9.1 is about to release this year and we can see in the feature enhancements that a significant update is planned in the Remote Support Platform for SAP Business One, more commonly known as RSP. Let’s have a quick look what update is planned for RSP in version 9.1:
    Enhancements planned in Remote Support Platform for SAP Business One 9.1
    RSP is planned to support both SAP Business One on Microsoft SQL Server as well as SAP Business One on HANA Database
    RSP Processes and Reports adapted to SAP HANA Database
    With this plan RSP will help in the areas of Download, Installation, Go-Live Check, Monitoring, Upgrade and Support for SAP Business One both   on SQL Server and HANA.
    But like me (non-SAP B1 Consultant) many of you have the question what is RSP and how it helps in support? Here I have tried to gather all information.
    What is Remote Support Platform for SAP Business One?
    The remote support platform for SAP Business One is designed to protect a SAP Business One installation by providing automated and remote support in a high-volume business.
    The platform monitors the entire SAP Business One environment. By significantly reducing the time between the appearance, identification, and resolution of issues, the remote support platform for SAP Business One minimizes the impact on customer databases and processes.
    Some Key Features of Remote Support Platform:
    Showing alerts to SAP B1 Admin about the events which require their attention, such as low disk space, database backups, etc.
    Incident Reports against the issues identified which require attention of SAP Support
    Company Database Backup and Restore options
    Regular fixes of Company Database inconsistencies
    Check, Download and Install regular updates in SAP Business One
    Upload Logs and required files to SAP Support or to Partner Support on regular basis
    Some details about RSP Backup Management
    Schedule daily, weekly, and monthly backups
    Perform differential and full database backups
    Back up transaction logs
    Back up files to shared folders on a network
    System Status Report through RSP
    From June 1st 2013, it will be mandatory to install, configure and upload the System Status Report (SSR) from Remote Support Platform (RSP) for SAP Business One in order to receive support for messages of a technical nature (upgrades, performance & crashes, etc).
    Database uploads only via RSP
    From June 1st 2013 SAP Business One Support will only accept database uploads to SAP via remote support platform for SAP Business One. In certain exceptional circumstances STFP may be used but this will constitute a minority of cases.
    Microsoft Windows PowerShell Scripting
    In the remote support platform studio, you can create tasks using Microsoft Windows PowerShell scripting. PowerShell enables you to perform remote administrative tasks on customers’ Microsoft Windows operating systems, by providing full access to Component Object Model (COM) and Windows Management Instrumentation (WMI).Some Network Prerequisite for RSP
    To achieve the internet connection test, you must allow port 80 for the RSP external communication
    Disabling antivirus firewall or add the RSP to the trusted zone of the antivirus
    Set the correct proxy
    Disabling Windows firewall in the TP_link Wireless Configuration Utility
    Want to now More about It Click Here :   Remote Support Platform for SAP Business One

    SAP Business One 9.1 is about to release this year and we can see in the feature enhancements that a significant update is planned in the Remote Support Platform for SAP Business One, more commonly known as RSP. Let’s have a quick look what update is planned for RSP in version 9.1:
    Enhancements planned in Remote Support Platform for SAP Business One 9.1
    RSP is planned to support both SAP Business One on Microsoft SQL Server as well as SAP Business One on HANA Database
    RSP Processes and Reports adapted to SAP HANA Database
    With this plan RSP will help in the areas of Download, Installation, Go-Live Check, Monitoring, Upgrade and Support for SAP Business One both   on SQL Server and HANA.
    But like me (non-SAP B1 Consultant) many of you have the question what is RSP and how it helps in support? Here I have tried to gather all information.
    What is Remote Support Platform for SAP Business One?
    The remote support platform for SAP Business One is designed to protect a SAP Business One installation by providing automated and remote support in a high-volume business.
    The platform monitors the entire SAP Business One environment. By significantly reducing the time between the appearance, identification, and resolution of issues, the remote support platform for SAP Business One minimizes the impact on customer databases and processes.
    Some Key Features of Remote Support Platform:
    Showing alerts to SAP B1 Admin about the events which require their attention, such as low disk space, database backups, etc.
    Incident Reports against the issues identified which require attention of SAP Support
    Company Database Backup and Restore options
    Regular fixes of Company Database inconsistencies
    Check, Download and Install regular updates in SAP Business One
    Upload Logs and required files to SAP Support or to Partner Support on regular basis
    Some details about RSP Backup Management
    Schedule daily, weekly, and monthly backups
    Perform differential and full database backups
    Back up transaction logs
    Back up files to shared folders on a network
    System Status Report through RSP
    From June 1st 2013, it will be mandatory to install, configure and upload the System Status Report (SSR) from Remote Support Platform (RSP) for SAP Business One in order to receive support for messages of a technical nature (upgrades, performance & crashes, etc).
    Database uploads only via RSP
    From June 1st 2013 SAP Business One Support will only accept database uploads to SAP via remote support platform for SAP Business One. In certain exceptional circumstances STFP may be used but this will constitute a minority of cases.
    Microsoft Windows PowerShell Scripting
    In the remote support platform studio, you can create tasks using Microsoft Windows PowerShell scripting. PowerShell enables you to perform remote administrative tasks on customers’ Microsoft Windows operating systems, by providing full access to Component Object Model (COM) and Windows Management Instrumentation (WMI).Some Network Prerequisite for RSP
    To achieve the internet connection test, you must allow port 80 for the RSP external communication
    Disabling antivirus firewall or add the RSP to the trusted zone of the antivirus
    Set the correct proxy
    Disabling Windows firewall in the TP_link Wireless Configuration Utility
    Want to now More about It Click Here :   Remote Support Platform for SAP Business One

  • Can you update an iOs app and change its platform offering from iPad/iPhone to just iPad?

    When building a new app with Adobe DPS to update an existing app, can you update an iOs app and change its platform offering from iPad/iPhone to just iPad?

    Vinod is correct in that you can build a new app that's iPad-only, but if you try to submit it as an update to the existing app, Neil is correct--Apple will reject it because it's considered a downgrade. You either need to stick to the universal app and do something like create a single iPhone folio that refers users to the iPad, or you need to submit it as a new app.

  • I have a new computer and want to sync my iPhone's apps. when I tell it to do so it says that all apps in my phone will be replaced by the ones in iTunes, but it's empty because it's new. If I do so will all my apps be deleted?

    I have a new computer and want to sync my iPhone's apps. when I tell it to do so it says that all apps in my phone will be replaced by the ones in iTunes, but it's empty because it's new. If I do so will all my apps be deleted?

    Transfer purchases over from your phone to your computer before you sync your apps. See Transferring Purchases for more details.

  • HT1751 i bought a new, larger external hard drive. copied my itunes library from the old drive to the new one, changed the libarary location in Edit/Preferences/Advanced to the new drive. iTunes will not start or run unless old hard drive plugged in.??

    I bought a new, larger external hard drive. I have my iTunes library on the external drive instead of C: drive, Using Windows 7.
    I copied my itunes library from the old drive to the new one, changed the libarary location in Edit/Preferences/Advanced to the new drive.
    iTunes will not start or run unless the old hard drive is plugged in.
    If I disconnect the old drive iTunes shuts down.
    Any ideas. ??

    Hello kskip,
    Thank you for providing so much information about what is going on.  It sounds like you have setup iTunes to save new content to your new external hard drive in iTunes>Preferences, but it sounds like iTunes is not opening iTunes Library.itl file on the new external drive.  You have one last step to take to have iTunes point to your new external hard drive rather than your old one:
    Steps to create or choose a different iTunes Library file
    If iTunes is running, quit iTunes.
    If you are using Windows, hold down the Shift key and from the Start menu and choose All Programs > iTunes > iTunes.
    You should see the following screen:
    Additional information
    If you do not see the screen above, then you did not hold the correct key at the correct time. You may want to try again. Note that if you pinned iTunes to the Start menu programs, and open it that way, it may not work.
    Once you select "Choose Library," you will need to navigate to the iTunes Library.itl file on your new external drive. 
    You can find the full article here:
    iTunes: How to open an alternate iTunes Library file or create a new one
    http://support.apple.com/kb/ht1589
    Thank you for using Apple Support Communities.
    Best,
    Sheila M.

  • When I try to sync photos, I followed all the steps, picked one folder.  When I hit "apply" I get this error message: Are you sure you want to remove 30 apps from iPad.  This will delete these apps and their data from the iPad. What have I done wrong

    When I try to sync photos or music, I followed all the steps, picked onle folder, not the whole library.  When I hit "apply" I got this message:
    Are you sure you want to remove 30 apps from iPad.  This will delete these apps and their data from the iPad" What can I change to just download the photos and not interfere with the apps?
    (By the way, the memory is not even one quarter full)
    Thanks for your help - Pat

    I have the same problem.  I updated my mac to 10.5, which then had me update apps like itunes, etc. then it wanted me to sync my purchased music to my ipad before i updated the ipad...which worked ok. then when i was syncing the photos i got the same message when i hit "apply" asking are you sure you want to delete the 12 apps from the ipad -  clicked "no" and brought me back to the original screen. Got the same message when trying to move them from the hard drive to the ipad.  WHat is going on and how do I correct this? Thanks

Maybe you are looking for

  • Proxy to SOAP scenario-With Attachment and Mapping

    I have a scenario to be developed, it is a Proxy to SOAP sceanrio. There are about 8 fields coming from Proxy. Can we create an attachment from these fields. Also we have to do a mapping of this attachment to a field in the target External Defination

  • Using iWeb FTP results in nested site...

    I'm sure I'm just being a dummy here... but I'm lost. I'm using iWeb v3.01 to upload a site to a non-.mac host (bluehost.com). The uploads proceed without a hitch, no problem. Let's call it "www.genericsite.com." But when I go visit the site just upl

  • Png files placed into PS CC don't honour effects

    G'day, I am totally lost on this one and can't for the life of me work it out. I'm creating graphics in IDCC which are then exported out as png files to be placed into PS CC, the problem occurs when some placed images have opacity effects within them

  • Using iWeb to publish to a non mac account

    I guess the question is in the subject. I'm just wondering if it is possible to use iWeb to create your website, but then send it to a different domain/server?

  • Html file blank on secondary computer

    I'm stumped on this. I just sent a website I had built in dreamweaver using a fluid grid layout to a client just to show him the work in progress. It is working fine from my computer however he is seeing a blank index file in his browser. I'm 100% su