Wiki

Clone wiki

javarosa / WorkingWithFiles

Some useful notes

Working/Debugging with the emulator

  • Be sure to set the emulator to 'trusted' mode. For the Nokia S40 emulator, after creating the debug configuration described in (http://code.dimagi.com/JavaRosa/wiki/Debugging), complete the following modifications:
  • In your debug configuration, select the 'Emulation' tab
  • In 'Extra Emulator Paramaters': add "-Xsecurity_domain:Trusted"
  • Note: you can also modify the security permissions in the emulator itself by clicking Tools -> Preferences -> Select 'MIDP' tab -> Change 'security domain' to 'Trusted'. You can also modify permissions in the emulator to pretend like there is or is not a memory card inserted.
  • Make sure that you can actually write to the file system that you are targetting. On many phones, only specific directories are available for applications to write to (e.g. C:/Gallery). On some phones, the entire local filesystem is locked against applications writing data. This is one of the reasons why a SecurityException may be thrown when trying to write to the local filesystem.
  • On the Nokia 3110C, applications can only write to the memory card ("E:" drive)

Working with the Phone

  • The best option is to make sure the jar is properly signed and trusted.
  • If you don't have a certificate handy, you can sometimes manually enable permissions for applications.
  • On the Nokia 3110C, navigate to your application. Select 'options' -> App.access -> data access -> Add and edit data -> Ask Every Time. This should allow you to write to the memory card after saying 'yes' to the user prompt.

Updated