0

Kumulos の開発は初めてです。

kumulos のテーブルから選択したデータを取得したい。

同様に、ユーザーがユーザー名とパスワードを入力すると、テーブルからデータが存在するかどうかを確認します。

しかし、問題は、テーブルに挿入されたデータをチェックしていて、正しい出力が得られないことです。

ブラウザでAPIをテストしている間、正常に動作します。

テーブルから選択するための私のコードは以下のとおりです。

public void CallApiLogin(){


        final String Uname=editUname.getText().toString();
        final String pass=editPass.getText().toString();

        HashMap<String, String> params = new HashMap<String, String>();
        params.put("name", Uname);
        params.put("password",pass);

        Kumulos.call("user_register", params, new ResponseHandler() {
            @Override
            public void didCompleteWithResult(Object result) {
                // Do updates to UI/data models based on result

                ArrayList<LinkedHashMap<String, Object>> objects = (ArrayList<LinkedHashMap<String,Object>>) result;
                for (LinkedHashMap<String, Object> item : objects) {
                    String name = (String) item.get("name");
                    String password = (String) item.get("password");

                    if(name.equalsIgnoreCase(Uname) && password.equalsIgnoreCase(pass)){
                        Intent i=new Intent(Login.this,Home.class);
                        startActivity(i);
                    }else{
                        Toast.makeText(getApplicationContext(),"Please enter valid username and password.",Toast.LENGTH_SHORT).show();
                    }
                }

            }
        });

    }

要求されたデータがテーブルに挿入されたときにどこが間違っているかを提案してください。

しかし、私はその要求データが存在するかどうかが欲しい????

4

1 に答える 1

0

何時間も費やした後、私は解決策を得ました。

問題はAPIの作成です。Kumulos では、別の API を作成する必要があります。

API「user_register」を使用していましたが、他のAPI呼び出し「Select_user」を作成しました。

このAPIは、私が望む結果をうまく機能させます。

この質問が他の人に役立つことを願っています。

于 2016-05-30T12:10:22.483 に答える