[android-developers] Loading and Saving Settings to a file

2012-02-06 Thread John-Marc Desmarais
Hi, I'm not sure what I'm doing wrong here: I have an Override on onPause to save settings to a file and an Override on onResume, and onCreate to load them back up from the file. The onPause method looks like this: @Override public void onPause() {

Re: [android-developers] Loading and Saving Settings to a file

2012-02-06 Thread TreKing
On Mon, Feb 6, 2012 at 11:15 AM, John-Marc Desmarais j...@ieee.org wrote: I have an Override on onPause to save settings to a file Why not just use SharedPreferences? Can anyone provide insight into this problem? When you check the file existing, you use the raw file name, not relative to

Re: [android-developers] Loading and Saving Settings to a file

2012-02-06 Thread John-Marc Desmarais
Hi, Thank you for your reply. I have a couple follow up comments/questions related to the responses. I have included these inline. On Mon, Feb 6, 2012 at 12:25 PM, TreKing treking...@gmail.com wrote: On Mon, Feb 6, 2012 at 11:15 AM, John-Marc Desmarais j...@ieee.org wrote: I have an Override

Re: [android-developers] Loading and Saving Settings to a file

2012-02-06 Thread TreKing
On Mon, Feb 6, 2012 at 11:36 AM, John-Marc Desmarais j...@ieee.org wrote: How do I handle the byte[] settingsBuffer = new byte[(int) inputFile.length]; without opening a File? You get the stream of data as the returned value of openFileInput. Then you can then read that into a byte array of

Re: [android-developers] Loading and Saving Settings to a file

2012-02-06 Thread John-Marc Desmarais
On Mon, Feb 6, 2012 at 12:56 PM, TreKing treking...@gmail.com wrote: On Mon, Feb 6, 2012 at 11:36 AM, John-Marc Desmarais j...@ieee.org wrote: How do I handle the byte[] settingsBuffer = new byte[(int) inputFile.length]; without opening a File? You get the stream of data as the returned

Re: [android-developers] Loading and Saving Settings to a file

2012-02-06 Thread TreKing
On Mon, Feb 6, 2012 at 12:04 PM, John-Marc Desmarais j...@ieee.org wrote: And am now getting Input settings not found when closing and reopening my application. Read the class overview: http://developer.android.com/reference/android/content/SharedPreferences.Editor.html

Re: [android-developers] Loading and Saving Settings to a file

2012-02-06 Thread John-Marc Desmarais
Yup. commit() still works as advertised. Thank you, -jm On Mon, Feb 6, 2012 at 1:19 PM, TreKing treking...@gmail.com wrote: On Mon, Feb 6, 2012 at 12:04 PM, John-Marc Desmarais j...@ieee.org wrote: And am now getting Input settings not found when closing and reopening my application.