Saturday, February 5, 2011

[android-developers] How to store a timestamp to the sd card?

I am making a timelimited trial version of a live wallpaper app. I
need to store the timestamp on the SD card, to keep track of the
trialperiod. I can get the current time with

long currentTime=System.currentTimeMillis();

I want to store this with a FileOutputStream object. The problem is
that FileOutputStream only has write methods for byte vectors. Byte
can only be up to 128, and timestamps are bigger numbers than that. I
assume that I have to convert the timestamp number, which is a long,
into a byte vector. Is there any easy way to do this?

Or is there any other way of storing the long value without using the
write methods for byte vectors?

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment