2017-12-11 10 views
-1

私はアンドロイドアプリケーションをデバッグしようとしています。登録プロセスでは、私は電話番号が必要です。私は、ソースコードは以下のように見えます:登録プロセスがAndroidアプリケーションで奇妙に見える

private void handleRegistrationIntent(Intent intent) { 
    markAsVerifying(true); 
    Log.w("RegistrationService","State change to handleRegistrationIntent"); 

    AccountCreationSocket socket = null; 
    String number    = intent.getStringExtra("e164number"); 

try { 
    String password = Util.getSecret(18); 
    String key  = Util.getSecret(40); 

    SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this); 
    Editor editor     = preferences.edit(); 
    editor.putString(Constants.PASSWORD_PREFERENCE, password); 
    editor.putString(Constants.KEY_PREFERENCE, key); 
    editor.commit(); 

    initializeChallengeListener(); 

    setState(new RegistrationState(RegistrationState.STATE_CONNECTING, number)); 
    Log.w("RegistrationService", "State change to STATE_CONNECTING"); 
    System.out.println(number); 
    socket = new AccountCreationSocket(this, number, password); 
    socket.createAccount(false); 
    socket.close(); 

    setState(new RegistrationState(RegistrationState.STATE_VERIFYING_SMS, number)); 
    Log.w("RegistrationService", "State change to STATE_VERIFYING_SMS"); 
    String challenge = waitForChallenge(); 
    socket   = new AccountCreationSocket(this, number, password); 
    socket.verifyAccount(challenge, key); 

LogcatのAndroidでは、私はこのログを取得:

12-11 10:49:12.561 7769-7769/com.qepon W/RegistrationProgress: State change to handleStateIdle

12-11 10:49:12.611 7769-7769/com.apps I/Timeline: Timeline: Activity_idle id: [email protected] time:10508674

12-11 10:49:12.611 7769-8779/com.apps W/RegistrationService: State change to handleRegistrationIntent

12-11 10:49:12.651 7769-8779/com.apps W/RegistrationService: State change to STATE_CONNECTING

12-11 10:49:12.651 7769-8779/com.apps I/System.out: +62898xxxxxxx

それはオーバーです。 GUIでは、ネットワークに接続できませんが、スマートフォンでブラウジングできます。それに加えて、私はサーバーに何か間違いや何か間違いがない。 このアプリケーションの問題点は混乱しています。誰も私を助けることができますか?ありがとう

答えて

0

android.pemission.INTERNETを使用してandroidManifest.xmlファイルのインターネットにアクセスするためのアプリケーションの許可を設定しましたか?

+0

はい、androidManifest.xmlにandroid.permission.INTERNETを追加しました。=

+0

これは質問に対する回答ではありません。十分な[評判](https://stackoverflow.com/help/whats-reputation)があれば、[投稿にコメントする]ことができます(https://stackoverflow.com/help/privileges/comment)。代わりに、[質問者からの明確化を必要としない回答を提供する](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-c​​an- i-do-代わりに)。 - [レビューから](/レビュー/低品質の投稿/ 18217126) –

関連する問題