Android如何通過(guò)手機(jī)獲取驗(yàn)證碼來(lái)完成注冊(cè)功能
注冊(cè)很多app或者網(wǎng)絡(luò)賬戶的時(shí)候,經(jīng)常需要手機(jī)獲取驗(yàn)證碼,來(lái)完成注冊(cè),那時(shí)年少,只是覺(jué)得手機(jī)獲取驗(yàn)證碼這件事兒很好玩,并沒(méi)有關(guān)心太多,她是如何實(shí)現(xiàn)的,以及她背后的故事到底是什么樣子的,現(xiàn)在小編接手的這個(gè)項(xiàng)目里面,就需要通過(guò)手機(jī)號(hào)進(jìn)行注冊(cè),并且手機(jī)號(hào)發(fā)送相應(yīng)的驗(yàn)證碼,來(lái)完成注冊(cè),那么在一些應(yīng)用app里面到底是如何實(shí)現(xiàn)點(diǎn)擊按鈕獲取驗(yàn)證碼,來(lái)完成注冊(cè)這整個(gè)流程的呢?今天小編就以注冊(cè)為例,和小伙伴們分享一下,如何通過(guò)手機(jī)號(hào)獲取驗(yàn)證碼來(lái)完成注冊(cè)的一整套流程以及如何采用正則表達(dá)式來(lái)驗(yàn)證手機(jī)號(hào)碼是否符合電信、移動(dòng)、聯(lián)通的規(guī)范。
首先我們需要做的第一步就是ApiClient里面編寫獲取驗(yàn)證碼的方法,具體代碼如下:
<span style="font-size:18px;">/** * 說(shuō)明:獲取驗(yàn)證碼 * 作者:丁國(guó)華 * 時(shí)間:2015-8-27 下午5:47:36 */ public static String getValidateCode(AppContext appContext, Map<String, Object> map) throws AppException { // 定義要訪問(wèn)的接口和要強(qiáng)轉(zhuǎn)的實(shí)體 String validateUrl = _MakeURL(URLs.VALIDATE_CODE_URL, map); ValidateCode validateCode = null; try { // 獲取服務(wù)器端Json數(shù)據(jù) String json = http_get(appContext, validateUrl); // 解析為制定的實(shí)體對(duì)象 validateCode = (ValidateCode) JSON.parseObject(json, ValidateCode.class); } catch (Exception e) { if (e instanceof AppException) throw (AppException) e; throw AppException.network(e); } // 返回驗(yàn)證碼 return validateCode.getCode(); } </span>
第二步編寫AppContent里面的接口方法,具體代碼如下所示:
<span style="font-size:18px;">/** * 說(shuō)明:獲取服務(wù)器驗(yàn)證碼(不需要緩存) * 作者:丁國(guó)華 * @date 2015-8-28 上午9:07:14 */ public String getCode(Map<String, Object> map) throws AppException { String validateCode = ""; // 如果網(wǎng)絡(luò)可連接且解析無(wú)誤返回正確的驗(yàn)證碼,否則返回空字符串 if (isNetworkConnected()) { try { validateCode = ApiClient.getValidateCode(this, map); } catch (AppException e) { if (validateCode == "") { throw e; } } } return validateCode; } </span>
第三步,在StringUtils里面編寫驗(yàn)證號(hào)碼是否是手機(jī)號(hào)的正則表達(dá)式,具體代碼如下:
<span style="font-size:18px;"> /* 說(shuō)明:移動(dòng):134、135、136、137、138、139、150、151、157(TD)、158、159、187、188 * 聯(lián)通:130、131、132、152、155、156、185、186 * 電信:133、153、180、189 * 總結(jié)起來(lái)就是第一位必定為1,第二位必定為3或5或8,其他位置的可以為0-9 * 驗(yàn)證號(hào)碼 手機(jī)號(hào) 固話均可 * 作者:丁國(guó)華 * 2015年9月20日 13:52:35 */ public static boolean isPhoneNumberValid(String phoneNumber) { boolean isValid = false; String expression = "((^(13|15|18)[0-9]{9}$)|(^0[1,2]{1}\\d{1}-?\\d{8}$)|(^0[3-9] {1}\\d{2}-?\\d{7,8}$)|(^0[1,2]{1}\\d{1}-?\\d{8}-(\\d{1,4})$)|(^0[3-9]{1}\\d{2}-? \\d{7,8}-(\\d{1,4})$))"; CharSequence inputStr = phoneNumber; Pattern pattern = Pattern.compile(expression); Matcher matcher = pattern.matcher(inputStr); if (matcher.matches() ) { isValid = true; } return isValid; } </span>
第四步:編寫xml里面的文件,具體代碼如下所示:
<span style="font-size:18px;"><?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <LinearLayout style="@style/top_title_style" > <Button android:id="@+id/register_back_login" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="5dp" android:background="@null" android:drawableLeft="@drawable/back" android:paddingLeft="5dp" android:text=" 登錄" android:textColor="#FFFFFF" android:textSize="18sp" /> <!-- 注冊(cè)的布局 --> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="5dp" android:layout_marginTop="2dp" android:layout_weight="1" android:gravity="center" android:paddingLeft="4dp" android:text="注冊(cè)" android:textColor="#FFFFFF" android:textSize="20sp" /> <!-- 注冊(cè)的布局 --> <TextView android:id="@+id/nickname_confirm" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_marginTop="2dp" android:gravity="center" android:paddingLeft="60dp" android:paddingRight="10dp" android:textColor="#FFFFFF" android:textSize="20sp" /> </LinearLayout> <RelativeLayout android:layout_width="fill_parent" android:layout_height="45dp" android:minHeight="50.0dip" android:paddingLeft="14.0dip" android:paddingRight="12.0dip" > <ImageView android:layout_width="23.0dip" android:layout_height="23.0dip" android:layout_centerVertical="true" android:src="@drawable/user_picture" /> <EditText android:id="@+id/et_register_username_id" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="20dp" android:background="@null" android:hint="用戶名/手機(jī)號(hào)" android:paddingLeft="15dip" android:paddingTop="8dp" android:textColorHint="#BEBEBE" android:textSize="20sp" /> </RelativeLayout> <View style="@style/PersonalLine" /> <RelativeLayout android:layout_width="fill_parent" android:layout_height="45dp" android:minHeight="50.0dip" android:paddingLeft="14.0dip" android:paddingRight="12.0dip" > <ImageView android:layout_width="23.0dip" android:layout_height="23.0dip" android:layout_centerVertical="true" android:src="@drawable/phone_picture" /> <EditText android:id="@+id/et_register_code_id" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="20dp" android:background="@null" android:hint="請(qǐng)輸入驗(yàn)證碼" android:paddingLeft="15dip" android:paddingTop="8dp" android:textColorHint="#BEBEBE" android:textSize="20sp" /> <Button android:id="@+id/bt_getcode_id" android:layout_width="120dp" android:layout_height="35dp" android:layout_marginLeft="200dp" android:layout_marginTop="5dp" android:background="@drawable/shape1" android:text="獲取驗(yàn)證碼" android:textColor="#FFFFFF" android:textSize="10sp" /> </RelativeLayout> <View style="@style/PersonalLine" /> <RelativeLayout android:layout_width="fill_parent" android:layout_height="45dp" android:minHeight="50.0dip" android:paddingLeft="14.0dip" android:paddingRight="12.0dip" > <ImageView android:layout_width="23.0dip" android:layout_height="23.0dip" android:layout_centerVertical="true" android:src="@drawable/lock" /> <EditText android:id="@+id/et_register_password_id" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="20dp" android:background="@null" android:hint="請(qǐng)輸入新密碼" android:paddingLeft="15dip" android:paddingTop="8dp" android:textColorHint="#BEBEBE" android:textSize="20sp" /> </RelativeLayout> <View style="@style/PersonalLine" /> <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" > <!-- 小對(duì)勾的布局 --> <CheckBox android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="10dp" android:layout_marginLeft="-10dp" android:scaleX="0.8" android:scaleY="0.8" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:text="我同意" android:textSize="18sp" /> <TextView android:id="@+id/user_protocol" android:layout_width="200dp" android:layout_height="match_parent" android:layout_gravity="center_vertical" android:layout_marginLeft="5dp" android:gravity="center" android:text="用戶協(xié)議及隱私條款" android:textColor="#FE8B4A" android:textSize="18sp" /> </LinearLayout> <Button android:id="@+id/bt_register_id" android:layout_width="245dp" android:layout_height="45dp" android:layout_gravity="center_horizontal" android:layout_marginBottom="14dp" android:layout_marginLeft="15dp" android:layout_marginRight="15dp" android:layout_marginTop="5dp" android:background="@drawable/shape2" android:gravity="center" android:text="注 冊(cè)" android:textColor="#FFFFFF" android:textSize="15sp" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="80dp" android:paddingTop="5dp" android:text="您也可以直接登錄" android:textColor="#BEBEBE" android:textSize="20sp" /> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="10dp" android:baselineAligned="false" android:gravity="center" android:orientation="horizontal" > <LinearLayout android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:gravity="center" android:orientation="vertical" > <Button android:layout_width="60dp" android:layout_height="60dp" android:background="@drawable/weixin_login" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="微信登錄" android:textColor="#BEBEBE" android:textSize="20sp" /> </LinearLayout> <LinearLayout android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:gravity="center" android:orientation="vertical" > <Button android:layout_width="60dp" android:layout_height="60dp" android:background="@drawable/weibo_login" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="微博登錄" android:textColor="#BEBEBE" android:textSize="20sp" /> </LinearLayout> <LinearLayout android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:gravity="center" android:orientation="vertical" > <Button android:layout_width="60dp" android:layout_height="60dp" android:background="@drawable/qq_login" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="QQ登錄" android:textColor="#BEBEBE" android:textSize="20sp" /> </LinearLayout> </LinearLayout> </LinearLayout></span>
第五步:編寫java類RegisterActivity里面的代碼,具體如下所示:
<span style="font-size:18px;">package com.jczb.car.ui; import java.lang.ref.WeakReference; import java.util.HashMap; import java.util.Map; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; import android.widget.Toast; import com.jczb.car.AppContext; import com.jczb.car.AppException; import com.jczb.car.R; import com.jczb.car.common.StringUtils; /** * 說(shuō)明:注冊(cè)功能頁(yè)面 我們實(shí)現(xiàn)了取消線程的機(jī)制,從而保證它不會(huì)泄露 onDestroy()常常被用來(lái)在Activity推出前取消線程 * 作者: 吳利昌 * 時(shí)間: 2015-9-3上午9:19:15 */ public class RegisterActivity extends Activity implements OnClickListener { // 聲明用到的頁(yè)面控件 private EditText etRegisterName; private EditText etCode; private EditText etPassword; private Button btCode; private Button btRegister; private TextView tvUserProtocol; private Button btRegisterLoginBack; // 定義變量 private String userName; private String passWord; public boolean isChange = false; private boolean tag = true; private int i = 60; Thread thread = null; /**客戶端輸入的驗(yàn)證碼*/ private String valicationCode; /**服務(wù)器端獲取的驗(yàn)證碼*/ private static String serverValicationCode; /** 注冊(cè)時(shí)所帶的參數(shù) */ private Map<String, Object> registerParams = new HashMap<String, Object>(); /** 獲取驗(yàn)證碼時(shí)所帶的參數(shù) */ private Map<String, Object> codeParams = new HashMap<String, Object>(); /** 注冊(cè)是否成功 */ private String regisgerStatus; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.register); initView(); } /** * 說(shuō)明:初始化頁(yè)面控件和事件 * 作者: 吳利昌 * 時(shí)間: 2015-9-3 上午9:23:42 */ public void initView() { // 初始化控件 etRegisterName = (EditText) findViewById(R.id.et_register_username_id); etCode = (EditText) findViewById(R.id.et_register_code_id); etPassword = (EditText) findViewById(R.id.et_register_password_id); btCode = (Button) findViewById(R.id.bt_getcode_id); btRegister = (Button) findViewById(R.id.bt_register_id); tvUserProtocol=(TextView)findViewById(R.id.user_protocol); btRegisterLoginBack=(Button)findViewById(R.id.register_back_login); // 初始化監(jiān)聽(tīng)事件 btCode.setOnClickListener(this); btRegister.setOnClickListener(this); tvUserProtocol.setOnClickListener(this); btRegisterLoginBack.setOnClickListener(this); } private boolean isvalidate() { // TODO Auto-generated method stub // 獲取控件輸入的值 String userName = etRegisterName.getText().toString().trim(); if (StringUtils.isEmpty(userName)) { Toast.makeText(this, "手機(jī)號(hào)不能為空", Toast.LENGTH_SHORT).show(); return false; } if (!StringUtils.isPhoneNumberValid(userName)) { Toast.makeText(this, "手機(jī)號(hào)有誤", Toast.LENGTH_SHORT).show(); return false; } return true; } @Override public void onClick(View v) { switch (v.getId()) { case R.id.bt_getcode_id: if(!isvalidate()) break; btCode.setText("獲取驗(yàn)證碼"); btCode.setClickable(true); isChange = true; changeBtnGetCode(); getValidateCode(); break; case R.id.bt_register_id: register(); break; case R.id.user_protocol: Intent intentUserProtocol = new Intent(this,UserProtocolActivity.class); startActivity(intentUserProtocol); break; case R.id.register_back_login: this.finish(); break; default: break; } } private void changeBtnGetCode() { thread = new Thread() { @Override public void run() { if (tag) { while (i > 0) { i--; if (RegisterActivity.this == null) { break; } RegisterActivity.this .runOnUiThread(new Runnable() { @Override public void run() { btCode.setText("獲取驗(yàn)證碼(" + i + ")"); btCode .setClickable(false); } }); try { Thread.sleep(1000); } catch (InterruptedException e) { throw new RuntimeException(e); } } tag = false; } i = 60; tag = true; if (RegisterActivity.this != null) { RegisterActivity.this.runOnUiThread(new Runnable() { @Override public void run() { btCode.setText("獲取驗(yàn)證碼"); btCode.setClickable(true); } }); } }; }; thread.start(); } /** * 說(shuō)明:獲取驗(yàn)證碼 * * 作者: 吳利昌 * 時(shí)間: 2015-9-3 下午3:26:55 */ public boolean getValidateCode() { String name = etRegisterName.getText().toString().trim(); String code = etCode.getText().toString().trim(); if (name.equals("")) { Toast.makeText(this, "請(qǐng)輸入用戶名或手機(jī)號(hào)!", Toast.LENGTH_SHORT).show(); return false; }else { userName = name; valicationCode = code; Thread codeThread = new Thread(codeRunnable); codeThread.start(); } return true; } /** * 說(shuō)明:注冊(cè) * * 作者: 吳利昌 * 時(shí)間: 2015-9-3 下午3:27:23 */ public void register() { // 1.首先判斷輸入的值是否有效 // 2.然后判斷輸入的驗(yàn)證碼是否有效(防止沒(méi)有點(diǎn)擊獲取驗(yàn)證碼自己填的錯(cuò)誤驗(yàn)證碼) // 3.最后注冊(cè) if (isValid()) { if (valicationCode.equals(serverValicationCode)) { Thread thread = new Thread(sRunnable); thread.start(); }else { Toast.makeText(this, "輸入的驗(yàn)證碼不正確!", Toast.LENGTH_SHORT).show(); } } } //--------------------------------獲取驗(yàn)證碼線程處理過(guò)程---開(kāi)始----------------------------- /** * 自定義一個(gè)靜態(tài)的具有弱引用的Handler,解決內(nèi)存泄漏的問(wèn)題,本handler用來(lái)獲取驗(yàn)證碼 */ private static class CodeHandler extends Handler { // 持有對(duì)本外部類的弱引用 private final WeakReference<RegisterActivity> mActivity; public CodeHandler(RegisterActivity activity) { mActivity = new WeakReference<RegisterActivity>(activity); } @Override public void handleMessage(Message msg) { // 獲取上下文對(duì)象 RegisterActivity activity = mActivity.get(); if (activity != null) { switch (msg.what) { case 1: serverValicationCode = (String)msg.obj; //activity.etCode.setText(serverValicationCode); break; case -1: Toast.makeText(activity, "獲取驗(yàn)證碼失敗!", Toast.LENGTH_SHORT).show(); break; case 0: Toast.makeText(activity, "哎呀,出錯(cuò)啦..", Toast.LENGTH_SHORT).show(); break; default: break; } } } } /**實(shí)例化自定義的handler*/ private final CodeHandler codeHandler = new CodeHandler(this); private String serverCode=null; /**定義獲取驗(yàn)證碼的子線程*/ private Runnable codeRunnable = new Runnable() { @Override public void run() { Message msg = new Message(); Map<String, Object> map = new HashMap<String, Object>(); map.put("jbPhone", userName); // 獲取全局對(duì)象Application AppContext appContext = (AppContext) getApplication(); try { // 獲取服務(wù)器數(shù)據(jù) serverValicationCode = appContext.getCode(map); // 返回true則將消息的what值為1,為false則what為-1,異常為0 if (serverValicationCode.equals("")) { msg.what = -1; } else { msg.what = 1; msg.obj = serverValicationCode; } } catch (AppException e) { msg.what = 0; e.printStackTrace(); } codeHandler.sendMessage(msg); } };
//--------------------------------獲取驗(yàn)證碼線程處理過(guò)程----完成------------------------------
//--------------------------------注冊(cè)線程處理過(guò)程--開(kāi)始----------------------------------
/** * 自定義一個(gè)靜態(tài)的具有弱引用的Handler,解決內(nèi)存泄漏的問(wèn)題,注冊(cè)使用 */ private static class MyHandler extends Handler { // 持有對(duì)本外部類的弱引用 private final WeakReference<RegisterActivity> mActivity; public MyHandler(RegisterActivity activity) { mActivity = new WeakReference<RegisterActivity>(activity); } @Override public void handleMessage(Message msg) { // 獲取上下文對(duì)象 RegisterActivity activity = mActivity.get(); if (activity != null) { switch (msg.what) { case 1: Toast.makeText(activity, "注冊(cè)成功!", Toast.LENGTH_SHORT).show(); activity.finish(); break; case -1: Toast.makeText(activity, "注冊(cè)失敗!", Toast.LENGTH_SHORT).show(); break; case -2: Toast.makeText(activity, "該號(hào)已經(jīng)注冊(cè)!", Toast.LENGTH_SHORT).show(); break; case 0: Toast.makeText(activity, "哎呀,出錯(cuò)啦..", Toast.LENGTH_SHORT).show(); break; default: break; } } } } /**實(shí)例化自定義的handler*/ private final MyHandler mHandler = new MyHandler(this); /**自定義子線程*/ private Runnable sRunnable = new Runnable() { @Override public void run() { Message msg = new Message(); // 獲取全局對(duì)象Application AppContext appContext = (AppContext) getApplication(); try { // 獲取服務(wù)器數(shù)據(jù) regisgerStatus = appContext.register(registerParams); // 返回true則將消息的what值為1,為false則what為-1,異常為0 if (regisgerStatus.equals("true")) { msg.what = 1; msg.obj = regisgerStatus; } else if(regisgerStatus.equals("1")){ msg.what = -2; }else if(regisgerStatus.equals("false")){ msg.what = -1;} } catch (AppException e) { msg.what = 0; e.printStackTrace(); } mHandler.sendMessage(msg); } };
//--------------------------------注冊(cè)線程處理過(guò)程---完成-----------------------------------
/** * 說(shuō)明:注冊(cè)之前判斷數(shù)據(jù)是否為空 * * @return * 作者: 吳利昌 * 時(shí)間: 2015-9-3 下午3:29:04 */ public boolean isValid() { userName = etRegisterName.getText().toString().trim(); valicationCode = etCode.getText().toString().trim(); passWord = etPassword.getText().toString().trim(); if (userName.equals("")) { Toast.makeText(this, "用戶名不能為空!", Toast.LENGTH_SHORT).show(); return false; } if (valicationCode.equals("")) { Toast.makeText(this, "驗(yàn)證碼不能為空!", Toast.LENGTH_SHORT).show(); return false; } if(!serverValicationCode.equals(valicationCode)) { Toast.makeText(this, "驗(yàn)證碼錯(cuò)誤", Toast.LENGTH_SHORT).show(); return false; } if (passWord.equals("")) { Toast.makeText(this, "密碼不能為空!", Toast.LENGTH_SHORT).show(); return false; } else if (passWord.length() < 6) { Toast.makeText(this, "密碼至少6位!", Toast.LENGTH_SHORT).show(); return false; } registerParams.put("username", userName); registerParams.put("psd", passWord); return true; } } </span>
最后,我們來(lái)運(yùn)行一下,看看我們的效果,由于小編的genymotion不知道為什么不能運(yùn)行了,所以委屈小伙伴們一下,看不了動(dòng)態(tài)圖片了,不過(guò)并不影響,我們首先用一個(gè)號(hào)碼好注冊(cè)一下,如下圖所示:
看一下手機(jī)收到的驗(yàn)證碼:
最后來(lái)看一下,我們的注冊(cè):
小編寄語(yǔ):該博文,小編主要簡(jiǎn)單的介紹了如何通過(guò)手機(jī)獲取驗(yàn)證碼來(lái)完成注冊(cè)的功能,以及如何利用正則表達(dá)式來(lái)驗(yàn)證碼手機(jī)號(hào)碼是否符合移動(dòng)、聯(lián)通、電信。還是那句話對(duì)于小編來(lái)說(shuō),既是挑戰(zhàn)更是機(jī)遇,因?yàn)橹R(shí)都是相通的,再者來(lái)說(shuō),在小編的程序人生中,留下最珍貴的記憶,雖然以后小編不一定從事安卓這個(gè)行業(yè),代碼世界里,很多種事,有的甜蜜,有的溫馨,有的婉轉(zhuǎn)成歌,有的綿延不息,在這些故事里,我們唯一的共通之處就是,某年,某月,某個(gè)波瀾不驚的日子里,曾經(jīng)很愛(ài)很愛(ài)你!愛(ài)你--這段實(shí)習(xí)的日子里,安卓帶給小編的種種的驚喜。
- android實(shí)現(xiàn)注冊(cè)登錄程序
- Android實(shí)現(xiàn)登錄注冊(cè)頁(yè)面(下)
- Android實(shí)現(xiàn)登錄注冊(cè)功能
- Android基于Sqlite實(shí)現(xiàn)注冊(cè)和登錄功能
- Android實(shí)現(xiàn)注冊(cè)登錄界面的實(shí)例代碼
- Android設(shè)計(jì)登錄界面、找回密碼、注冊(cè)功能
- Android客戶端實(shí)現(xiàn)注冊(cè)、登錄詳解(1)
- Android開(kāi)發(fā)中實(shí)現(xiàn)用戶注冊(cè)和登陸的代碼實(shí)例分享
- Android用戶注冊(cè)界面簡(jiǎn)單設(shè)計(jì)
- Android用SharedPreferences實(shí)現(xiàn)登錄注冊(cè)注銷功能
相關(guān)文章
Android新建水平節(jié)點(diǎn)進(jìn)度條示例
這篇文章主要為大家介紹了Android新建水平節(jié)點(diǎn)進(jìn)度條示例,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪2022-06-06Okhttp、Retrofit進(jìn)度獲取的方法(一行代碼搞定)
本篇文章主要介紹了Okhttp、Retrofit進(jìn)度獲取的方法(一行代碼搞定),小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧2018-04-04Flutter實(shí)現(xiàn)漸變色加描邊字體效果
這篇文章介紹了Flutter實(shí)現(xiàn)漸變色描邊字體效果的方法,對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧2021-11-11Android內(nèi)存溢出及內(nèi)存泄漏原因進(jìn)解析
這篇文章主要介紹了Android內(nèi)存溢出及內(nèi)存泄漏原因解析,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下2020-08-08Android Loader詳細(xì)介紹及實(shí)例代碼
這篇文章主要介紹了Android Loader詳細(xì)介紹及實(shí)例代碼的相關(guān)資料,需要的朋友可以參考下2016-12-12Android編程之Button控件配合Toast控件用法分析
這篇文章主要介紹了Android編程之Button控件配合Toast控件用法,結(jié)合實(shí)例形式分析了Button控件及Toast控件的功能及具體使用技巧,需要的朋友可以參考下2015-12-12Android自定義加載控件實(shí)現(xiàn)數(shù)據(jù)加載動(dòng)畫
這篇文章主要為大家詳細(xì)介紹了Android自定義加載控件實(shí)現(xiàn)數(shù)據(jù)加載動(dòng)畫的相關(guān)資料,仿美團(tuán)、京東數(shù)據(jù)加載動(dòng)畫、小人奔跑動(dòng)畫,感興趣的小伙伴們可以參考一下2016-04-04