Settings in MIDP

Hello
I'm trying to build a settings class for mobile devices, but the problem is that I found only one possibillity to save settings, and that's record stores. Record store's draw back is that I shall read my settings with record's associated id, so I must remember the id for every settings. I dont understand how can i do this, anyone can help? thanks :)

you think that it is urgent but it is not so urgent !!
you are not the only one...
so, create a custom class Settings
* Exemple to show that it s possible to store all the parameters settings
* in a java class called <code>Settings</code>. This class contains
* the login, the password, the host ...
* @author <your_name>
public class Settings{
  // contains all the stuff needed for your connexion
  private String login;
  private String ...
  public Settings(...){
    // fillin the class
}and in your MIDlet..
RecordStore rs = null;
Settings settings=null;
try {
  rs = RecordStore.openRecordStore( rsName, false );
  treateRS(rs);// treate the RecordStore
} catch( RecordStoreException e ){
  // print the exception
} finally {
  try {
    rs.closeRecordStore();
  } catch( RecordStoreException e ){
    // Ignore this exception
public void treateRS(RecordStore record){
  // get the Settings object, analyse it,etc ...
}is it clearer?
check these links for more infos on RecordStore...
http://developers.sun.com/techtopics/mobility/midp/articles/databaserms/
http://developers.sun.com/techtopics/mobility/midp/articles/databasemap/
(links come from http://developers.sun.com/techtopics/mobility/allarticles/#databases)

Similar Messages

  • Proxy Settings using MIDP

    Hi,
    Where should i set the username and password for proxy using MIDP.Actually i need to connect to a url.i need to connect to this url thru proxy.
    Regards
    Srinivas.P

    Hi,
    You have to connect through your application to the proxy server and from there to the destination server. There is no support for proxy servers in MIDP.

  • New to Java. Want to write a simple applet for a mobile phone.

    Hello,
    I want to write a simple java applet for a mobile phone. currently I am in the stage of thinking about whether this is possible in a timeframe of about a month. I have very little java experience from a while back so I'm pretty much starting from scratch.
    All I want is an applet that lets you send 2 or 3 variables to an online server. The server will then reposition telescopes.
    All i'm concerned with is the mobile phone part, which doesn't have to be secure or impressive. Just a simple interface.
    Ideally it should work on my nokia 6070, which occording to the official specs has the following java technology:
    MIDP 2.0
    CLDC 1.1
    JSR 120 Wireless Messaging API
    JSR 135 Mobile Media API
    Nokia UI API
    (I don't know what any of this means but am a good learner).
    Can anyone offer me any advice? Is this possible in my timeframe? where should I start? I need a editor and compiler also (I'm using windows XP).
    Many thanks and kind regards,
    Jason

    Actually it is working on my phone now.
    I changed the target platform in the wireless toolkit settings to MIDP 1.0
    Now to create the fields coordinate fields etc. I don't have much of a clue really.
    Current I have:
    import java.io.*;
    import javax.microedition.lcdui.*;
    import javax.microedition.midlet.*;
    public class AtmosMIDlet extends MIDlet implements CommandListener
    Form WelcomeForm = new Form("AtmosMIDlet");
    StringItem WelcomeMes = new StringItem(null, "Please enter coordinates:");
    TextField Longitude = new TextField("Longitude", "", 3, TextField.NUMERIC);
    TextField Lattitude = new TextField("Lattitude", "", 3, TextField.NUMERIC);
    public AtmosMIDlet()
    try
    ImageItem logo = new ImageItem(Image.createImage("/logo.png"));
    WelcomeForm.append(logo);
    catch (java.io.IOException x)
    throw new RuntimeException ("Image not found");
    WelcomeForm.append(WelcomeMes);
    WelcomeForm.append(Longitude);
    WelcomeForm.append(Lattitude);
    WelcomeForm.addCommand(new Command("Exit", Command.EXIT, 0));
    WelcomeForm.setCommandListener(this);
    public void startApp()
    Display.getDisplay(this).setCurrent(WelcomeForm);
    public void pauseApp() {}
    public void destroyApp(boolean unconditional) {}
    public void commandAction(Command c, Displayable s)
    notifyDestroyed();
    I'm trying to get the image logo.png to display at the top but I get the error:
    C:\WTK25\apps\AtmosSpec\src\AtmosMIDlet.java:19: cannot find symbol
    symbol : constructor ImageItem(javax.microedition.lcdui.Image)
    location: class javax.microedition.lcdui.ImageItem
    ImageItem logo = new ImageItem(Image.createImage("/logo.png"));
    ^
    1 error
    com.sun.kvem.ktools.ExecutionException
    Build failed
    When I try to build.. Any help would be great.
    Ideally the image would be on a seperate screen for a couple of seconds.

  • [QUESTION] First Steps: Java ME SDK 3.0 AND NOKIA N95

    Hi! this is my first post in the forums. I am a c# .net programmer and this is my first step to start programing mobile phones with Java ME.
    I already downloaded and installed de Java ME SDK 3.0 and try the examples, then i build a sample and generate the jad.
    After upload to my N95 it says that cant install the app because is for the N95 or is not supported....(I was thinking like winforms in .net... build install and run ....hahaha!)
    but i found that every phone has its SDK that i must install to develop app.
    So my question is
    If i have the JME SDK 3.0 installed what i need to build any Nokia or Nokia N95 app. If is possible can you tell me the configuration that i need or maybe the steps to install the SDK from nokia to use in JME., apps, emulators, docs, etc.
    PD: I want to start an app that tells me the location using the internal gps of the N95.
    And sorry for my bad english.
    Thanks!

    check if ME SDK is configured to MIDP 2.1. Also check whether N95 supports MIDP 2.1 or 2.0; if needed, change SDK build settings to MIDP 2.0. // this seem to be rather popular problem
    ...I want to start an app that tells me the location using the internal gps of the N95...Google for +"nokia n95 jsr 179"+ (jsr 179 is location API in Java ME).
    If you plan to target only Nokia device(s), consider getting help at Nokia Java ME forums.

  • How to change the midp version in ktoolbar of wireless toolkit 2.1

    Hi
    How to change the version of midp in ktoolbar of wireless tool kit 2.1
    though i tried to change the platform by selecting midp1.0 from settings
    dialog box iam geeting alert:BadVersion Error
    and the application is terminated abruptly
    do i need to change any configuration files
    please suggest me
    as it is very urgent

    The version of Java inside the database? If so - Not recommended at all ... the environment is NOT the same as your grandfathers JRE and there are a few noteworthy conditions.
    How much of the Oracle Java Developer's Guide have you reviewed? http://www.oracle.com/pls/db102/to_toc?pathname=java.102%2Fb14187%2Ftoc.htm&remark=portal+%28Books%29

  • Nokia Series 60 MIDP SDK Beta 0.1 with JBuilder6

    Hi,
    I installed Nokia Series 60 MIDP SDK Beta 0.1 and configured the JDK of JBuilder6.
    When I run the midlet, The EPOC emulator was pop up, but then there was a runtime error:
    Emulator command: C:\Nokia_Series_60_MIDP_SDK_Beta_0_1\bin\Epoc32\release\wins\udeb\kmidp_debug.exe -parent_port 2810 -classpath C:\Nokia_Series_60_MIDP_SDK_Beta_0_1\lib\j2me-debug.zip; C:\projects\test\classes;C:\Nokia_Series_60_MIDP_SDK_Beta_0_1\lib\j2me-debug.zip -descriptor c:\tmp\midp\Test.jad Test
    java.lang.RuntimeException: Class not found in runMIDlet: java.lang.ClassNotFoundException: test.Test
    at com.symbian.midp.compatibility.runtime.MIDletExecutor.runMIDlet(+143)
    at com.symbian.midp.compatibility.runtime.MIDletMain.runFirstMIDlet(+77)
    at com.symbian.midp.compatibility.runtime.MIDletMain.run(+346)
    at com.sun.midp.midlet.Main.main(+56)
    I changed the path to that MIDP SDK, but still failed. This test program can be run with Default J2MEwtk, motorola or Sony emulator.
    What's wrong with my settings? or the software has bugs because I found that there are many developers who posted in the Nokia's support forum were unable to run it properly .
    Regards
    gogo

    Nokia emulator can execute only packaged MIDP. So, make .jar and jad files by WirelessToolkit and then run it under WirelessToolkit, by choosing Nokia device, of course.

  • What is the best porxy server to use in MIDP

    i need a link or a softwear name for a proxy server that work best with the httpconnection of the MIDP profile.
    (by the wey why do i need to cinfig a proxy server anywey?)
    thanks itzik

    Hi,
    In MIDP the proxy server settings are noy under the control of the application. This is similar to the situation in a real device.
    In the WirelessToolK it(emulator) the proxy host can be set or left unset in which case a proxy is not used. Check the WTK UI or documentation for how to set or clear it.
    Hope this helps.
    mfali

  • E71 - Midp 2.0,setting permissions impossible ?

    I just received my Nokia E71, in App Manager i cant find the option to set permissions for J2ME Application.
    Is it because of the old Midp 2.0 engine (in that case why is old Midp2.0 integrated instead of 2.1)or Nokia just forgot this menu ?
    could it be possible to upgrade the midp in further fw versions ?
    sheeps never prosper ...
    Solved!
    Go to Solution.

    hm, i have no clue then
    here is how it looks on my device after opening app manager > browsing to opera mini > options:
    Open
    View details
    Send
    Go to web adress
    Remove
    View Log
    Settings
    Help
    Exit
    under settings i only find
    Software Installation: signed only / all
    Online Cert check on/off
    Default Web Adress
    but where is the menu for permissions ?
    sheeps never prosper ...

  • MIDP applications web access

    Hello,
    I developed MIDP application which need internet access suing http protocol. The application is a client for a web service.
    The application run perfectly on the emulator but it does not work on my mobile phone although my phone has internet access and I can browse the web without any problem.
    How can I tell the application about the settings of internet access??
    Thanks in advance,
    Motaz K. Saad

    Hi!
    I think in J2ME , you don't need to tell about the connection settings to the application. I have written a J2ME client to upload a csv file to a web server. I have not used any connection settings for client.
    1. check wether, your server can be reached by browsers from a remote machine. if then server is working fine.
    2. if the Connector.open(url) inside one of your MIDlet's method, then try to use a separate thread to run those things.
    Jestan.
    Edited by: Jestan on May 7, 2008 4:07 AM

  • Please help: com.sun.midp.installer.InvalidJadException: Reason = 2

    Hello,
    Im getting the following error when trying to run a J2ME MIDlet app. (I'm using sun wireless toolkit 2.52):
    com.sun.midp.installer.InvalidJadException: Reason = 2
    at com.sun.midp.security.Permissions.openPropertiesFile(), bci=100
    at com.sun.midp.security.Permissions.readPermissionsTable(), bci=8
    at com.sun.midp.security.Permissions.initialized(Permissions.java:1122)
    at com.sun.midp.security.Permissions.getUntrustedDomainName(Permissions.java:385)
    at com.sun.midp.security.Permissions.forDomain(), bci=141
    at com.sun.midp.installer.InternalMIDletSuiteImpl.initSecurityHandler(), bci=14
    at com.sun.midp.installer.InternalMIDletSuiteImpl.setTempProperty(), bci=423
    at com.sun.midp.main.MIDletSuiteLoader.main(), bci=1011
    I'm using windows 7. permission to read the files is set. So what's wrong? Thanks in advance.

    Hi,
    when i create the project and give class name then folders created are:
    bin
    lib
    src
    res
    and a properties file project
    Now i m placing the .java file in the src folder .
    Then when i build..it shows
    build Initializing in a small pop-up window and then in toolkit it displays
    No sources to compile
    Build failed..
    in the bin folder teher was onlu manifest and jad file ..no jar file was created ,i thnk thats why it showed " No sources to compile ".
    please tell me where to find the .jar file .
    or any settings i need to configure?

  • Due to my laptop screen failing i have to return to facory settings, can i reinstall adobe reader and adobe air afterwards?

    Due to my laptop screen failing I have to return it to factory settings, can I reinstall adobe reader and air afterwards?

    I don't see why not. Do you foresee a special difficulty?

  • After Drive Replacement, iTunes Points To Wrong Folder Even After Adjusting Settings

    I moved my music to a new hard drive. I then adjusted settings within iTunes to "point" to the folder on the new drive. The folder name is identical as are all the files within it. I did this a few months back and had no issues once iTunes "located" my files. All files played, playlists remained intact. This time however only a small portion of my files successfully "located" and the remaining 75% are unplayable. When "shown in finder", the unplayable tracks point to a completely random folder within my mail folder of obviously non-music files. I've been searching for weeks how to fix this to no avail. I definitely do not want to lose my playlists, play counts, etc. so starting from scratch with iTunes is not an option for me. Please advise how to fix this very odd issue!
    iMac 3.4 Ghz i7
    OSX 10.8.5
    iTunes 12.0.1.26 (just updated)

    To resolve this we will need details.  I don't know exactly what is where.  Even though it "worked last time" I see people post with that and almost invariably there is something different in the scenario this time.
    The iTunes application alone has no idea where media files are.  You could drag all the media folders you like to the Media folder and it won't know.  You could "point" iTunes to that folder in preferences and it still will never look there.  iTunes knows where files are because as you add them to iTunes it puts them in the Media folder and makes a note in that .itl file where the files are located.  When you try to play a track iTunes looks up in the .itl file which media file it should try to play when you request the track and goes to that location to play the file.  If there file isn't there you get !  You have to mend the links one by one, or iTunes might try, based on you repairing links. to repair other links, but it doesn't usually work that way and is only partly successful at times (as we have already discussed).  If you have ever walked into a store and see an empty shelf but their web site says they have 3 in stock and the sales person says all their stock is out on the shelf, iTunes is like that.
    Here's a bunch of links on how iTunes works.  As you can see, an entire library is a whole bunch of files and support folders working in concert and when they get split up iTunes starts misbehaving.
    What are the iTunes library files? - http://support.apple.com/kb/HT1660
    More on iTunes library files and what they do - http://en.wikipedia.org/wiki/ITunes#Media_management
    What are all those iTunes files? - http://www.macworld.com/article/139974/2009/04/itunes_files.html
    Where are my iTunes files located? - http://support.apple.com/kb/ht1391
    iTunes 9 [and later]: Understanding iTunes Media Organization - http://support.apple.com/kb/ht3847 - plus supplemental information about organizing to new structure https://discussions.apple.com/message/26404702#26404702
    Image of folder structure and explanation of different iTunes versions (turingtest2 post) - https://discussions.apple.com/docs/DOC-7392 and making an iTunes library portable.

  • Downloader doesn't retain previous settings

    Can Bridge Downloader be set to always open with the advanced dialog box and can it be set to retain the previous settings?  Also, is there a Preferences for the Downloader?  I can see it listed in the menu, but it's ghosted.
    It would be a real time-saver if I didn't have to re-enter all the info each time I open the Downloader -- and then start all over again because I missed something and it downloads to the wrong drive/folder or creates dated folders when I don't want them or doesn't enter copyright info in metadata... you get the idea.
    Thanks for any help with this.

    it doesn't increase my faith in Adobe software when following their procedure that I'd also have to search the system to purge it manually.  It begs the question: why did I use the latest Adobe un-installer and the latest Adobe Cleaner
    That's an understandable question and I have no certain answer for that, I'm only a user, not a technician
    But I like to think that in normal ways an uninstall keeps certain files like settings and cache as it is so you won't have to go through that work again when installing upgrades. Further guessing is that the clean tool does get rid of the hidden and/or invisible preference files but not the cache, hence my suggestion to check anyway.
    it's annoying that the Rotate tools were moved off the toolbars,
    They are not, you just haven't selected the 'path bar' option under the menu window, put a check mark in front of it in the menu Window and they are there with other useful tool icons. Aside from that Bridge stills keeps deselecting the path bar every now and then. But my hopes for CS6 on resolving that item are high.
    and having the Favourites and Folders under separate tiny icons is equally irritating and mousey.
    You are right, they are tiny but you can design your own lay out. I have both under each other in one column with a very short favorites panel and a very long folder panel. Grab a folder tab and drag it. You will see there will appear blue lines surrounding the panel. You have three columns to work with, one bleu line (either vertical or horizontal) appears at the position were you can drop the selected panel in it's new lay out. A surrounding blue line means nesting in a panel with multiple tabs. In the beginning this is a bit tricky but you will get used to that. When your happy with the customized lay out save it as a new workspace. Plenty of options!
    In PS 12.x, the implementation of the Adjustment Layers panel is also beyond belief!
    This sounds as you don't like it while others (me included) are very very happy with it! You just have to get used to different ways of working, once tried a while and getting used to it you don't want to go back, trust me (besides, the shortcuts for adjustment layers still work to my knowledge and if not you can assign them yourself in a custom menu setting).
    The problem with not upgrading to any new cycle is that the differences with prior version can get huge. It should so because software needs development and users need to get used to it. I can't tell you how often I have changed my workflow due to new methods (and knowledge) and the majority of this changes have brought me great benefit

  • How do I get loops to keep the effect settings I hear when previewing?

    When I place loops into a new track, the effects settings go away and it is simply a dry signal. How can I move a loop from the browser into a new track and have it keep the effects settings that I hear when I preview the loop?

    If you drag a green MIDI loop onto the Arrange window space, it should create a Software instrument track with all the required plug-ins for the sound, so don't drag it to an already existing Software instrument track.
    If you drag it to an audio track it will convert it to an audio file, so obviously the instrument/fx plug-ins wont be in the channel strip.
    If that's what you mean?

  • Why does "itunes accounts" use data with all settings OFF?

    Does anyone know how to keep "iTunes accounts" under system from using cellular data?
    I have already:
    1. Toggled OFF all settings in the "Use cellular data for" menu.
    2. Turned OFF all automatic downloads and any other options under iTunes/app store settings.
    3. Turned OFF Background App refresh.
    4. Turned OFF all options under iCloud sync menu.
    Right now, the only thing that keeps "iTunes accounts" from pulling cellular data is turning Cellular Data completely OFF, but I don't want to do this because I lose some messaging and voicemail functions and I need to be able to use Find My Phone. I have two identical iPhone 5c's on this account. One is running iOs 8.1.2 and the above settings control it's data usage nicely. The other phone is running iOs 8.1.3 and this one uses 50-100 mb a day even with all the above settings off and the phone almost always on wifi.
    I am aware that the phone will lose it's wifi connection when asleep, but that shouldn't be a problem if all the apps/settings are already set not to use cellular data. What am I missing. I've read a bunch of threads on this issue and they all suggest settings I already have OFF.

    My personal phone is on 8.1.2. My daughter's phone is 8.1.3.
    It is her phone that is currently having this problem, but I reported it under my account; sorry for the confusion.
    My phone has had some data problems in the past, but I have been able to control them by keeping almost all data options OFF and the overall switch ON. My usage is back to less than 50 mb per month which makes sense since my phone is almost always on wifi and I don't use data dense applications.
    Everything about my daughter's phone is the same as mine except for the 8.1.3 upgrade. She does use things like Instagram more than I do, but I have them all set to not use Cellular Data and the option to change these settings is locked. When I look at the usage on her phone, it isn't her apps that are pulling unexpected data; it's "iTunes accounts" under system services. All the options under iTunes/App Store (auto downloads, home sharing, etc.) and all the iCloud options are already OFF.

Maybe you are looking for

  • Support Desk Message - Systems missing

    Hi I have configured all of my systems in SMSY and can use them successfully for CTS etc from Solution Manager. When creating a new support desk message I want to be able to pick any of the systems in my landscape in the Attributes: System: and Clien

  • Any tips for sync contacts from laptop to iPad?

    Can anyone help me to sync contacts on laptop to iPad please?

  • Reading metadata of a JPEG image

    Hi, I am trying to read the metadata of an image taken from mobile. how can i extract the thumbnail from the metadata? I will be receiving the image as bytearray from client. Thanks & Regards, Sairam

  • In string comparisons

    Hello, I'm new to java and was wondering how I could do an in-string comparison. I.E. check if the string "the" is in "here is the". In ASP you can write inStr(string 1, string2) and I was wondering what the JSP equivalent was. any help is appreciate

  • Oracle Internet File System and J2EE

    Is Oracle Internet File System fully J2EE compliant? Thanks.