私は日食を使用して、ユーザーが入力した価格を読み取る Android アプリを作成しています。
入力した価格はデータベースに保存する必要があります (phpmyadmin)
以下のコードを使用していますが、Eclipse にエラーがあり、double を string に変換するように求められます。
food = Double.parseDouble(inputFood.getText().toString());
transport = Double.parseDouble(inputTransport.getText().toString());
tele = Double.parseDouble(inputTele.getText().toString());
academic = Double.parseDouble(inputAcademic.getText().toString());
entertainment = Double.parseDouble(inputEntertainment.getText().toString());
health = Double.parseDouble(inputHealth.getText().toString());
others = Double.parseDouble(inputOthers.getText().toString());
budget = Double.parseDouble(inputBudget.getText().toString());
total = food + transport + tele + academic + entertainment + health + others;
balance = budget - total;
List<NameValuePair> params = new ArrayList<NameValuePair>();
params.add(new BasicNameValuePair("food", food));
params.add(new BasicNameValuePair("transport", transport));
params.add(new BasicNameValuePair("tele", tele));
params.add(new BasicNameValuePair("academic", academic));
params.add(new BasicNameValuePair("entertainment", entertainment));
params.add(new BasicNameValuePair("health", health));
params.add(new BasicNameValuePair("others", others));
params.add(new BasicNameValuePair("budget", budget));
params.add(new BasicNameValuePair("total", total));
params.add(new BasicNameValuePair("balance", balance));
JSONObject json = jsonParser.makeHttpRequest(url_save_expenses,
"GET", params);
ダブルデータを格納するために使用される他のコーディングはありますか?
回答ありがとうございます..