You don't read in a byte vector. You read in a string. You convert the
string to a long.

You really need to back off of Android development for a while and learn Java.

On Sat, Feb 5, 2011 at 9:08 AM, MobileVisuals <[email protected]> wrote:
> I tried the printwriter and I can use it to write the information as a
> String. But how can I read this information to extract it as a long? I
> tried
>
> in = new FileInputStream(fileLocation);
>  in.read(readData); //readData is  a byte vector
> String readString=new String(readData);
>
> but this does not work, because the string that I read is not the same
> that I store. Is there a special class that I can use, so I can read
> the information as a String instead of a byte vector?
>
> On Feb 4, 6:36 pm, Mark Murphy <[email protected]> wrote:
>> Use a PrintWriter.
>>
>>
>>
>> On Fri, Feb 4, 2011 at 12:33 PM, MobileVisuals <[email protected]> 
>> wrote:
>> > 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 [email protected]
>> > To unsubscribe from this group, send email to
>> > [email protected]
>> > For more options, visit this group at
>> >http://groups.google.com/group/android-developers?hl=en
>>
>> --
>> Mark Murphy (a Commons 
>> Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>>
>> _The Busy Coder's Guide to *Advanced* Android Development_ Version 1.9
>> Available!
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_The Busy Coder's Guide to Android Development_ Version 3.4 Available!

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

Reply via email to