Consider doing this the same way hard disks are encrypted because it's
the same problem: when a user changes their disk encryption password,
the entire disk is not re-encrypted. The trick is that the disk
encryption software creates its own master key for encrypting the
disk, and it never
You don't need xml to represent hierarchies.
You can represent your notes like this, and write your data in this
way (if you want to use binary):
public static byte[] encode(final ArrayListNote notes) throws
IOException {
int size = notes.size();
Craig,
I like this, I like this a LOT!
Thank you!!!
On Jul 22, 11:32 pm, craig3353 craig.law...@alum.mit.edu wrote:
Consider doing this the same way hard disks are encrypted because it's
the same problem: when a user changes their disk encryption password,
the entire disk is not
Thank you for all your answers!
Here is the approach I'm going to try now:
- I'll use SqLite database (Mark's suggestion).
- I'll try if I can store the database file on /sdcard (I want to make
it easy to backup).
- I'll encrypt individual fields in the rows with the key that on the
other hand
On Jul 22, 1:29 pm, gnugu rho...@gmail.com wrote:
In my unit test I populate the notes texts using String.format(blah
blah blah %1d, index). Of course it takes a long time...
Don't use String.format(). It's criminally slow. Set up a
java.util.Formatter object and re-use it.
Which part is slow, reading or writing? If it is writing, just stay the
heck away from the standard XML writers, they are horrendous. There is a
FastXmlSerializer with limited functionality that you could copy out of the
source code for your own use:
Dianne,
It is not reading and writing that's slow.
I have a class that has Notes field (ArrayListNote). I wrote my test
to create 1000 note objects and add it took 45 seconds.
Because I can't get XML string out of DOM Document I can't use the
Document as my storage for notes which leaves me
Sorry, I mean SqLite and not MySQL.
On Jul 22, 11:39 am, gnugu rho...@gmail.com wrote:
Dianne,
It is not reading and writing that's slow.
I have a class that has Notes field (ArrayListNote). I wrote my test
to create 1000 note objects and add it took 45 seconds.
Because I can't get XML
gnugu wrote:
Because I can't get XML string out of DOM Document I can't use the
Document as my storage for notes which leaves me with creating all
these objects as I read the XML.
Correct. Don't do that for large data sets.
It would be ideal for me to use MySQL to store the notes but then I
Hi Mark,
Why? Encrypt the columns you need encrypted.
Say you have a database with 100 notes. You use a password as a base
for encryption key. You decide to change your password. Type in the
old one and the new one. Now I have to spawn a thread that will open a
transaction and decrypt and
Just creating 1000 objects isn't going to take 45 seconds, it sounds like
you have something really bad going on somewhere. With it taking that
amount of time, you will probably quickly see some serious hot spots if you
run the profiler.
Also if you are seeing log messages about the GC running
gnugu wrote:
Say you have a database with 100 notes. You use a password as a base
for encryption key. You decide to change your password.
How frequently do you anticipate people using your application (looking
up data, modifying data)? Once a minute? Once an hour? Once a day? Once
a week?
Mark,
these are all very good points!!!
You are absolutely correct that I'm going wrong way making normal use
painful for twice in a life time task optimization.
I'll take your points.
Thanks for the advice.
On Jul 22, 12:16 pm, Mark Murphy mmur...@commonsware.com wrote:
gnugu wrote:
Say
Just creating 1000 objects isn't going to take 45 seconds, it sounds like
I was running it in the emulator with the debugger attached. I'll
check logs and try the profiler.
Thanks.
On Jul 22, 12:02 pm, Dianne Hackborn hack...@android.com wrote:
Just creating 1000 objects isn't going to take
Oh having the debugger attached always have a significant impact on
performance.
Always remember, once you say the word performance there should be a real
device involved that is driving the work.
On Wed, Jul 22, 2009 at 12:57 PM, gnugu rho...@gmail.com wrote:
Just creating 1000 objects
Yes, there were some good suggestions. And, yes, using the database
is a great idea. But I have another, and I use this general approach
a lot when I need to import/export data or just ship files around on a
device, or when memory and performance are key.
XML parsers, streaming or in-memory
Oh - almost forgot. Look at the presentation from Google I/O 2009 on
programming for performance and gaming (I forget the title). It was
really good, because the presenter gives some other really good
general performance tips.
Cheers,
Richard Schilling
Root Wireless
On Jul 22, 1:17 pm,
I should have known better.
In my unit test I populate the notes texts using String.format(blah
blah blah %1d, index). Of course it takes a long time...
When I just assign a string then creating 1000 objects is no problem.
Now serializing all the objects into XML
(org.xmlpull.v1.XmlSerializer)
Richard,
thanks for suggestion.
My notes are structured. The app allows for the notes to be in the
folders one level deep. That's why I opted for XML.
I'll try to find out the presentation and post the link here for
others.
On Jul 22, 1:17 pm, Richard Schilling richard.rootwirel...@gmail.com
There seem to be two performance related videos on Google I/O site:
Turbo-charge your UI: How to Make your Android UI Fast and Efficient
(http://code.google.com/events/io/sessions/
TurboChargeUiAndroidFast.html).
and
Writing Real-Time Games for Android (http://code.google.com/events/io/
20 matches
Mail list logo