|
-
Feb 25th, 2007, 03:52 PM
#1
Thread Starter
Addicted Member
Recommend File Format?
I'm designing an app for PDAs that relies heavily on user inputted data that is saved and retrieved often. What means should I use to save and retrieve the data? Here are some points to consider:
Requirements:
1. File needs to be transportable; that is, the user is able to share the file with other users.
2. File needs to be secure in that if the file were opened with a text editor, the user couldn't easily edit what was contained in it. It shouldn't plain text--it should be somewhat binary or cryptic.
3. Loading and reading of the file needs to be as fast as possible. Ten seconds to load a file that is a maximum of 10KB isn't acceptable, but 1 to 2 seconds is.
4. Need to be able to access the data within the file in a manner as close as possible to the way data is accessed from a database.
5. Needs to be easily upgradeable as new versions of my application are released--needs to not break the application, if in a new version, a new bit of data or a new feature is added, such as a boolean toggle to automatically update time/date.
Possible options I know of:
1. Database
2. XML (would have to be encrypted and decrypted on the fly, slowing things down a bit)
If a database is used, can the file extension be changed and still be treated by my application as a database?
I'd appreciate any advice anyone can offer.
Last edited by highflight1985; Feb 25th, 2007 at 04:24 PM.
Reason: Added requirement.
-
Feb 25th, 2007, 05:43 PM
#2
Re: Recommend File Format?
I'd suggest one other option, though I don't know whether or not it is available in the CF.
Normally, this looks like a DB app, especially because of the size of data. However, you might consider whether you can keep the data in an array of structures, then maintain the array in a class with the ISerializable attribute. The structures would also have to implement the ISerializable attribute, but that is trivial, so no big deal there. You can then use binaryserialzation to serialize/deserialize to a binary file, which would be both cryptic, fast, compact, and transportable.
Having said that, I should also add that once you get to around 10KB, it might not be all that fast, since you would have to read the whole thing in. I have used it for files of about 1KB, and the time taken is not noticeable on a desktop. A portable might have less speed, and you are reading ten times as much.
All things considered, it looks to me like you should use a SQL Server CE DB. That would give you fairly fast read/write time (though the lag during connection is pretty galling on a PDA), some cryptic nature, and a fair degree of portability. If you simply decide that's the way to go, you can test the other part. I would think that renaming wouldn't cause any problem, but I could be wrong on a PDA.
My usual boring signature: Nothing
 
-
Feb 26th, 2007, 02:59 AM
#3
Frenzied Member
Re: Recommend File Format?
Hi,
you can encrypt a SqlMobile database, and now, you can use it on a PC - that would be the way to go
Pete
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|