2017-11-05 5 views
0

これは愚かな質問ですが、私はParseUserでテストユーザーを追加しようとしています。何らかの理由で、サーバーに追加されていません。どんな助けもありがとうございます。申し訳ありませんが、これは明らかなもののように見えますが、私はAndroidプログラミングを始めました。androidでparseUserをセットアップする際の問題

活動

public class SignupActivity extends AppCompatActivity { 


    @Override 
    protected void onCreate(Bundle savedInstanceState) { 
     super.onCreate(savedInstanceState); 
     setContentView(R.layout.activity_signup); 

     final ParseUser currentUser = new ParseUser(); 


     currentUser.setUsername("Test"); 
     currentUser.setPassword("xxx"); 
     currentUser.setEmail("[email protected]"); 
     currentUser.signUpInBackground(new SignUpCallback() { 
      @Override 
      public void done(ParseException e) { 
       if (e == null){ 
        Log.i("User added", "successful"); 
       } 
      } 
     }); 

}} 

アプリケーションクラス

public class MainApplication extends Application { 

    @Override 
    public void onCreate(){ 
     super.onCreate(); 

     Parse.enableLocalDatastore(this); 

     Parse.initialize(new Parse.Configuration.Builder(getApplicationContext()) 
       .applicationId("{I have actual app ID here}") 
       .clientKey("{I have client key here}") 
       .server("{It is here}") 
       .build() 
    ); 

     ParseObject parseObject = new ParseObject("FloridaLaw"); 


     ParseACL defaultACL = new ParseACL(); 
     defaultACL.setPublicReadAccess(true); 
     defaultACL.setPublicWriteAccess(true); 
     ParseACL.setDefaultACL(defaultACL, true); 



    } 
} 

PrintTrace

11-04 19:56:44.678 22669-22669/? I/zygote: Not late-enabling -Xcheck:jni (already on) 
11-04 19:56:44.718 22669-22669/? W/zygote: Unexpected CPU variant for X86 using defaults: x86 
11-04 19:56:45.206 22669-22669/com.ronaldpitt.floridalaw I/InstantRun: starting instant run server: is main process 
11-04 19:56:45.520 22669-22676/com.ronaldpitt.floridalaw I/zygote: Waiting for a blocking GC ObjectsAllocated 
11-04 19:56:45.672 22669-22680/com.ronaldpitt.floridalaw I/zygote: Background concurrent copying GC freed 7395(2MB) AllocSpace objects, 0(0B) LOS objects, 59% free, 1051KB/2MB, paused 3.900ms total 182.247ms 
11-04 19:56:45.677 22669-22676/com.ronaldpitt.floridalaw I/zygote: WaitForGcToComplete blocked for 156.076ms for cause ObjectsAllocated 
11-04 19:56:46.047 22669-22721/com.ronaldpitt.floridalaw I/OpenGLRenderer: Initialized EGL, version 1.4 
11-04 19:56:46.049 22669-22721/com.ronaldpitt.floridalaw W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without... 

答えて

0

は、あなたがAndroidManifest.xmlにあなたのApplicationクラスMainApplication.javaを追加したことがありますか?

<application 
    android:name=".MainApplication" 
    ...> 
    ... 
</application> 

動作しない場合は代わりに、ApplicationクラスのAndroidManifest.xmlに直接それをやってみてください

<application ...> 
    <meta-data 
    android:name="com.parse.SERVER_URL" 
    android:value="@string/parse_server_url" /> 
    <meta-data 
    android:name="com.parse.APPLICATION_ID" 
    android:value="@string/parse_app_id" /> 
    <meta-data 
    android:name="com.parse.CLIENT_KEY" 
    android:value="@string/parse_client_key" 
    ... 
</application> 
関連する問題