I am new to Parse.com and trying to the quick start project. I am following each and every step to build an app on android platform. But I am getting "no data yet" message everytime I click on Test button
.
What I've done so far is:
MainActivity:
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Parse.initialize(this, "AMRjGNY53W2HFZILS7M64rZy3b8mSz3qGkf1KeOE","xquKy2rT8FSeFYCd8A8mIVOCqqO5SlSMrCwlZ0ux");
ParseAnalytics.trackAppOpened(getIntent());
ParseObject testObject = new ParseObject("TestObject");
testObject.put("foo", "bar");
testObject.saveInBackground();
}}
My Application class is :
package com.example.hello1;
import android.app.Application;
import com.parse.Parse;
public class ParseApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
// Add your initialization code here
Parse.initialize(this, "AMRjGNY53W2HFZILS7M64rZy3b8mSz3qGkf1KeOE", "xquKy2rT8FSeFYCd8A8mIVOCqqO5SlSMrCwlZ0ux");
}
and the manifest file :
<uses-sdk
android:minSdkVersion="7"
android:targetSdkVersion="19" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:name="ParseApplication"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:name="com.example.hello1.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
After running the app when I click on test on parse.com, it says no data yet. !!
I don't understand what wrong I'm doing !!
You can just try to see what happens when you try to save the object. The code below is an example to show how can you do that with a save callback.
I also encountered this problem and when i implemented this method, i found out that i get an https connection error. Later i see that my device's hosts file is blocking the api call.
Use this code and try again, you need put Parse.initialize in the first line
I had the same problem. Go to your manifest file and make sure that you application node is referencing your Java file.
For example you have your application class below
public class MyApplication extends Application {...}
in the AndroidManifest you need something like this...
That way your application file can be called by the application. =)
Make sure you use your fully qualified class name.