Java Android应用程序中的注册过程看起来很奇怪
我正在调试一个android应用程序。在注册过程中,我只需要一个电话号码。我有一个如下所示的源代码:Java Android应用程序中的注册过程看起来很奇怪,java,android,Java,Android,我正在调试一个android应用程序。在注册过程中,我只需要一个电话号码。我有一个如下所示的源代码: private void handleRegistrationIntent(Intent intent) { markAsVerifying(true); Log.w("RegistrationService","State change to handleRegistrationIntent"); AccountCreation
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:状态更改为handleStateIdle
12-11 10:49:12.611 7769-7769/com.apps I/Timeline:Timeline:Activity\u idle id:android.os。BinderProxy@1a8792e8时间:10508674
12-11 10:49:12.611 7769-8779/com.apps W/RegistrationService:状态更改为HandlerRegistrationContent
12-11 10:49:12.651 7769-8779/com.apps W/RegistrationService:状态更改为状态
12-11 10:49:12.651 7769-8779/com.apps I/System.out:+62898xxxxxx
结束了。在GUI中,我收到一个错误:无法连接到网络,但我可以使用智能手机浏览。除此之外,我没有在服务器中发现错误或其他错误。
我不知道这个应用程序有什么问题。有人能帮我吗?谢谢您是否使用
android.pemission.internet
在android manifest.xml
文件中设置了应用程序访问internet的权限?是的,我已在android manifest.xml中添加了android.permission.internet=