10-06-2012 10:42 PM
Yea. I'm not testing it by clicking the icon on the home screen. When its set to UIApplication and theres no screen, it will lock you up... although you can still hold down the menu button until the switch screen dialog comes up. See what the event logger says when you restart the device though.
10-06-2012 10:43 PM
10-06-2012 10:44 PM
yea. worked for both Application and UiApplication.
10-06-2012 10:45 PM
How can it be done as a ui app that displays a screen telling user if sd card found or not found, app set to auto run and after device restarts?
10-06-2012 10:45 PM - edited 10-06-2012 10:47 PM
Not sure why it locks up for me. I can get an app to see sd card when manually launched, just not after device restarts and app set to auto run.
10-06-2012 10:54 PM
... I don't know what you're doing. You said you got the same results. Yes or no, do you see the "sdcard found" string in the event logger after the device restarts. Don't try to open the app, just restart the device and look at the event log. You can change the filter so it only shows entries for "MyApp".
If you want a screen, then add a screen. If you keep trying to launch from the ribbon without pushing a screen, its gong to lock up.
if ( sdcardPresent ) {
FileSystemRegistry.removeFileSystemListener( this );
synchronized (UiApplication.getEventLock()) {
pushScreen( new MyScreen( sdcardPresent ) );
}
}
private final class MyScreen extends MainScreen {
public MyScreen(boolean b) {
add( new LabelField( "added: " + b ) );
}
}
10-06-2012 10:58 PM - edited 10-06-2012 11:33 PM
Sorry mreed, I wasnt very clear... getting frustrated with what should be a somewhat simple task. Reinstalling simulators now (received a couple errors) and will test again very shortly and be more clear with my results.
Hey I really appreciate all of your help, you've been great.
10-06-2012 11:26 PM - edited 10-06-2012 11:43 PM
I am experiencing issues with debugging/simulator versions and related Eclipse error messages when dubugging using the device. Sorry, working them out now.
However, when I run the code above on my device (7.1.0.523) it works fine and I see label added: true. But, after restart and app auto runs I see label added: false until I close the app then launch it manually.
FileSystemRegistry.removeFileSystemListener(this );
synchronized (UiApplication.getEventLock()) {
pushScreen(new MyScreen( sdcardPresent ) );
}
}
Must be some sort of timing issue. Is there anything else I can do?
10-06-2012 11:35 PM - edited 10-06-2012 11:38 PM
Sorry, I am also finding after restarting a few more time with sc card in/out that when out the app sometimes locks/doesnt respond at all. Do you get the same results with no sd card inserted?
10-07-2012 12:22 AM - edited 10-07-2012 12:25 AM
Try this. I updated it so theres a screen from the start now, and then it will just add a label as it has something to update. Attached are the project files.
As for rebooting with no sdcard... its starting fine, and once I push in the sdcard, it updates the screen saying its available. If you launch the app after startup is complete, its not currently adding the FileSystemListener... but you can update it for that.