parse android upload and download
<p>i am using the services of parse.com, android guide:</p>

<p><a href="https://www.parse.com/docs/android_guide" rel="nofollow">https://www.parse.com/docs/android_guide</a></p>

<p>and it  didnt work for me (i get a message: app must be closed...)</p>

<p>here is my code:</p>

<pre><code>gameScore = new ParseObject("GameScore");
gameScore.put("score", 1337);
gameScore.put("playerName", "Sean Plott");
gameScore.put("cheatMode", false);
try {
    gameScore.save();
} catch (ParseException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}
gameScore.saveInBackground(new SaveCallback() {
      public void done(ParseException e) {
        //  Access the object id here
          objectId= gameScore.getObjectId();
      }
    });

ParseQuery query = new ParseQuery("GameScore");

query.getInBackground(objectId, new GetCallback() {

@Override
public void done(ParseObject parseObject, ParseException arg1) {
    // TODO Auto-generated method stub
    int score= parseObject.getInt("score");
    Integer i =new Integer(score);
    t1.setText(i.toString());
}
});
</code></pre>

<p>and here is the Logcat:</p>

<pre><code>02-28 09:59:10.552: E/AndroidRuntime(773): FATAL EXCEPTION: main
02-28 09:59:10.552: E/AndroidRuntime(773): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.salebook/com.example.salebook.MainActivity}: java.lang.NullPointerException
02-28 09:59:10.552: E/AndroidRuntime(773):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
02-28 09:59:10.552: E/AndroidRuntime(773):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
02-28 09:59:10.552: E/AndroidRuntime(773):  at android.app.ActivityThread.access$600(ActivityThread.java:141)
02-28 09:59:10.552: E/AndroidRuntime(773):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
02-28 09:59:10.552: E/AndroidRuntime(773):  at android.os.Handler.dispatchMessage(Handler.java:99)
02-28 09:59:10.552: E/AndroidRuntime(773):  at android.os.Looper.loop(Looper.java:137)
02-28 09:59:10.552: E/AndroidRuntime(773):  at android.app.ActivityThread.main(ActivityThread.java:5041)
02-28 09:59:10.552: E/AndroidRuntime(773):  at java.lang.reflect.Method.invokeNative(Native Method)
02-28 09:59:10.552: E/AndroidRuntime(773):  at java.lang.reflect.Method.invoke(Method.java:511)
02-28 09:59:10.552: E/AndroidRuntime(773):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
02-28 09:59:10.552: E/AndroidRuntime(773):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
02-28 09:59:10.552: E/AndroidRuntime(773):  at dalvik.system.NativeStart.main(Native Method)
02-28 09:59:10.552: E/AndroidRuntime(773): Caused by: java.lang.NullPointerException
02-28 09:59:10.552: E/AndroidRuntime(773):  at com.example.salebook.MainActivity.onCreate(MainActivity.java:69)
02-28 09:59:10.552: E/AndroidRuntime(773):  at android.app.Activity.performCreate(Activity.java:5104)
02-28 09:59:10.552: E/AndroidRuntime(773):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
02-28 09:59:10.552: E/AndroidRuntime(773):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
02-28 09:59:10.552: E/AndroidRuntime(773):  ... 11 more
</code></pre>

<p>Also, when i am on debugging mode, i see that  the objectId is null ,although i can see in the server that the object uploded succesfully with problem and it has a valid objectId.</p>

<p>Also, when i look in the gameScore object in eclipse i can see that it has the same objectId as in the server , however again it return me null in the objectId</p>

<p>thanks</p>
