On Mon, Apr 19, 2010 at 7:51 AM, ikalbeniz <txup...@gmail.com> wrote:

> i have used this API to access to android market:
>
> http://code.google.com/p/android-market-api/ (uses google-protobuff-
> api)
>

Note that the android-market-api project is not from or authorized by
Google.  It looks like they reverse-engineered the protocol.  You might want
to verify that the android market terms of service allow this (I have no
idea if they do or not).


> i have get all the comments from an app and i get that one of the
> comments date is 1269450764071 (the one from ikalbeniz)
>
> in my custom class all the HTTP protocol is developed and works ok but
> when i get the comments data i don know how ti parse some params..
>
> here the comments http response data:
>
> http://i43.tinypic.com/igxp52.jpg
>
> here the proto of the comment taken from android-market-api
>
> message Comment {
>        optional string text = 1;
>        optional int32 rating = 2;
>        optional string authorName = 3;
>        optional uint64 creationTime = 4;
>        optional string authorId = 5;
> }
>
> i have underlined the bytestring that represents "uint64 creationTime"
> but the android-market-api when i get the creationtime the result is
> 1269450764071.. i have been searching on android-market-api code but i
> have not get any clear info so i have supposed that the conversion is
> made by google-protobuff-api
>

As Marc points out, uint64 is a varint-encoded type.  You have highlighted 7
bytes in your screenshot, and you gave 8 bytes in your original e-mail, but
only the first *six* of these bytes are the actual number (varint-encoded)
-- the bytes after that are part of the next field.  It sounds like the PHP
protobuf implementation you are using may have a bug in the decoder.


>
>
> On 19 abr, 16:40, Kenton Varda <ken...@google.com> wrote:
> > AFAICT the bytes you gave do, in fact, decode to 1453014483955211943.
>  Where
> > did the 1269450764071 result come from?  Is that from decoding the exact
> > same protocol buffer in Java, or from some other higher-level Java API?
> >
> >
> >
> > On Mon, Apr 19, 2010 at 7:31 AM, ikalbeniz <txup...@gmail.com> wrote:
> > > Hi,
> >
> > > I am developing a custom (and more simple) protobuff class for php.
> > > The problem I have is with date format that is stored as uint64. For
> > > example in a stream I have get from google Iknow that the “creation
> > > time” is satored in a bytearray with A7-DE-A5-89-F9-24-2A-14 if I
> > > convert this to uint64 I get this number 1453014483955211943 but I
> > > know (using java appi) that the result is 1269450764071.
> >
> > > I do not know how de conversion has been done and if it is posible to
> > > do this in php.
> >
> > > --
> > > You received this message because you are subscribed to the Google
> Groups
> > > "Protocol Buffers" group.
> > > To post to this group, send email to proto...@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > > protobuf+unsubscr...@googlegroups.com<protobuf%2bunsubscr...@googlegroups.com>
> <protobuf%2bunsubscr...@googlegroups.com<protobuf%252bunsubscr...@googlegroups.com>
> >
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/protobuf?hl=en.
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> > To post to this group, send email to proto...@googlegroups.com.
> > To unsubscribe from this group, send email to
> protobuf+unsubscr...@googlegroups.com<protobuf%2bunsubscr...@googlegroups.com>
> .
> > For more options, visit this group athttp://
> groups.google.com/group/protobuf?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To post to this group, send email to proto...@googlegroups.com.
> To unsubscribe from this group, send email to
> protobuf+unsubscr...@googlegroups.com<protobuf%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/protobuf?hl=en.
>
>

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

Reply via email to