RMS opened for full cycle - java-me

Midlet starting open one RMS and store some data in it and through out each page I am using RMS for getting data.
Now I am using same open RMS for each page. Is this is efficient or I need to close and open when it use?

It depends what you mean by page. If your RMS is available for several midlets and page = once midlet, then you should close store with destroying app. I think you think about page as screen. Then you must open RMS with first screen and close it with last.

Related

How to initiate customer value for screen in touchGFX

I have build an application using touchGFX and STM32 based on STM32F746 Disco kit.
My application have some screens with some value to display on screen. These value can setting and change by user. Every time when these value change I will save them to eeprom.
When I turn off power and turn on again, I have read these value before start display screen, but them can't to load to screen until I pressed some button on screen (pressed button I will fresh this screen).
So my question:
How can I initiate customer value for screen and display them when startup in touchGFX
Thanks.
This is simple, just load your data in presenter->activate().
I suggest you read the article on back-end-communication. It explains how to propagate values from your Model (e.g eeprom).
https://support.touchgfx.com/4.18/docs/development/ui-development/touchgfx-engine-features/backend-communication
From TouchGFX Designer you'll find several examples that do something similar from an F769-DISCO board (sample a button and propagate that value to the UI).

Primefaces javax.faces.application.ViewExpiredException during main screen to open new screen in new Window

Scenario:Total Two screen and both scoped are define #ViewScoped
Screen 1 into open window.open(screen.xhtml) screen and check some functionality into screen 2 and close screen 2 and after go to screen 1 and click on button then throw below error.
javax.faces.application.ViewExpiredException: /glb/GlbMbrReviewSubmissionWorkflow.xhtmlNo saved view state could be found for the view identifier: /glb/GlbMbrReviewSubmissionWorkflow.xhtml
at org.apache.myfaces.lifecycle.RestoreViewExecutor.execute(RestoreViewExecutor.java:171)
at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:170)
at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
The state of the view of each page is stored in the server (the default) in LRU map in session and the size is 15. Thenpage 1 view gets ejected out of map when the recent pages get viewed in page 2 more than 15 times. The solution approaches are,
Either you can increase the map size configurably to increase it but it increases the server memory load.
Or change the defaut state saving mechanism value to "client" but it increases network traffic .
One recommended solution is to poll the server from page 1 at specified no of seconds to bring the view on top of the map so it does not get deleted.

Frameset not displaying in Lotus Notes Application when user opens database

We have an application that is written in 8.0.3 and we are using a frameset. When the user opens the database, the frameset doesn't display all of the time. In the database setting, we have it set to open the frameset. Can anyone tell me why it isn't always displaying?
Usually this happens because it cannot find or load the contents of one or more frames.
Maybe the user has no rights to open an element from the frameset.
Some design elements may have access protection.
See Notes/Domino 6 and 7 Forum for the same issue answered.
This happens when one of the frame contents cannot be found.
Open the properties of each Frame within the Frameset and examine the Value. You may need to click the # button to view the View reference, make sure that the element linked to actually exists.

LWUIT- out of memory exception in JavaME

I am developing an app in Java ME using Netbeans IDE, where I'm creating 3 Forms which contains Button, Command (OK and back) and Image in the 1st Form.
Using OK Command I can transfer the control to the 2nd form. This works
In 2nd Form I have 2 Command OK and Back. On click of OK it should go to the 3rd Form. On click of back it should return to the 1st Form.
When I am in the 2nd Form, I'm neither able to transfer to the 3rd nor to the 1st Form.
I am getting the following exception.............
java.lang.OutOfMemoryError
(stack trace incomplete)
An exception occurred during transition paint this might be valid in case of a resize in the middle of a transition
Please help me out.
Thanks in advance
Sanjay's answer is correct however if it doesn't solve the problem I would guess you have a recursion somewhere in your code leading to a stack overflow. Many J2ME VM's fail in triggering the stack overflow exception and instead throw an out of memory error.
Just use a debugger and walk over the code to see the recursion.
With the informations you provided, The possible issue is with the image in the first form, you need to keep track of the size of the image you are using. When an image is loaded, the data is decompressed to a pixel array. Pixels can need anything from 2 to 4 bytes each, depending on the device.Say an 800x600 image has 480,000 pixels, so will need at least 1Mb of heap (possible as much as 2Mb) to load it. This will explain why you are running out of memory. During a transition it may be LWUIT makes a local copy of the Image to "transform" (redraw) it(though I'm not sure) so its not a surprise if you need more memory while transition.
Here is a good read which might help you : Memory Leaks In LWUIT And Tracking Memory In Java ME
You can extend the memory of the emulator. You have to click on Properties of the project / Platform / Manage emulators / Tools & extensions / Open preferences / Storage
In this window you will see heap size, write here 1000 f.e. and try it again.
When you swiching to 2nd or 3rd pass object of that class & display object(which is from mdilet) with next form constructor, and when you calling back button just write one line of code like display.setCurrent(previous_form_object); & you know how to go next form when you clicking ok command. And one thing which is mentioned by Sanjay.
Thanks

How to avoid a lwuit application restarting after being minimized in java-me

I've created an application with lwuit on java-me, however, each time the user receives a phone call the applications is minimized and when the user restores it, the first Form is shown again (a splash form). How can I avoid the application from starting again?
Try overriding onHideNotify() and onShowNotify(), In hideNotify, store the last shown form to a variable and display that in onShowNotify()

Resources