Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize the Registration and Login Program by android

2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces the relevant knowledge of "how to realize the registration login program in android". The editor shows you the operation process through the actual case. The operation method is simple, fast and practical. I hope that this article "how to realize the registration login program in android" can help you solve the problem.

Registration page:

User_register.xml:

"

Process the Activity of the registration page:

Package com.example.foreveross.office; import java.io.IOException;import java.io.UnsupportedEncodingException;import java.util.ArrayList;import java.util.List; import org.apache.http.HttpEntity;import org.apache.http.HttpResponse;import org.apache.http.NameValuePair;import org.apache.http.ParseException;import org.apache.http.client.ClientProtocolException;import org.apache.http.client.HttpClient;import org.apache.http.client.entity.UrlEncodedFormEntity;import org.apache.http.client.methods.HttpPost Import org.apache.http.impl.client.DefaultHttpClient;import org.apache.http.message.BasicNameValuePair;import org.apache.http.util.EntityUtils; import com.example.wenandroid.R;import android.app.Activity;import android.os.Bundle;import android.os.StrictMode;import android.view.View;import android.view.View.OnClickListener;import android.view.View.OnFocusChangeListener;import android.widget.Button;import android.widget.EditText;import android.widget.Toast; public class UserRegister extends Activity {private EditText register_username;private EditText register_passwd Private EditText reregister_passwd;private Button register_submit; @ Override protected void onCreate (Bundle savedInstanceState) {/ / TODO Auto-generated method stub super.onCreate (savedInstanceState); StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder () .permitAll () .build (); StrictMode.setThreadPolicy (policy); setContentView (R.layout.user_register); register_username= (EditText) findViewById (R.id.register_username) Register_passwd= (EditText) findViewById (R.id.register_passwd); reregister_passwd= (EditText) findViewById (R.id.reregister_passwd); register_submit= (Button) findViewById (R.id.register_submit) Register_username.setOnFocusChangeListener (new OnFocusChangeListener () {@ Override public void onFocusChange (View v, boolean hasFocus) {/ / TODO Auto-generated method stub if (! hasFocus) {if (register_username.getText (). ToString (). Trim (). Length ()

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report