Question about System Properties?

Can anyone shed some light apon this, if i have my midlet running in the background
i.e. display set to null.... can j2me read the state of the phone system?
Can j2me read any 'system property' like active/idle/keylocked??
..../fg

Well generically the answer is NO.
There is always a chance that some device manufacturer have supplied (if at all) some API to do this. But I am yet to heard about any device in the market to have this. Only what I heard that Nokia is in its way to supply some API like this with there Series 40 3'rd edition phones (ref. http://developers.sun.com/learning/javaoneonline/sessions/2006/TS-4447/index.html?). But they haven't yet announced anything on the release of it.

Similar Messages

  • Problem\question about System.in and DataInputStream

    Hello everybody,
    I have the following code, trying to read an int and a string into two variables using System.in and DataInputStream:
    package objectIO;
    import java.io.*;
    public class WriteStudentObject
         * @exception IOException Can not read the file
          public static void main(String[] args)  throws IOException
              a loop could be used here to create more than one
              student object and write each one to a file
              Student mary = new Student("Mary Martin", 12345);
              // open inputstream to read data from keyboard
              InputStream is = System.in;
              DataInputStream dis = new DataInputStream(is);
              int  g;
              String c;
              for (int i =0; i < mary.grades.length ; i++)
                  System.out.println("Enter a grade for test" + i);
                  g  = dis.readInt(); //*QUESTION 1*
                  System.out.println("Enter a comment for test"+i);
                  Datainput stream can read String
                 and store as text or reverse
                  c = dis.readUTF(); //*QUESTION 2*
                  mary.grades= new Grade(g,c);
    try
    FileOutputStream fos = new FileOutputStream("c:\\personal\\test\\studentObject.dat");
    ObjectOutputStream oos = new ObjectOutputStream(fos);
    oos.writeObject(mary); // write obj to file
    oos.close();
    } catch(IOException e) {
    System.out.print("Error: " + e);
    System.exit(1);
    The class uses a Student object -attributes are name\String, id\int and Grades (Grade class has grade obtained\int and a comment from the teacher\String).
    My questions are: (as bolded in the code)
    1) at "g  = dis.readInt()" I have to press Enter 3 times to finish the reading (one after entering a single int and then just 2 times Enter). Should I add bellow this line "System.in.read()" to clear the newline\return character?! What exactly does "System.in.read()" clears? After leaving the method readInt() the variable g has an enormous value... like 9 digits... why? I also tried "g  = (int)dis.readInt()" but the results are the same... I want to read an int from keyboard, but using DataInputStream, not with System.in.read()
    2) at this line the program never ends, it tries continuously to read characters... no matter what I enter it does not complete... I want to read a String from keyboard, but again using DataInputStream...
    Many thanks in advance (and hopefully now I can assign the offered stars...)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    don1983p wrote:
    I read an int form keyboard with 'int read_int = System.in.read();' but why I must, after this line, enter a new System.in.read()? (what does this clears? the return character? )Yep. Note that InputStream.read() only reads the next byte of data. If your user had input something that required multiple bytes to represent, you would not have read all of it.
    Fun Fact: Even if you had used Scanner.nextInt() to get your integer from the console, you still need to do a .nextLine() as .nextInt() only reads up to the newline and does not consume it.

  • Question about System.in, FileoutputStream and blocking

    Hello everybody,
    I have written a simple java program that read the System.in and append it to file (which is the first argument of the program).
    Here is the context: my client launch several instance of this program at the same time, with the same file passed in argument. In a first time, I did not use the FileChannel.lock() method because I didn't know there will be several instance, but this is not the question.
    The problem is simple: sometime, I can't figure why (and this is why I'm here to ask you), one of the process block, and stay like this until my client kill it.
    So why? It has something to do with the absence of FileChannel.lock()?
    My client is on Solaris, don't know which version, with a JDK 1.5.0_04
    Here is the code:
    InputStream is = System.in;
    InputStreamReader ir = new InputStreamReader(is, encodingMode);
    BufferedReader reader = new BufferedReader(ir);
    FileOutputStream fos = new FileOutputStream(args[0], true);
    String lineSeparator = System.getProperty("line.separator");
    String buf = null;
    while ((buf = reader.readLine()) != null) {
         fos.write(buf.concat(lineSeparator).getBytes(encodingMode));
    }I think the FileChannel.lock on the output file will solve the problem, but I'm just curious about that odd issue.
    Thanks for help, and excuse me for my bad english.

    Ok, I try to launch 20 occurences at the same time on opensolaris 2009.06 and here is what I've got:
    Error occurred during initialization of VM
    Could not reserve enough space for object heap
    # An unexpected error has been detected by Java Runtime Environment:
    # java.lang.OutOfMemoryError: requested 32756 bytes for ChunkPool::allocate. Out of swap space?
    #  Internal Error (allocation.cpp:120), pid=1603, tid=2
    #  Error: ChunkPool::allocate
    # Java VM: Java HotSpot(TM) Client VM (11.3-b02 mixed mode solaris-x86)
    # An error report file with more information is saved as:
    # /export/home/eric/SocGen/hs_err_pid1603.log
    # If you would like to submit a bug report, please visit:
    #   http://java.sun.com/webapps/bugreport/crash.jsp
    Error occurred during initialization of VM
    java/lang/ClassNotFoundException: error in opening JAR file /usr/jdk/instances/jdk1.6.0/jre/lib/rt.jarI've also got a nice core file and a hs_err_pid1603.log ( here: http://pastebin.com/m513df649
    Funny think is that I can't reproduce it on AIX.
    Hope that can help you helping me.
    Edited by: Eric-Fistons on 13 oct. 2009 13:43
    Edited by: Eric-Fistons on 13 oct. 2009 13:45

  • Urgent Question about System Center Server Names and Dashes

    Hey guys I have a quick Urgent question that would be awesome if it happens to get answered quickly :). 
    So in the past we had problems with different server names in components of System Center when setting up different servers.... I never myself saw the errors or what it did, but an absentee colleague did. For example is anything wrong with a name setup like
    xx-scom-01 / xx-scom-02  as compared to the standard scom01 scom02? We have a certain naming convention we are moving to and I wanted to see if this was fixed. I wanted to say it had something to do with the hyphens... anyways any foresight anyone can
    provide would be awesome. Thanks!

    Dashes in the name will work fine.
    Jonathan Almquist | SCOMskills, LLC (http://scomskills.com)

  • Question about static properties in implementation (.m) file

    I've been using some static properties in my implementation files so they can be accessed by class methods like so for example:
    #import etc
    static Class foo; // <-- Here is where I've been defining static properties
    @implementation Bar
    - init {
    foo = [Class new]; // initialize property
    + getObject { // now any where else in my code I can use [Foo getObject]
    return foo;
    - dealloc {
    [foo release];
    I've been doing this so that in other classes, I can simply go like:
    [Foo getObject]
    Can someone give me some more details about what's going on here though? It's been working but I'm nervous because I don't know much about it.
    ie. What kind of property is it? (nonatomic, retain)? Is this bad practice?
    Thanks to anyone who can shed some light on this.

    First off, it's not a property. It's a static variable. And the code you have isn't a good idea. Static variables should NOT be set via instance methods.
    Think about the following code:
    // In some other class
    Bar x = [[Bar alloc] init];
    Bar y = [[Bar alloc] init];
    Think about what just happened. In the 'foo' class you have now created two 'foo' objects and the first one is now leaked.
    The proper way to initialize static variables is with the 'initialize' class method. This is only ever called once, the first time the class is referenced.
    static Class foo;
    @implementation Bar
    + (void)initialize {
    foo = [[Bar alloc] init];
    - init {
    // Do nothing with 'foo'
    + (Bar)getObject {
    return foo;
    - (void)dealloc {
    // Do nothing with 'foo'
    The only downside, sort of, is that 'foo' is never dealloc'ed except when the app exits. But this isn't typically a problem.

  • Short question about system-id

    Hi everybody,
    how can I get information about the server-id, my web dynpro-application is running on? I need something like sy-sysid in APAP
    Thanks
    Jan

    HI
    String ID = System.getProperty("SAPSYSTEMNAME");
    Try this thread,
    Retrieveing SID programmatically !
    Regards
    Saravanan K

  • Various questions about System Restore Point

    How can I delete old System Restore Points?
    Is it possible to move the folder that holds them to a different drive then C:?
    Can I limit the amount of data System Restore is allowed to have?
    I have downloaded the TreeSize program to see what is using up so much space on my SSD and a folder named "System Volume Information" has 17GB of storage. Now I have found out that this is the folder that keeps System Restore Points and I checked
    on my restore points. There are too many of them and I was wondering if I could delete some of the old ones? I read on another post that someone said that you could limit the amount of data System Restore is allowed to use. Is this possible?
    Best Regards.

    Hello HurricaneHojax,
    Here I list the requirement, and please correct me if I have misunderstanding:
    1. Delete some System restore point
    2. Move the folder that hold system restore data to a different drive then C:.
    3. Limit the amount of system restore data.
    1, We can delete some system restore point.
    For more information, please take a look at the following article.
    http://windows.microsoft.com/en-hk/windows/delete-restore-point#1TC=windows-7
    2,We are not able to move the system restore folder to other Drive.
    3, We can limit the amount of system restore data.
    For more information, please take a look at the following article about managing the disk space that is used by System Restore.
    http://windows.microsoft.com/en-hk/windows7/how-much-disk-space-does-system-restore-require
    Best regards,
    Fangzhou CHEN
    Fangzhou CHEN
    TechNet Community Support

  • Questions about System Requirements for Adobe Air programs

         Earlier today I asked someone who runs Tweetdeck if they knew what the system requirements were for running Tweetdeck on my desktop (Windows)
    they gave me a link here: http://www.adobe.com/products/air/systemreqs/
    and I found this:
    Windows
    2.33GHz Intel® Pentium® 4, AMD Athlon® 64 2800+, or faster processor
    Microsoft® Windows® XP Home, Professional, or Tablet PC Edition with  Service Pack 3; Windows Server® 2003 or 2008; Windows Vista® Home  Premium, Business, Ultimate, or Enterprise (including 64-bit editions)  with Service Pack 2; or Windows 7
    512MB of RAM (1GB recommended)
    Here are my computer statistics:
    Operating System: Windows Vista™ Home Basic (6.0, Build 6001) Service Pack 1 (6001.vistasp1_ldr.101014-0432)
               Language: English (Regional Setting: English)
    System Manufacturer: Hewlett-Packard
           System Model: Compaq Presario CQ60 Notebook PC
                   BIOS: PhoenixBIOS 4.0 Release 6.1    
              Processor: AMD Athlon Dual-Core QL-65 (2 CPUs), ~2.1GHz
                 Memory: 2814MB RAM
              Page File: 1858MB used, 3993MB available
            Windows Dir: C:\Windows
        DirectX Version: DirectX 10
    DX Setup Parameters: Not found
         DxDiag Version: 6.00.6001.18000 32bit Unicode
    Will me only having a 2.1GHz processor really affect how my performance is with Adobe Air products/apps in general?

    Yes- I've had some lower price pc's using an Adobe AIR app and can tell the difference.
    Computers where performance was a huge issue was Compaq CQ56 & Toshiba Satellite C655D
    These computers are under 2.0 GHz and the app seems to freeze up on occassion or run slower.

  • A question about page properties

    I am new to dreamweaver going through tutorial.
    In the book it tells me to modify page properties. The pop up window on my computer shows up differently than in the book. see attachment of screen shot from my computer
    In the book it is different.
    1. Category - Appearance has controls for typography, that is not on mine
    2  Category also shows access to Links and Headings between Appearance and Title/Encoding
    I am working in dreamweaver 8 but have also opened up dreamweaver CS3 and it comes up the same way.
    I use a Macbook Pro OS X.4.11.
    Help !

    I'm wondering if somehow toggling the HTML/CSS preferences might get your dialog box to match the one you see in the book. See this Help page for more info, make the switch, and then open the dialog box again to see if that works.
    http://livedocs.adobe.com/dreamweaver/8/using/13_page9.htmhttp://livedocs.adobe.com/dreamweaver/8/using/wwhelp/wwhimpl/js/html/wwhelp.htm

  • Question about system catalog tables in oracle 11g database

    We have a customer issue and in order to trobleshoot that we need following information. We would really appreciate any input. I opened SR with support and they asked me to open a discussion here. Please see following.
    what is the meaning of the part# column of the sys.tabpart table and what are the possible values that can be entered into this system catalog table. Our findings are that Oracle may have varied the meaning of this column as the data that we are seeing returned is now > 2gig which does not make sense for a partition number.
    Our stored procedures use this information to retrieve information from the Oracle system tables to process a partitioned Oracle table. Our research has found that the limited description for this table (and columns) can be found in the following Oracle member at the following location:
    dpart.bsq --> ...... oracle database path... \RDMS\ADMIN folder
    The comment within this file notes the following:
    " this value is "partition number (see discussion below)"
    However, there is no additional discussion to describe what the value means and the possible variations. We need this information to move forward with our problem diagnosis and
    to see what kind of updates we need to make for our stored procedures....
    Thanks a lot in advance.
    Avni

    I ran the following....
    list expired archivelog all; - This showed all of the archivelogs that we were not able to validate...
    delete expired archivelog all; This deleted the expired archivelogs that were reported from the previous command...
    I then crosschecked the archivelogs by running the following:
    crosscheck archivelog all;
    Thank you for your help!

  • A question about log4j.properties

    Normally I put the log4j.properties inside my web-application such as under WEB-INF. So it will be packaged into the WAR.
    But now I want to take it outside of the WAR and put it under a dir and furthermore I change its name to "myLog4j.log4j.properties". This has two advantages:
    1.
    One can change the contents without opent the WAR.
    2.
    Under this dir the other projects can put their xxx.log4j.properties so they can be managed easily.
    But I don't know where should I put this file and how to configure the server sothat the server can find this file and my program can write all the log infos into the log-file defined in the "myLog4j.log4j.properties".
    Can someone help?
    Regards

    Actually file log4j.properties should be in the classpath, that classloader could see it. Add the path to file into CLASSPATH.
    Thanks

  • Questions about system connections

    Would someone help me clarify something?
    When the ECC QAS system has been copied from the PRD system, the connection between the ECC QAS and the BID system is broken. I was told by Basis that after the copy, the connection has to be restored, and for some reason restoring the connection between the QAS and the BID system, the InfoSources and their transfer rules are completely wipe out from the system.
    We are using the business contents and have not yet did the migration.
    I am not sure why restoring the connection between the ECC and BID system would cause the InfoSources to de deleted. Has anyone come across this problem? Is it something that Basis can prevent from happening? I have not seen this from BW 3.5.

    Hi,
    We tried your suggestions but it is still wiping out the InfoSources. We are aware that the broken connection between the ECC and the BI systems will allways occur when we do a copy. Restoing the connection between the ECC and BI systems is causing the wipe out of the InfoSources.
    We're asking if anyone has come across this problem and was able to fix it,
    Quote of the day:
    "Arrogant idiots go to hell..."

  • Question about system requirements with upgrade

    I want to upgrade to Leopard which has iLife '08 but as I was reading about iMovie '08, it says that the minimum processor spec is a g5. You can see in my signature, my Powerbook is a g4, will iMovie not run at all (or very well even) or will the installer give me an option not to install the entire iLife'08 suite over what I have right now? Thanks!

    As the Prime Minister has pointed out Leopard doesn't include iLife 08. It is a separate $79 purchase.
    Your G4 (and mine) can't even install iMovie 7 so a purchase would do you no good.
    But, if you bought a new Mac it would come installed with Leopard ($129) and a free version of iLife 08.
    Over $200 in savings right off the bat!

  • Question about System.in.read()

    Hello Everyone,
    I am having a problem with System.in.read(). I want it to produce an int value, however when I use it the value always comes out to 49.
    class Lawn2
         public static void main(String []args) throws Exception
              int lawnSize, lawnPrice, weeklyAmt, length, width;
              length = 50;
              width = 10;
              System.out.println("Enter Width");
              width = System.in.read();
              System.in.read();
              System.in.read();
              System.out.println("You entered " + width);
              lawnSize = length * width;
    }

    Obvious as System.in.read() reads a byte and converts to ASCII equivalent when assigning to Integer.
    Here is a sample code that shows one of many ways of reading input console data
    import java.io.*;
    class Lawn2{     
         public static void main(String []args) throws Exception     {          
              int lawnSize, lawnPrice, weeklyAmt, length, width;          
              length = 50;          
              width = 10;          
              System.out.print("Enter Width : ");     
              BufferedReader ln = new BufferedReader (new InputStreamReader(System.in));
              width = Integer.parseInt(ln.readLine());
              System.out.println("You entered " + width);          
              lawnSize = length * width;
    }

  • XApps Analytics 1.1 Ramp Up Question about Systems

    Hi,
    have installed xApps Analytics 1.1 Ramp Up version of VC ok and got some basic models working against the standard SAP_BW system which was already configured with NW2004s for single sign on with BW.
    I have added two new systems in the portal (one JDBC and one SAP R/3) under Systems in System Configuration. These test fine from within the portal.
    However, within VC when I got to Find Data I still only have one system (SAP_BW) in the drop down.
    Any ideas? Have stopped and started with no effect.
    Many thanks,
    AB

    Yep. Tried everything within my repertoire now!
    I further thing - I have setup user mapping user admin,user via user j2ee_admin.
    I am logging on as a VC user with the VC Role.
    Could this be anything to do with it?
    Regards,
    AB

Maybe you are looking for

  • Toolbar Button not Appearing in Plugin

    The following code is not producing a button in the file toolbar in Acrobat 8 Professional, despite being called from PluginInit: bool AddToolbarItems() AVToolBar toolBar = AVAppGetToolBar(); AVToolButton endToolsGroupButton; //No tool bar? if (!tool

  • [SOLVED]Choppy to no sound

    I have a strange problem with my Toshiba/intel laptop. If I play a mp3 in XMMS there is no sound. If I jump out in the song there is a 1.5 sec sound (the mp3) witch repeats 2 times rapidly. Then there is silence until I jump in the song again. What c

  • Help in wriring an sql

    Hi gurus, just wondering whether this sql works fine. Insert into contact_history@demo (narrative) select substrb(narrative,1,4000) from CONTACT_HISTORY where I in (select i from missing_ivalue) where demo is a dblink for source and the target databa

  • When opening SSMS 2014 getting the following error:

    Hi, I have installed SQL SERVER 2014 and the installation was successful. When I tried to open the SQL SERVER Management Studio SSMS 2014 and as soon as when clicked on connect to server, I am getting the following error message : Service 'Microsoft.

  • Macromedia Director 6 in Windows 7?

    Is there any way to run Macromedia Director 6 in Windows 7?