精华内容
下载资源
问答
  • Android表单值修改框架 AFormChange
    2021-06-08 17:40:24

    软件介绍

    AFormChange 是一个免费的、开源的、简易的、遵循Apache Licence 2.0开源协议发布,超级容易扩展的android表单数据改变时处理的小框架。

    AFormChange android 表单值修改框架AFormChange为库,可以直接导出jar包

    AFormChangeDemo为演示,快速学习使用AFormChange为库

    AValidations使用1.下载zip或者克隆AFormChange项目

    2.导入Eclipse,右键工程->preference->Android->library->Add,选择AFormChange工程加入后 apply应用

    3.demoprivate TextView tvChange;

    private EditText editText1;

    private EditText editText2;

    private Button button1;

    private FormHandler formHandler;

    @Override

    protected void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);

    setContentView(R.layout.activity_main);

    tvChange = (TextView) findViewById(R.id.tv_change);

    editText1 = (EditText) findViewById(R.id.editText1);

    editText2 = (EditText) findViewById(R.id.editText2);

    button1 = (Button) findViewById(R.id.button1);

    formHandler = new FormHandler(ViewsUtil.getAllEditTexts(this));

    //初始化数据和文本改变监听器,必须放在赋值之后

    formHandler.initTextAndTextChangedListener();

    button1.setOnClickListener(new OnClickListener() {

    @Override

    public void onClick(View v) {

    if (formHandler.isTextChange()) {//isTextChange判断是否改变

    tvChange.setText("Change");

    } else {

    tvChange.setText("Not Change");

    }

    }

    });

    }

    更多相关内容
  • Android 表单页面逻辑生成管理工具。可以直接注解在需要提交的数据实体上,可以和 Gson、ORM 同时使用。
  • android表单映射框架
  • ValidationUtilsLibrary The goal of this library is to help you in your development of validation forms. currently it works on follow entities: First name: if first name is blank or other than ...
  • 功能强大、简单且可定制的Android EditText验证器。
  • 一个安卓form表单布局库,简化Android表单布局,带InputFieldView支持大部分表单场景。 主要功能集中在InputField控件中,该控件继承自EditText,拥有所有EditText的功能,同时添加了title标题字段,标题可以自定义...
  • Ant Design 组件提供了Input,InputNumber,Radio,Select,uplod等表单组件,但实际开发中这是不能满足需求,同时我们希望可以继续使用Form提供的验证和提示等方法(使用起来确实很爽),这时需要自己动手封装一些...
  • Android 表单同时上传文件和数据

    千次阅读 2021-12-09 18:39:00
    retrofit注解 @Multipart @POST("requesturl") ...在和后台对接接口的时候,是表单类型 传入参数和图片。 其中一个参数是json格式。当时我一直在用ftpMap.toString 作为value,结果就是一直报错 500 Internal S

    retrofit注解

    @Multipart
    @POST("requesturl")
     Observable<ResponseBody> upload(@PartMap Map<String, RequestBody> map);
    

    在和后台对接接口的时候,是表单类型 传入参数和图片。 其中一个参数是json格式。当时我一直在用ftpMap.toString 作为value,结果就是一直报错 500 Internal Server Error “Message”:"此资源不支持请求实体的媒体类型。然后从网上这篇博客找到下一篇博客。整整弄了一个下午,简直令人火大。好在最后还是解决了 所以有问题一直要和同事仔细对接一下,不然就是大海捞针。吐血。

    HashMap<String, Object> ftpMap = new HashMap<>();
    ftpMap.put("xxx", xxx);
                
    File fileSign = new File(localPath);
    if (fileSign.exists()) {//获取文件,存在就上传
    Map<String, RequestBody> map = new HashMap<>();
    
    map.put("ftpMap", RequestBody.create(MediaType.parse("text/plain"), new Gson().toJson(ftpMap).toString()));
    map.put("xxx", RequestBody.create(MediaType.parse("text/plain"), "123123123"));
    RequestBody requestBody = RequestBody.create(MediaType.parse("image/*"), fileSign);
    map.put("file\";filename=\"" + fileSign.getName(), requestBody);
    
    RetrofitFactory.getInstance().getRetrofit()
                            .create(Interface.class)
                            .upload(map)
                            .subscribeOn(Schedulers.io())
                            .observeOn(AndroidSchedulers.mainThread())
                            .subscribe(new Observer<ResponseBody>() {
    
                                @Override
                                public void onSubscribe(Disposable d) {
                                }
    
                                @Override
                                public void onNext(ResponseBody s) {
                                }
    
                                @Override
                                public void onError(Throwable e) {
                                }
    
                                @Override
                                public void onComplete() {
                                }
                            });
                }
    
    
    展开全文
  • android 表单uiOne of the most common lessons we learn as young (UX) designers is to make everything you design as easy to use as possible by keeping the user in mind.我们从年轻(UX)设计师那里学到的最...

    android 表单ui

    One of the most common lessons we learn as young (UX) designers is to make everything you design as easy to use as possible by keeping the user in mind.

    我们从年轻(UX)设计师那里学到的最常见的课程之一就是,要牢记用户的心意,使您设计的所有内容都尽可能易于使用。

    Well-known sayings from the field of design include “don’t make me think” and “keep it simple.”

    设计领域的著名谚语包括“不要让我思考”和“保持简单”。

    We enforce these sayings by applying best practices like the three-click-rule and designing above the fold. Yet, as a UX designer, you could be doing too much in terms of designing easy-to-use products.

    我们通过应用最佳实践(例如三击规则)和在首屏上进行设计来贯彻这些话。 但是,作为UX设计师,您在设计易于使用的产品方面可能做得太多。

    By making your forms too easy to use you could hurt the usability of your design. It could cost you tons of money as well. Here’s what to do instead.

    通过使表单过于易于使用,可能会损害设计的可用性。 它也可能花费您大量金钱。 这是替代方法。

    太容易使用的表格可能会花费您数百万美元 (Forms that are too easy to use could cost you millions)

    You must think that I’ve lost my mind. Everybody knows that a form should be easy, intuitive, and short. You can read about it in more tutorials and how-to’s than you can count. It is common knowledge. But let me ask you this. Can a form be too easy to complete?

    您必须以为我已经迷失了方向。 每个人都知道表单应该简单,直观且简短。 您可以在数不胜数的教程和操作方法中读到它。 这是常识。 但是,让我问你这个。 表格太容易填写吗?

    As it turns out, yes, a form could be too easy to complete.

    事实证明,是的,表格可能太容易填写。

    You can make a form so easy that your users will either have trust issues or will judge your website to be unprofessional, broken, or perhaps even a scam.

    您可以轻松地制作表格,以使您的用户会遇到信任问题,或者会判断您的网站不专业,已损坏甚至是欺诈。

    In fact, HubSpot found out that having a form with two or three text fields generally performs better than a form with only one text field.

    实际上, HubSpot发现,具有两个或三个文本字段的表单通常比仅具有一个文本字段的表单表现更好。

    一个例子 (An example)

    LinkedIn got itself a class action lawsuit in 2015 for making it so easy to send emails to contacts that many users didn’t even know they were doing so until it was too late.

    LinkedIn在2015年因集体诉讼而变得很容易,因为它使向联系人发送电子邮件变得如此容易,以至于许多用户甚至不知道自己这样做了,直到为时已晚。

    LinkedIn eventually settled and was, in addition to paying 13 million dollars, required to better explain how all of their features work.

    LinkedIn最终达成和解,除了支付1300万美元外,LinkedIn还被要求更好地解释其所有功能的工作原理。

    “The settlement, which must be approved by Judge Koh, also calls for LinkedIn to better explain how “Add Connections” works and to make it easier for users to opt out of it.”

    “该和解方案必须得到Koh法官的批准,还要求LinkedIn更好地解释“添加连接”的工作原理,并使用户更容易选择退出。

    Stay away from using dark patterns where you design a one-text-field-form just to reveal all the other necessary text fields after the user submits the first form. This is a situation where following UX guidelines to the extreme actually provides you with a worse experience.

    避免使用深色图案,在深色图案中设计一个文本字段表单,只是在用户提交第一个表单后显示所有其他必要的文本字段。 在这种情况下,严格遵循UX准则实际上会给您带来糟糕的体验。

    有关如何改善表格可用性的提示和技巧 (Tips and tricks on how you can improve the usability of forms)

    Don’t get me wrong. You should try and design your form to be very easy. That being said, don’t remove as many elements as possible just for the case of having a form that is as short as possible. Here’s what to do instead.

    不要误会我的意思。 您应该尝试将表单设计得非常简单。 话虽这么说,但不要仅在表单尽可能短的情况下删除尽可能多的元素。 这是替代方法。

    Image for post
    UX Indonesia on UX Indonesia Unsplash 摄,Unsplash

    1.使用信任信号和特殊指标 (1. Use trust signals and special indicators)

    As a rule of thumb, try to design your forms to be as easy (and short) as possible, without removing important information like trust signals or special indicators.

    根据经验,请尽量将表单设计得尽可能简单(且简短),而又不要删除重要信息(如信任信号或特殊指示符)。

    “I have made this longer than usual because I have not had time to make it shorter.” — Blaise Pascal

    “我把它比平常更长了,因为我没有时间把它缩短。” —布莱斯·帕斯卡(Blaise Pascal)

    Trust signals or special indicators can include labels and icons such as secure connection, company trademarks, or, believe it or not, the name text field.

    信任信号或特殊指示符可以包括标签和图标,例如安全连接,公司商标,或者(不管是否相信)名称文本字段。

    2.运用互惠原则 (2. Apply the reciprocity principle)

    Speaking of which. You probably do not need your users to tell you their names. However, users respond very well to forms that include the ‘name’ text field.

    说到其中。 您可能不需要用户告诉您他们的名字。 但是,用户对包含“名称”文本字段的表单的响应很好。

    That’s because it is polite to introduce yourself before you ask someone for something. In design, we call this the reciprocity principle.

    那是因为在您问某人某事之前先自我介绍是有礼貌的。 在设计中,我们称此为互惠原则

    Filling out a form is like speaking to someone at the front office of a hotel or club. The clerk will ask you your name and what you’re here for. Based on your answers he might ask for further details.

    填写表格就像在酒店或俱乐部的前台与某人说话。 店员会问您您的名字和您的目的。 根据您的回答,他可能会要求提供更多详细信息。

    This back-and-forth question-and-answer type of conversation is how a form works as well. You don’t have to greet someone or ask someone’s name. However, it is user-friendly and will therefore put your users more at ease.

    这种来回的问答方式就是表格的工作方式。 您不必打招呼或问别人的名字。 但是,它是用户友好的,因此将使您的用户更加放心。

    3.分解长表格 (3. Break up your long forms)

    It could happen that you have to design a form for a product that requires a lot of user input. Even after multiple tries of optimising the form you still have a long form in front of you.

    您可能必须为需要大量用户输入的产品设计表单。 即使经过多次优化表单的尝试,您面前的表单仍然很长。

    This happens and it is okay. You can fix the potential issue of having a long form that works poorly by breaking up the form into multiple pages. Divide your form into sections and display one section per page.

    这发生了,没关系。 您可以通过将表单分成多个页面来解决表单较长的潜在问题。 将表单分为几部分,每页显示一个部分。

    Pagination for long forms has often shown a great increase in the conversion rate of the form. Breaking up a long form into a multi-page form will help users understand the shorter forms, motivate users to keep going, and reduce the overall cognitive load of the form.

    长格式的分页通常显示出格式转换率的极大提高。 将一个较长的表格分解成一个多页的表格将有助于用户理解较短的表格,激励用户继续前进,并减少表格的总体认知负担。

    表单可用性不仅仅是字段数 (Form usability is about more than just the number of fields)

    Keeping your forms short and simple is important. However, short forms have downsides as well. For example, forms that are too short can be experienced as untrustworthy, which in turn can hurt the conversion rate of your form.

    保持表格简短简洁很重要。 但是,简短的形式也有缺点。 例如,过短的表单可能会被视为不可信任,这反过来又会损害表单的转换率。

    But then again, the conversion rate of a form is determined by far more than just the number of text fields. It will also depend on the first impression of the entire landing page, not just the form. That first impression is created based on loading speed, branding, and so much more.

    但话又说回来,表单的转换率所决定的远不只是文本字段的数量。 它还将取决于整个着陆页的第一印象,而不仅仅是表格。 第一印象是根据加载速度,品牌等等来创建的。

    In addition, the industry you’re in plays a part in determining the amount of user input that is required. Just imagine. A form about getting a mortgage will require more user input than, let us say, a form that gets you a new magazine subscription.

    此外,您所在的行业在确定所需的用户输入量方面也起着一定的作用。 想象一下。 与可以让您获得新杂志订阅的表格相比,一种用于抵押的表格需要更多的用户输入。

    最后的话 (Final words)

    Continue to improve your forms but do not overdo it by removing every element just for the sake of making your form shorter.

    继续改进表单,但不要为了删除表单而过度删除每个元素。

    Think about every text field, the value it brings, and how it may affect your users before you decide to remove it. Sometimes it is better to keep a text field if it helps either the user or the business. It is up to you to find the balance.

    在决定删除它之前,请考虑每个文本字段,它带来的价值以及它如何影响用户。 有时最好保留文本字段,如果它对用户或企业都有帮助。 找到余额由您决定。

    翻译自: https://blog.prototypr.io/yes-ui-forms-can-be-too-easy-to-use-4f7f53da42f3

    android 表单ui

    展开全文
  • 创建简单的Android表单 基本用法 创建一个“ FromDescriptor”-它是表单的持有人 FormDescriptor descriptor = FormDescriptor . newInstance(); descriptor . setOnFormRowValueChangedListener( this ); // ...
  • 使用TableLayout表格布局实现表单效果 1、核心知识点 android:divider=@drawable/table_v_divider android:showDividers=middle|beginning|end 2、样式代码 style样式 <?xml version=1.0 encoding=utf-8...
  • // 获取Android和iOS发来的表单账号和密码 String account=request.getParameter("account"); System.out.println(account); String password=request.getParameter("password"); System.out.println(password); if...

    先上服务器后台代码

    package test;

    import java.io.IOException;

    import javax.servlet.ServletException;

    import javax.servlet.annotation.WebServlet;

    import javax.servlet.http.HttpServlet;

    import javax.servlet.http.HttpServletRequest;

    import javax.servlet.http.HttpServletResponse;

    import com.google.gson.JsonObject;

    /**

    * Servlet implementation class Android_Form_Up

    */

    @WebServlet("/Android_Form_Up")

    public class Android_Form_Up extends HttpServlet {

    private static final long serialVersionUID = 1L;

           

        /**

         * @see HttpServlet#HttpServlet()

         */

        public Android_Form_Up() {

            super();

            // TODO Auto-generated constructor stub

        }

    /**

    * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)

    */

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    response.setContentType("text/html");

    response.setCharacterEncoding("utf-8");

    request.setCharacterEncoding("utf-8");

    // 获取Android和iOS发来的表单账号和密码

    String account=request.getParameter("account");

    System.out.println(account);

    String password=request.getParameter("password");

    System.out.println(password);

    if(account.equals("test")&&password.equals("123")) {

    //下面这行这是安卓的,安卓只返回一个普通文本字符串给前端

    //response.getWriter().append("login success");

    //下面这是iOS的,iOS返回一个json文本字符串给前端

    JsonObject jsonContainer =new JsonObject();

    //为当前的json对象添加键值对

    jsonContainer.addProperty("state", "login success");

    response.getWriter().print(jsonContainer);

    System.out.println("登录成功");

    }

    else {

    response.getWriter().append("login fail");

    System.out.println("登录失败");

    }

    }

    /**

    * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)

    */

    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    // TODO Auto-generated method stub

    doGet(request, response);

    }

    }

    安卓前端代码

    package com.example.android_form_up;
    
    import androidx.appcompat.app.AppCompatActivity;
    
    import android.content.Context;
    import android.content.Intent;
    import android.os.Bundle;
    import android.os.Handler;
    import android.os.Looper;
    import android.os.Message;
    import android.util.Log;
    import android.view.Gravity;
    import android.view.View;
    import android.widget.Button;
    import android.widget.EditText;
    import android.widget.Toast;
    
    import java.io.BufferedReader;
    import java.io.DataOutputStream;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.net.HttpURLConnection;
    import java.net.MalformedURLException;
    import java.net.URL;
    import java.net.URLEncoder;
    
    public class MainActivity extends AppCompatActivity {
        private EditText form_account;
        private EditText form_password;
        private Button form_login;
        private Handler handler;
        private String result;
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main);
            form_account=findViewById(R.id.form_account);
            form_password=findViewById(R.id.form_password);
            form_login=findViewById(R.id.form_login);
            //设置点击登录按钮跳到账号和密码到服务器,服务器返回结果
            form_login.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    //获取账号
                    String account=form_account.getText().toString();
                    String password=form_password.getText().toString();
    
                    //获取密码
                    //提交给服务器,注意这是耗时操作需要在子线程中进行
                    new Thread() {
                        @Override
                        public void run() {
                            String target;
                            target = "http://192.168.43.141:8080/myapp/Android_Form_Up";
                          
                            URL url;
                            try {
                                url = new URL(target);
                                HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();
                                urlConnection.setRequestMethod("POST");
                                urlConnection.setConnectTimeout(30000);
                                urlConnection.setDoInput(true);
                                urlConnection.setDoOutput(true);
                                urlConnection.setUseCaches(false);
                                urlConnection.setInstanceFollowRedirects(true);
                                urlConnection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
                                DataOutputStream out=new DataOutputStream(urlConnection.getOutputStream());
                                String param="account="+ URLEncoder.encode(account,"utf-8")+
                                        "&password="+ URLEncoder.encode(password,"utf-8");
                                out.writeBytes(param);
                                out.flush();
                                out.close();
    
                                if (urlConnection.getResponseCode() == HttpURLConnection.HTTP_OK) {
    
                                    InputStreamReader in = new InputStreamReader(urlConnection.getInputStream());
                                    BufferedReader buffer = new BufferedReader(in);
                                    String inputLine = null;
                                    while ((inputLine = buffer.readLine()) != null) {
                                        //服务器返回结果
                                        result = inputLine;
                                    }
    
                                    in.close();
                                }
                                urlConnection.disconnect();
    
                            } catch (MalformedURLException e) {
                                e.printStackTrace();
                            } catch (IOException e) {
                                e.printStackTrace();
                            }
    
                            Message m = handler.obtainMessage();
                            handler.sendMessage(m);
                        }
    
                    }.start();
    
                    handler = new Handler(Looper.getMainLooper()) {
    
                        @Override
                        public void handleMessage(Message msg) {
                            //根据服务器返回值做出相应操作
                            if(result.equals("login success")) {
    
                                Toast.makeText(getBaseContext(), "登录成功", Toast.LENGTH_LONG).show();
                                Log.d("结果:","登录成功");
                            }
                           else {
                                Toast.makeText(getBaseContext(), "登录失败,密码错误", Toast.LENGTH_LONG).show();
                                Log.d("结果:","密码错误");
                            }
                            super.handleMessage(msg);
                        }
    
                    };
                }
            });
        }
    
    
    
    }
    

    xml布局文件代码

    <?xml version="1.0" encoding="utf-8"?>
    <androidx.constraintlayout.widget.ConstraintLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        tools:context=".MainActivity">
    
    
        <EditText
            android:id="@+id/form_account"
            android:layout_width="131dp"
            android:layout_height="90dp"
            android:hint="请填写账号"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintHorizontal_bias="0.575"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.176" />
    
        <EditText
            android:id="@+id/form_password"
            android:layout_width="140dp"
            android:layout_height="75dp"
            android:hint="请填写密码"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintHorizontal_bias="0.516"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.391" />
    
        <Button
            android:id="@+id/form_login"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="登录"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintHorizontal_bias="0.498"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.534" />
    
    </androidx.constraintlayout.widget.ConstraintLayout>

    注意在AndroidMainfest.xml中配置网络权限

    <!-- 打开网络权限 -->
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.INTERNET" />

     运行效果图:

    前端

    后台

     

    iOS 代码

    //
    //  ViewController.m
    //  iOS_form_up
    //
    //  Created by 温国强 on 2021/12/2.
    //
    
    #import "ViewController.h"
    
    @interface ViewController ()
    
    @end
    
    @implementation ViewController
    UITextField *textField;
    UITextField *textField2;
    - (void)viewDidLoad {
        [super viewDidLoad];
        //创建输入框
         textField = [[UITextField alloc]initWithFrame:CGRectMake(20, 100, 280, 30)];
        // UITextBorderStyleRoundedRect // 边框风格
            textField.borderStyle = UITextBorderStyleRoundedRect;
            // 设置提示文字
            textField.placeholder = @"请输入账号";
            // 将控件添加到当前视图上
            [self.view addSubview:textField];
         textField2 = [[UITextField alloc]initWithFrame:CGRectMake(20, 150, 280, 30)];
        // UITextBorderStyleRoundedRect // 边框风格
            textField2.borderStyle = UITextBorderStyleRoundedRect;
            // 设置提示文字
            textField2.placeholder = @"请输入密码";
            // 将控件添加到当前视图上
            [self.view addSubview:textField2];
        
        UIButton *btn = [[UIButton alloc]init];
            //2.添加按钮
            [self.view addSubview:btn];
            
            //3.设置iframe
            btn.frame =CGRectMake(100,200,100, 50);
            
            //4.设置背景色
            btn.backgroundColor = [UIColor blueColor];
        
        //6.设置文字颜色
            //设置文字
            [btn setTitle:@"登录"forState:UIControlStateNormal];
            //设置颜色
            [btn setTitleColor:[UIColor cyanColor]forState:UIControlStateNormal];
            [btn setTitleColor:[UIColor blueColor]forState:UIControlStateHighlighted];
      
        //7.监听按钮点击
        [btn addTarget:self action:@selector(btClick:) forControlEvents:UIControlEventTouchUpInside];
    
        [btn sendActionsForControlEvents:UIControlEventTouchUpInside];
    
       
    }
    
    -(IBAction)btClick:(id)sender{
        //获取输入框的字符串
        NSLog(@"%@",textField.text);
        NSLog(@"%@",textField2.text);
        NSLog(@"hai");
     
        NSString *urlString = [NSString stringWithFormat:@"http://192.168.43.141:8080/myapp/Android_Form_Up?account=%@&password=%@",textField.text,textField2.text];
    
        //0.1因为有中文要进行百分号转义.(*** 注意点: 当有汉字时候***)
        NSString *convertString = [urlString stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
    
    
        //1.创建URL
        NSURL *URL = [NSURL URLWithString:convertString];
    
    
    
        //2.创建会话开启任务并启动(默认是数据任务是GET)
    
        [[[NSURLSession sharedSession] dataTaskWithURL:URL completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) {
    
            //3.错误处理
            if(error == nil)
            {
                id result = [NSJSONSerialization JSONObjectWithData:data options:0 error:NULL];
               
                if([result[@"state"] isEqualToString:@"login success"])
                {
                    NSLog(@"登入成功");
                  
                }
                else
                {
                    NSLog(@"登录失败");
                    
                }
    
            }
            else
            {
                NSLog(@"%@",error);
            }
    
        }] resume];//不要忘记启动任务.
    
    
        
       
    }
    
    
    
    
    
    
    @end
    

     运行效果图:

     

    展开全文
  • Android中提取表单模型

    2021-06-09 03:47:53
    我一直追求从Android活动中分离代码。在最近的一个项目中,我成功的实现了传统的”Form Model”...我认为在Android中这个领域不太被关注——在大多数的开发文档中数据录入和表单不是重点。在很多流行的社交应用程序...
  • 为什么80%的码农都做不了架构师?>>> ...Download the latest JAR or grab via Maven: ...表单对象映射 ...1.页面实现 FormCheckInterface 接口 改接口 是页面表单检查的回调 下面有介绍 ... android...
  • android表单验证组件

    2015-06-11 11:18:09
    超级容易扩展的android表单验证的小框架.比如,验证登陆模块的用户名和密码是否输入以及输入格式是否正确。验证内容自定义。 包含例子demo和使用说明doc
  • 漂亮的表单UI

    2016-06-01 16:47:58
    好看的表单UI。
  • android动态表单+dialogplus动态表单其他说明其他的其他 写在前面的话 鉴于之前写了一篇动态表单是很早之前使用的东西,导致会误导很多android的学习的人,并且下载demo还因为当时资源必须设置积分的原因设置了积分...
  • Android简单的web提交表单登录,亲测已通过,不想码代码的同学进来
  • 作者lijy91,源码blankapp-validation,专注于 Android 表单验证,用方法链构建你的验证规则。 如何使用 支持验证的控件 支持以下控件或派生自以下的控件 EditText CompoundButton
  • Android表单验证框架

    2021-06-05 08:46:12
    Android Saripaar下载地址:https://github.com/ragunathjawahar/android-saripaarSaripaar特性:使用Annotation标注的生命性规则可扩展性支持同步/异步验证,无线担心线程问题使用简单,只需下载 jar包,放到项目的...
  • 先看下效果图,再来说说怎么实现!!查询员工信息显示效果如下: 当点击某一记录行触发删除该行信息提醒:此时是点击第一条记录,背景变为黄色视为当前...首先布局一下主界面android:layout_width="match_parent"...
  • android表单分页效果

    2018-05-04 10:22:50
    android中的分页代码,便于代码的应用,希望可以帮助到你。
  • 我一直在网上寻找一种方法来做这个约一个星期了,我似乎...表单数据通过post(它包含几个隐藏的值以及用户名和pwd)发送到相应的登录脚本,然后登录它们并加载服务.我一直试图以两种方式解决问题.我首先尝试了一个WebVie...
  • 前言我们以前的几个例子中都是直接使用设计器来制作的表单视图,实际在开发中经常会遇到使用代码来动态的添加控件到视图中。一般步骤是:1.生成一个控件,比如new Button。2.设置控件的各种属性,比如 设置某个...
  • 简单的Android表单验证程序库,可以同时验证EditText和Buttons #How使用方法只需将类文件夹粘贴到您的项目中,并使用以下代码进行验证 void someEvent() { editText1 = ( EditText ) findViewById( ......... ); ...
  • Android的HttpURLConnections等并不能直接实现表单形式上传文件,必须另类实现。注册时一般是先利用表单上传头像图片得到头像在服务器的地址,再将得到的地址和其它注册信息提交。
  • Android表单获取值的三种方式

    千次阅读 2014-12-17 00:26:10
    act_register.xml <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#f0
  • 写在前面在平时的开发中,处理表单也是需要注意的槛。开发者一般都会有自己的一套处理表单的方法,以前都会自己手动添加textChangeListener,到后来会通过Rxjava亦或者更直接的Rxbinding来处理,可以参考链接RxJava...
  • // 直接获取信息void DirectInfo() throws IOException {URL url = new URL(SRC);HttpURLConnection httpConn = (HttpURLConnection) url.openConnection();InputStreamReader inStreamReader = new ...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 43,186
精华内容 17,274
关键字:

安卓表单