I have Problem with Android File System!

Hello, Corona Labs Forum.   

I am a newbie, have been working on a simple app, but I am making good steady progress on a simple app.  The problem is it works nice in the Corona Simulator, but the saving and loading files is not working on Android Nexus 7 (2012).   Have any of you encountered such problems?

I need to save messages which can not be sent offline.

The app has a basic form to email process which is called using chromium.  I cant tell what is wrong, I have not got into droid debugging yet… though I am reluctantly downloading the Droid SDK now.

The app works by Playing a simple game (which is hard); Then when player surrenders; They can submit a form to make contact.

I clear the form once the SEND button is pressed, save the data in a text file in System directory

Then try to send it via Coronium IO - it can check internet access and switch control accordingly so that data which can not be sent is saved into a temporary file in the system.DocumentsDirectory

  1. This works nice in the simulator.
  2. It works when simulator is offline.
  3. It works when device is online.
  4. but when device is offline, it does not save – or it does not load

I do a check within the start screen to see if there are old messages to send which were saved during offline session. 

Problem is the black box droid which is not able to pick up data inputted during offline session.  I hope to get more insight into the black box now, but it has been very discouraging and I wonder if there are any heads out there which can advise?

Thanks in advance,

Daniel

You’re going to need to get into Android debugging. Without the output of your “adb logcat”, we have no clue where to start looking. 

That said, the simulator is not case sensitive, but the device is. Look at what differences you have when you have connectivity and you don’t. Make sure you’re using the exact same file names.

Rob

Hi Rob,

Thanks for helping, I have read many of your posts to help me get to where I am today!

I spent hours trying to get my Nexus 2012 to send debug information to my Windows 7.  No success yet.

The files are all case matching and are initialised in an init file in my custom module, messaging.lua which I have placed here:   http://codeshare.io/RvhzP

By placing a native popup, I am able to now know that messages are not being saved on the device when offline, but this is not enough help for me to work out the problem at the moment.    

I am tempted to try to store the offline messages by learning how to put the data into a local db such as SQLLITE - I would probably need to use this skill later for other app ideas I have anyway and I noticed you have made an article on this subject too.

Best regards,

Daniel

Beginning to suspect the problem is down to the test for a suitable internet connection.

Correction, Test email just arrived!!! the problem is down to the test for a suitable internet connection!

I changed that code since I had given up solving the problem for the time being and wanted a way to only show the fill out form if the connection was ok and thought the method I had was a too complicated.

This is a picture of how my life has been transformed, just when I give up on having success on my own, I achieve it through Christ!

TIP for others - this module was very useful, especially since I still can not debug on device since my machines are not recognizing each other.

You’re going to need to get into Android debugging. Without the output of your “adb logcat”, we have no clue where to start looking. 

That said, the simulator is not case sensitive, but the device is. Look at what differences you have when you have connectivity and you don’t. Make sure you’re using the exact same file names.

Rob

Hi Rob,

Thanks for helping, I have read many of your posts to help me get to where I am today!

I spent hours trying to get my Nexus 2012 to send debug information to my Windows 7.  No success yet.

The files are all case matching and are initialised in an init file in my custom module, messaging.lua which I have placed here:   http://codeshare.io/RvhzP

By placing a native popup, I am able to now know that messages are not being saved on the device when offline, but this is not enough help for me to work out the problem at the moment.    

I am tempted to try to store the offline messages by learning how to put the data into a local db such as SQLLITE - I would probably need to use this skill later for other app ideas I have anyway and I noticed you have made an article on this subject too.

Best regards,

Daniel

Beginning to suspect the problem is down to the test for a suitable internet connection.

Correction, Test email just arrived!!! the problem is down to the test for a suitable internet connection!

I changed that code since I had given up solving the problem for the time being and wanted a way to only show the fill out form if the connection was ok and thought the method I had was a too complicated.

This is a picture of how my life has been transformed, just when I give up on having success on my own, I achieve it through Christ!

TIP for others - this module was very useful, especially since I still can not debug on device since my machines are not recognizing each other.