Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Questions (Windows Mobile)
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Questions (Windows Mobile) Post any question regarding Basic4ppc.

Limitation of number forms in Basic4PPC

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-17-2008, 07:05 AM
Senior Member
 
Join Date: Mar 2008
Location: Dhaka, Bangladesh
Posts: 164
Default Limitation of number forms in Basic4PPC

I previously posted a problem concerning the application not being able to be loaded on the device. This problem was solved by using the DLL CEnhancedForm.cs, provided by Erel. Since than we were able to load the program. Since the applications was designed for a device with non VGA screen, forms had to be redesigned for a device with VGA screen (for HP ipaq 214) which lead to a increase of Forms to total of 82 Forms. Together with a database there is no problem in loading the application on the device. At any time a maximum of 4 forms are open, and after moving to the next form, the previous form is closed. I am using the hardware library to monitor usage and release of memory. Although, I close the previous form after moving to the next form, the memory allocation is increased with the same number of forms open. After having opened the 25th form, the application stops, showing the message “outofmemoryexceptioncontinue?”. Memory allocation at this point is about 1,020,000 (not sure of the unit).
Restarting the device helps only to move forth 2 more forms before the same message appears.

If we move back and forth the screens a few times, memory allocation increases, even beyond the 1,020,000 at which the application stops.

I attached the application, database, two JPG/GIF file.

Please help,

Regards,
Attached Files
File Type: zip whole thing.zip (148.3 KB, 35 views)

Last edited by mozaharul : 12-17-2008 at 07:10 AM.
Reply With Quote
  #2 (permalink)  
Old 12-17-2008, 07:33 AM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 2,344
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

Quote:
Originally Posted by mozaharul View Post
Although, I close the previous form after moving to the next form, the memory allocation is increased with the same number of forms open.

Regards,
On the device NO forms are closed, but only hidden, after first show...
__________________
Paulo Gomes - Porto, Portugal - Living/Working in France
Mobile Device: Samsung Galaxy S, Android 2.3.4 CUstom ROM
Laptop: Toshiba NB100-130 (running on Win7Ultimate)

My Posts helped you? Consider Buying me a Porto Glass!
Reply With Quote
  #3 (permalink)  
Old 12-17-2008, 07:50 AM
Senior Member
 
Join Date: Mar 2008
Location: Dhaka, Bangladesh
Posts: 164
Default

So, if it is not possible to release member by closing forms, how to handle this amount of forms in an application?
Reply With Quote
  #4 (permalink)  
Old 12-17-2008, 11:47 AM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 2,344
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

One Option Would be to simulate a Form using panels...
Since panels are a forms control, it should be loaded at the app start, so the memory usage should stay more or less linear with this solution, as long as it does Start...
This way, all the memory alocation done in every formx.show, would have already been done.
__________________
Paulo Gomes - Porto, Portugal - Living/Working in France
Mobile Device: Samsung Galaxy S, Android 2.3.4 CUstom ROM
Laptop: Toshiba NB100-130 (running on Win7Ultimate)

My Posts helped you? Consider Buying me a Porto Glass!
Reply With Quote
  #5 (permalink)  
Old 12-17-2008, 12:23 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,726
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

Note that the allocated memory you get from the hardware library, only returns the "managed" part of the memory used.
Therefore it is not a good indicator for the real memory usage.

When you start a program, all forms are created. So both the number of forms and the number of shown forms affect the memory usage.
Cableguy's suggestion is a good option.
Another option you could try is to use some 'template' forms and at runtime change their layout by showing and hiding controls and setting their positions.

From what I've seen in your application it looks like you can "merge" many forms.
Reply With Quote
  #6 (permalink)  
Old 12-22-2008, 05:10 AM
Senior Member
 
Join Date: Mar 2008
Location: Dhaka, Bangladesh
Posts: 164
Default

I have now use a template Form and have created all controls at run time. I have used three sub programs, one to create the controls for each Form (Creat_controls_in_virtualFormX), one to make visibility of controls True (virtual_FormXControls_ON) and one to make visibility False (virtual_FormXControls_OFF). Before switching to another Form, making the visibility of controls of current Form False and visibility of controls of the switched Form True using the respective subs. But switching back and forth takes 6/7 seconds on the device. Only once I found the switching time near about 1.5 seconds (don’t know why). But then again it becomes 6/7 seconds. Although the last Form is having a few controls as you can see in the attached application, it takes same amount to time. How to reduce the switching time between Forms ? I guess that as I move forward to make more controls, using visibility True and False will take more and more time for switching. I tried without the database, its the same. sorry I could not attach the application and other stuff due to the Internet problem.



Regards,

Last edited by mozaharul : 12-22-2008 at 05:13 AM.
Reply With Quote
  #7 (permalink)  
Old 12-22-2008, 06:52 AM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 2,344
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

how mani controls are you switching ON/Off at a time?
post a list of forms, controls and depedencies and I will make my own code to find a possible solution.
ie:
Vform1 has 10 textboxes 2 buttons 1 image
vform2 has 3 textboxes, 4 labels,2 buttons....
__________________
Paulo Gomes - Porto, Portugal - Living/Working in France
Mobile Device: Samsung Galaxy S, Android 2.3.4 CUstom ROM
Laptop: Toshiba NB100-130 (running on Win7Ultimate)

My Posts helped you? Consider Buying me a Porto Glass!
Reply With Quote
  #8 (permalink)  
Old 12-22-2008, 07:29 AM
Senior Member
 
Join Date: Mar 2008
Location: Dhaka, Bangladesh
Posts: 164
Default

Thank you very much for your time.

Since I can not attach the application due to the Internet problem, from the first post attached you can have the number of controls I create at run time per Form/page exactly the same as in the physical page/Form. To generate the controls at run time, I wrote the code for Form1, Form1a, Form2, Form3, Form3a, Form4 and Form4a (partly) using the physical properties of controls as it is in the physical Form.

Best regards,
Reply With Quote
  #9 (permalink)  
Old 12-22-2008, 05:20 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,726
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

You can group the controls in panels and then hide or show the panels.

Can you post some code that demonstrates how you switch between those virtual forms?
Reply With Quote
  #10 (permalink)  
Old 12-23-2008, 12:14 PM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 2,344
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

I cannot run the sample code, as it errors but I can see the code...
I will try in the next few days to reproduce the app using panels, but I need some sort of guidelines to what this app does...
It seems to be just a sort of "survey" questionary, but I cannot understand why you are populating the comboboxes in runtime, why "clear" subs for independent textboxes and other control, when only one would do the job...
This app, if I recall correctly, was started using b4ppc 6.30, so I think that all the advantages brought to us with b4ppc 6.50, are not implemented, and would make this app much more readable...
__________________
Paulo Gomes - Porto, Portugal - Living/Working in France
Mobile Device: Samsung Galaxy S, Android 2.3.4 CUstom ROM
Laptop: Toshiba NB100-130 (running on Win7Ultimate)

My Posts helped you? Consider Buying me a Porto Glass!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
multiline textbox size limitation? Cableguy Questions (Windows Mobile) 9 09-26-2008 08:13 PM
Duplicating Forms Ianmac Questions (Windows Mobile) 2 02-02-2008 12:04 PM
Merging forms skipper Questions (Windows Mobile) 2 01-10-2008 12:18 PM
Numeric conversion limitation? agraham Bug Reports 5 07-06-2007 05:08 PM
Multi-tab forms Rioven Questions (Windows Mobile) 6 06-11-2007 03:49 AM


All times are GMT. The time now is 03:29 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0