reads and displays huge bitmaps
Can you break the bitmaps down so that you only have in memory the section that is shown on the display? Like with Google Map / OpenStreetMap tiling, which (from memory) work with 256 x 256 pixel chunks,
The App "vanishing" without any message in debug or release mode
No message when it happens in debug mode? That's going to be fun to track down.
My first thought here is to find out whereabouts in your program it happens. Like, even if it is Android killing your program, presumably Android has a reason for doing that, and it would be after your program does something that Android doesn't like. In order to stop upsetting Android, first we have to find out what your program is doing that Android doesn't like or otherwise causes the problem.
If there is no message, then maybe it is running out of some resource, to the point that it doesn't even have enough of that resource available to let you know what the problem is. If the program can't send any diagnostic information after the problem happens, then we'll have to start sending diagnostic information before the problem happens, and then at least we'll know where things were ok, and that that the problem must be between the point where things were ok and the next diagnostic point that it didn't get to because it died (or was killed) before it got there.
I'd write a little Sub that leaves breadcrumbs of when the program passes through various points of the program, eg the start of an event handler, and just before the Returns from and the end of the event handler. That way, when the problem occurs, we'll know that it got into that Sub but never made it out again, and we can add more breadcrumbs inside that Sub to keep narrowing down which line the program vanished at. Like a binary search.
I'd either 1/ write the breadcrumbs to a file, and open and close the file for each breadcrumb, to make sure the breadcrumb is on disk and safe from being lost when the program vanishes. Or 2/ send the breadcrumbs via UDP to simple logging program running on your PC.
Now that I think about it, your breadcrumbs could include other information too, eg, the size of a bitmap that you're about to create, or the selection number of an item chosen from a list.
Once we've located - and fixed - the problem, then you can do a global search and replace to comment out all the calls to Breadcrumb() and the residual overhead of the diagnostic technique will be zero. Or you could leave the breadcrumb calls still in the program, but just put a Return at the top of the Breadcrumb() Sub to turn it into a dummy routine, and the only residual overhead is the calls and returns, without the file or network operations.
How does that sound? Would you go with breadcrumbs-to-file method, or the breadcrumbs-over-network method? Each way has advantages and disadvantages over the other. Eg:
File method:
- how to view the breadcrumb file after program vanishes
- how to not fill up the disk
Network method:
- only works for you, not for your users
- gotta write a receiving app (but then again: for the file method, you gotta write code to view the file, so... the disadvantages balance out)
- won't wear down your flash drive with excessive writes