Welcome Developers!

in

Welcome!

in

Null pointer exception on request - Using Android SDK

Last post 07-21-2010 4:57 PM by Joel. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 07-15-2010 2:42 PM

    • Fakey
    • Not Ranked
    • Joined on 07-14-2010
    • Posts 5

    Null pointer exception on request - Using Android SDK

    I'm new to this, I can't figure out what's wrong with my code. I want to make a simple request to the API, I don't know why I get a null pointer exception error in my callback. Am I doing something obviously wrong? Here's the chunk of code. String REQUEST_STRING = "http://opensocial.myspace.com/roa/09/statusmood/@me/@self"; MSRequest mRequest = new MSRequest(MSSession.getSession(), new test_callback()); mRequest.setUrl(REQUEST_STRING); mRequest.get(); Also, I was wondering. If I wanted to get a list of all the apps that I have in my MySpace account, how would I go about making the request? I'm new to developing here, so I'd appreciate some help/advice. Let me know if you want some more info about Thanks!
    Filed under: , ,
  • 07-16-2010 2:41 PM In reply to

    Re: Null pointer exception on request - Using Android SDK

     I don't believe there is an api call to pull an @self list of user appID's. But for your other problem, can you send me a Wireshark or other http capture of the request/response to developerrelations@myspace-inc.com?

     

    thanks,

    Joel

  • 07-19-2010 9:23 AM In reply to

    • Fakey
    • Not Ranked
    • Joined on 07-14-2010
    • Posts 5

    Re: Null pointer exception on request - Using Android SDK

    Ok, then could you give me an example of a string that I should use for my REQUEST_STRING variable, just to see if I can get ANY sort of response from the MySpace server? Thanks in advance!
  • 07-19-2010 2:20 PM In reply to

    Re: Null pointer exception on request - Using Android SDK

     Request token request? I replied to you on the other thread you asked this question. It is part of the general oauth flow, with the exception that the signature method must be HMAC-SHA1 for Myspace. 

     Look here as well: http://wiki.developer.myspace.com/index.php?title=OAuth_REST_API_Usage_-_Authentication_Process

    You make a call here, and after request_token put a "?" and place the params described in the wiki making sure to then generate an oauth signature for them using HMAC-SHA1:

    http://api.myspace.com/request_token
     

     

    thanks,

    Joel

  • 07-20-2010 6:12 PM In reply to

    • Fakey
    • Not Ranked
    • Joined on 07-14-2010
    • Posts 5

    Re: Null pointer exception on request - Using Android SDK

    But which params do I need to pass with that request? I'm assuming oauth_consumer_key oauth_nonce oauth_signature_method oauth_timestamp oauth_version oauth_signature. Is that correct? Now the question is, I only know the consumer key, what do I need to put in for the others? I could figure out nonce, signature_method, timestamp, and version I guess. But where do I get the signature from?
  • 07-21-2010 4:57 PM In reply to

    Re: Null pointer exception on request - Using Android SDK

     You might want to read the Oauth spec:

    http://oauth.net/core/1.0/

    The oauth signature is generated from the very params you use in the base string (request URI) using the algorithm you listed there (in this case HMAC-SHA1).

    We also have a testing tool here:

    http://wiki.developer.myspace.com/index.php?title=OAuth_Testing_Tool

     ..as well as another discussion on Oauth flow here:

    http://wiki.developer.myspace.com/index.php?title=OAuth_REST_API_Usage_-_Authentication_Process

     

    you use your consumer secret to generate the oauth_signature and you append it to your base string so our servers can verify this request is legitimate.

     

    thanks,

    Joel

Page 1 of 1 (6 items)