Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android Build a Self-Destructing Message Android App Adding Users Using Parse.com Creating an Account and App on Parse.com

Hasan Nagaria
Hasan Nagaria
4,855 Points

Help setting up Parse please

This is quickly getting frustrating... every single video im having to spend an hour going through the comments as well as the internet.

Anyways I tried to do everything that was detailed on Parse.com but still havent been able to get data through.... below are my files please have a look and let me know what im missing

Hasan Nagaria
Hasan Nagaria
4,855 Points

apply plugin: 'com.android.application'

android { compileSdkVersion 23 buildToolsVersion "23.0.0"

defaultConfig {
    applicationId "com.example.administrator.ribbitv2"
    minSdkVersion 14
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

}

dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:23.0.1' compile 'com.parse.bolts:bolts-android:1.+' compile 'com.parse:parse-android:1.+' }

Hasan Nagaria
Hasan Nagaria
4,855 Points

<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.administrator.ribbitv2" >

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

<application

    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme">

    <meta-data
        android:name="com.parse.APPLICATION_ID"
        android:value="vlX6lcw3SjSi1AsVnuptdT4lkc7beXyadjCbEpsu" />
    <meta-data
        android:name="com.parse.CLIENT_KEY"
        android:value="DHEgfoyMFBQ8Tf2Ksp86hYOCEwxShRrQiuv0U3rv" />
    <activity
        android:name=".MainActivity"
        android:label="@string/app_name"
        android:screenOrientation="portrait" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name=".LoginActivity"
        android:label="@string/title_activity_login"
        android:screenOrientation="portrait" >
    </activity>
    <activity
        android:name=".SignUpActivity"
        android:label="@string/title_activity_sign_up"
        android:parentActivityName="LoginActivity"
        android:screenOrientation="portrait">
    </activity>
</application>

</manifest>

Hasan Nagaria
Hasan Nagaria
4,855 Points

package com.example.administrator.ribbitv2;

import android.app.Application;

import com.parse.Parse; import com.parse.ParseObject;

/**

  • Created by Administrator on 1/29/2016. */ public class RibbitApplication extends Application { @Override public void onCreate(){ super.onCreate();

    Parse.enableLocalDatastore(this);
    
    Parse.initialize(this);
    ParseObject testObject = new ParseObject("TestObject");
    testObject.put("foo", "bar");
    testObject.saveInBackground();
    

    }

}

2 Answers

Hasan Nagaria
Hasan Nagaria
4,855 Points

Never mind...I think I got it. Jesus that was painful

Harry James
Harry James
14,780 Points

Hey Hasan!

Sorry to hear you were having trouble getting Parse working there!

If everything's working fine now, please mark your answer as the Best Answer to let other users know that it has been solved. If you're still having issues, let me know and I'll try my best to help out :)

Hasan Nagaria
Hasan Nagaria
4,855 Points

When I try to do this in an empty project it works fine and the data is registered but the same thing in this example doesnt work does it have something to do with the fact that im extending application ?