Tips for Debugging Your Apps

134 views
Skip to first unread message

Prashant (Google)

unread,
Feb 24, 2010, 5:02:51 AM2/24/10
to Orkut Developer Forum

---------- Forwarded message ----------
From: Dhaval Pancholi <dhavalyo...@gmail.com>
Date: Feb 24, 12:33 pm

I have come through many posts where they take
you step by step how to write an orkut application but there are very
very few posts which  help developers to debug an orkut application.

Following few debugging tips always work for me.

1) IMP. point Check whether your new xml is been loaded. orkut always
takes xml fom cache so whenever you upload your new xml it does'nt
come from your server it comes from orkut cache. So Solution append
&bpc=1 in your xml url so that your entire url looks like
http://www.yourdomain.com/abc.xml?bpc=1
To be totally sure that my new xml is been loaded i generally append
version number and have an alert in the first function of my xml which
points me out my mxl version alert(' v-1.1');
alert(' v-1.2'); and etc.

2) Use Firebug-firefox addon to show you your javascript errors.

3) If you get error 500 Internal Server Error. Check your url you
submitted to orkut in a stand alone page. There might be a case your
server may be at fault.

4) Now in profile view if you are calling some json data with url
using profile templates check that url in a stand alone. to see
whether your file outputs proper json formatted string.

5) Many times orkut returns us an object in a callback function now
this is very frustrating thing now how on earth would i know what data
that object contains. Trust me there are many times where you would
want to use the returned object. So following function i use which
gives me all the properties and methods of the object which helps me a
lot.

Pass any object in this function and your would get all the properties
and methods in the alert box.

function popUpProperties(inobj) {
        var html="";
        for (objprop in inobj) {
        html=html+objprop + ' => ' + inobj[objprop] + '\n';
        }
        alert(html);

}

6) For the last one this will not help you debug but it will
definitely help you not freak out. There are many posts telling i got
your token has been expired.{I posted  the same questions few months
ago :) } So in this case here is what you do. You logout of your
sandbox account and then you log in again and then start working with
your application. Your authorization token seems to get destroyed when
you clear your
cache etc.

Robson Dantas

unread,
Feb 26, 2010, 4:57:38 PM2/26/10
to opensoci...@googlegroups.com
Great resource Prashant!

Just want to add another lines which might help:

1 - Opensocial extension for firebug - helps to debug, and allows to inject javascript without needing to reload the page:

2 - OSDE is a great Eclipse Plugin to develop Opensocial Apps:

Regards,

Robson Dantas

2010/2/24 Prashant (Google) <p...@google.com>

--
You received this message because you are subscribed to the Google Groups "Orkut Developer Forum" group.
To post to this group, send email to opensoci...@googlegroups.com.
To unsubscribe from this group, send email to opensocial-ork...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/opensocial-orkut?hl=en.


Prashant (Google)

unread,
Mar 9, 2010, 11:57:20 PM3/9/10
to Orkut Developer Forum
Thanks again Robson!

> > opensocial-ork...@googlegroups.com<opensocial-orkut%2Bunsubscrib e...@googlegroups.com>

Guido

unread,
Mar 10, 2011, 5:02:50 PM3/10/11
to opensoci...@googlegroups.com
very good,
I like your work..
later
Reply all
Reply to author
Forward
0 new messages