bahare f

توسعه دهنده اندروید
  • تعداد ارسال ها

    9
  • تاریخ عضویت

  • آخرین بازدید

اعتبار در انجمن

0 Neutral

درباره bahare f

  • درجه
    Newbie
  1. فکر کنم باید کل لیستمو به صورت آرایه به سرور ارسال کنم ولی نمیدونم چطور باید این کارو انجام بدم.اگه مثالی در این مورد دارین میشه بهم بدین؟
  2. منظورم اینه که وقتی break point رو یه بخشی قرار میدم و خط به خط پیش میره همه ی سطرهای اطلاعاتی که میخوام تو سرور insert کنم،insert میشه و مشکلی نیست. ولی وقتی برنامه رو اجرا میکنم (بدون break point) گاهی 1 سطر insert میشه، گاهی چند سطر. نمیدونم چشه.ظاهرا در حین رفت و برگشت به سرور و اجرای برنامه یه تداخل و مرتب نبودن اجرا داره شکل میگیره
  3. تااثییری نداشت. من وقتی خط به خط دیباگ میکنم همه اطلاعات وارد سرور میشه ولی وقتی از برنامه اجرا میگیرم نمیشه
  4. چه طور میشه کل دیتامو تو یه لیست بریزم و اون لیست رو به سرور بفرستم و اینکه وقتی لیست وارد سرور شد بتونم آیتم هارو تفکیک کنم؟
  5. الان هم همین کار داره انجام میشه. ولی انگار تو رفت و برگشت به سرور چیزی از بین میره چون گاهی چند سطر ارسال و ذخیره میشه ، گاهی کل دیتا و گاهی هم 1 سطر.
  6. بخش put رو نادیده بگیریم کدا زیاد نیست.
  7. من میخوام محتویات یه جدول از دیتابیس گوشی و به سرور بفرستم. جدولم پیمایش بشه و سطر به سطر به سرور فرستاده بشه. ولی با زدن دکمه ارسال فقط یه سطر post میشه و برای post و حذف هر آیتم باید 1 بار کلیک کنم. مشکل هم نمیدونم از چیه این تابع برای post هستش: private void existqn() { requestQueue = Volley.newRequestQueue(getApplicationContext()); request = new StringRequest(Request.Method.POST, ServiceApi.ExistQuestioner, new Response.Listener<String>() { @Override public void onResponse(String s) { array = null; try { array = new JSONArray(s); jsonObject = array.getJSONObject(0); if ("0".equals(jsonObject.getString("idtbl_questioner ").toString())) { Toast.makeText(ManagerActivity.this, "seccess", Toast.LENGTH_SHORT).show(); questionerDbAdapter.delete_Questioner_only(questio ner.getQuestionernum().toString()); } } catch (JSONException e) { e.printStackTrace(); } } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError volleyError) { Log.e("VolleyError", volleyError.getMessage() + ""); } }) { @Override public Map<String, String> getHeaders() throws AuthFailureError { Map<String, String> params = new HashMap<String, String>(); params.put("Content-Type", "application/x-www-form-urlencoded"); return params; } @Override protected Map<String, String> getParams() throws AuthFailureError { Map<String, String> params = new HashMap<>(); params.put("stringqnum", (questioner.getQuestionernum()==null?"":questioner .getQuestionernum())); params.put("Opcode", (questioner.getOpcode()==null?"":questioner.getOpc ode())); params.put("Entrydate", (questioner.getEntrydate()==null?"":questioner.get Entrydate())); params.put("Questionercol01", (questioner.getQuestionercol1()==null?"":questione r.getQuestionercol1())); params.put("Questionercol02", (questioner.getQuestionercol2()==null?"":questione r.getQuestionercol2())); params.put("Questionercol03", (questioner.getQuestionercol3()==null?"":questione r.getQuestionercol3())); params.put("Questionercol04", (questioner.getQuestionercol4()==null?"":questione r.getQuestionercol4())); params.put("Questionercol05", (questioner.getQuestionercol5()==null?"":questione r.getQuestionercol5())); params.put("Questionercol06", (questioner.getQuestionercol6()==null?"":questione r.getQuestionercol6())); params.put("Questionercol07", (questioner.getQuestionercol7()==null?"":questione r.getQuestionercol7())); params.put("Questionercol08", (questioner.getQuestionercol8()==null?"":questione r.getQuestionercol8())); params.put("Questionercol09", (questioner.getQuestionercol9()==null?"":questione r.getQuestionercol9())); params.put("Questionercol10", (questioner.getQuestionercol10()==null?"":question er.getQuestionercol10())); params.put("Questionercol11", (questioner.getQuestionercol11()==null?"":question er.getQuestionercol11())); params.put("Questionercol12", (questioner.getQuestionercol12()==null?"":question er.getQuestionercol12())); params.put("Questionercol13", (questioner.getQuestionercol13()==null?"":question er.getQuestionercol13())); params.put("Questionercol14", (questioner.getQuestionercol14()==null?"":question er.getQuestionercol14())); params.put("Questionercol15", (questioner.getQuestionercol15()==null?"":question er.getQuestionercol15())); params.put("Questionercol16", (questioner.getQuestionercol16()==null?"":question er.getQuestionercol16())); params.put("Questionercol17", (questioner.getQuestionercol17()==null?"":question er.getQuestionercol17())); params.put("Questionercol18", (questioner.getQuestionercol18()==null?"":question er.getQuestionercol18())); params.put("Questionercol19", (questioner.getQuestionercol19()==null?"":question er.getQuestionercol19())); params.put("Questionercol20", (questioner.getQuestionercol20()==null?"":question er.getQuestionercol20())); params.put("Questionercol21", (questioner.getQuestionercol21()==null?"":question er.getQuestionercol21())); params.put("Questionercol22", (questioner.getQuestionercol22()==null?"":question er.getQuestionercol22())); params.put("Questionercol23", (questioner.getQuestionercol23()==null?"":question er.getQuestionercol23())); params.put("Questionercol24", (questioner.getQuestionercol24()==null?"":question er.getQuestionercol24())); params.put("Questionercol25", (questioner.getQuestionercol25()==null?"":question er.getQuestionercol25())); params.put("Questionercol26", (questioner.getQuestionercol26()==null?"":question er.getQuestionercol26())); params.put("Questionercol27", (questioner.getQuestionercol27()==null?"":question er.getQuestionercol27())); params.put("Questionercol28", (questioner.getQuestionercol28()==null?"":question er.getQuestionercol28())); params.put("Questionercol29", (questioner.getQuestionercol29()==null?"":question er.getQuestionercol29())); params.put("Questionercol30", (questioner.getQuestionercol30()==null?"":question er.getQuestionercol30())); params.put("Questionercol31", (questioner.getQuestionercol31()==null?"":question er.getQuestionercol31())); params.put("Questionercol32", (questioner.getQuestionercol32()==null?"":question er.getQuestionercol32())); params.put("Questionercol33", (questioner.getQuestionercol33()==null?"":question er.getQuestionercol33())); params.put("Questionercol34", (questioner.getQuestionercol34()==null?"":question er.getQuestionercol34())); params.put("Questionercol35", (questioner.getQuestionercol35()==null?"":question er.getQuestionercol35())); params.put("Questionercol36", (questioner.getQuestionercol36()==null?"":question er.getQuestionercol36())); params.put("Questionercol37", (questioner.getQuestionercol37()==null?"":question er.getQuestionercol37())); params.put("Questionercol38", (questioner.getQuestionercol38()==null?"":question er.getQuestionercol38())); params.put("Questionercol39", (questioner.getQuestionercol39()==null?"":question er.getQuestionercol39())); params.put("Questionercol40", (questioner.getQuestionercol40()==null?"":question er.getQuestionercol40())); params.put("Questionercol41", (questioner.getQuestionercol41()==null?"":question er.getQuestionercol41())); params.put("Questionercol42", (questioner.getQuestionercol42()==null?"":question er.getQuestionercol42())); params.put("Questionercol43", (questioner.getQuestionercol43()==null?"":question er.getQuestionercol43())); params.put("Questionercol44", (questioner.getQuestionercol44()==null?"":question er.getQuestionercol44())); params.put("Questionercol45", (questioner.getQuestionercol45()==null?"":question er.getQuestionercol45())); params.put("Questionercol46", (questioner.getQuestionercol46()==null?"":question er.getQuestionercol46())); params.put("Questionercol47", (questioner.getQuestionercol47()==null?"":question er.getQuestionercol47())); params.put("Questionercol48", (questioner.getQuestionercol48()==null?"":question er.getQuestionercol48())); params.put("Questionercol49", (questioner.getQuestionercol49()==null?"":question er.getQuestionercol49())); params.put("Questionercol50", (questioner.getQuestionercol50()==null?"":question er.getQuestionercol50())); params.put("Questionercol51", (questioner.getQuestionercol51()==null?"":question er.getQuestionercol51())); params.put("Questionercol52", (questioner.getQuestionercol52()==null?"":question er.getQuestionercol52())); params.put("Questionercol53", (questioner.getQuestionercol53()==null?"":question er.getQuestionercol53())); params.put("Questionercol54", (questioner.getQuestionercol54()==null?"":question er.getQuestionercol54())); params.put("Questionercol55", (questioner.getQuestionercol55()==null?"":question er.getQuestionercol55())); params.put("Questionercol56", (questioner.getQuestionercol56()==null?"":question er.getQuestionercol56())); params.put("Questionercol57", (questioner.getQuestionercol57()==null?"":question er.getQuestionercol57())); params.put("Questionercol58", (questioner.getQuestionercol58()==null?"":question er.getQuestionercol58())); params.put("Questionercol59", (questioner.getQuestionercol59()==null?"":question er.getQuestionercol59())); params.put("Questionercol60", (questioner.getQuestionercol60()==null?"":question er.getQuestionercol60())); params.put("Questionercol61", (questioner.getQuestionercol61()==null?"":question er.getQuestionercol61())); params.put("Questionercol62", (questioner.getQuestionercol62()==null?"":question er.getQuestionercol62())); params.put("Questionercol63", (questioner.getQuestionercol63()==null?"":question er.getQuestionercol63())); params.put("Questionercol64", (questioner.getQuestionercol64()==null?"":question er.getQuestionercol64())); params.put("Questionercol65", (questioner.getQuestionercol65()==null?"":question er.getQuestionercol65())); params.put("Questionercol66", (questioner.getQuestionercol66()==null?"":question er.getQuestionercol66())); params.put("Questionercol67", (questioner.getQuestionercol67()==null?"":question er.getQuestionercol67())); params.put("Questionercol68", (questioner.getQuestionercol68()==null?"":question er.getQuestionercol68())); params.put("Questionercol69", (questioner.getQuestionercol69()==null?"":question er.getQuestionercol69())); params.put("Questionercol70", (questioner.getQuestionercol70()==null?"":question er.getQuestionercol70())); params.put("Questionercol71", (questioner.getQuestionercol71()==null?"":question er.getQuestionercol71())); params.put("Questionercol72", (questioner.getQuestionercol72()==null?"":question er.getQuestionercol72())); params.put("Questionercol73", (questioner.getQuestionercol73()==null?"":question er.getQuestionercol73())); params.put("Questionercol74", (questioner.getQuestionercol74()==null?"":question er.getQuestionercol74())); params.put("Questionercol75", (questioner.getQuestionercol75()==null?"":question er.getQuestionercol75())); params.put("Questionercol76", (questioner.getQuestionercol76()==null?"":question er.getQuestionercol76())); params.put("Questionercol77", (questioner.getQuestionercol77()==null?"":question er.getQuestionercol77())); params.put("Questionercol78", (questioner.getQuestionercol78()==null?"":question er.getQuestionercol78())); params.put("Questionercol79", (questioner.getQuestionercol79()==null?"":question er.getQuestionercol79())); params.put("Questionercol80", (questioner.getQuestionercol80()==null?"":question er.getQuestionercol80())); params.put("Questionercol81", (questioner.getQuestionercol81()==null?"":question er.getQuestionercol81())); params.put("Questionercol82", (questioner.getQuestionercol82()==null?"":question er.getQuestionercol82())); params.put("Questionercol83", (questioner.getQuestionercol83()==null?"":question er.getQuestionercol83())); params.put("Questionercol84", (questioner.getQuestionercol84()==null?"":question er.getQuestionercol84())); params.put("Questionercol85", (questioner.getQuestionercol85()==null?"":question er.getQuestionercol85())); params.put("Questionercol86", (questioner.getQuestionercol86()==null?"":question er.getQuestionercol86())); params.put("Questionercol87", (questioner.getQuestionercol87()==null?"":question er.getQuestionercol87())); params.put("Questionercol88", (questioner.getQuestionercol88()==null?"":question er.getQuestionercol88())); params.put("Questionercol89", (questioner.getQuestionercol89()==null?"":question er.getQuestionercol89())); params.put("Questionercol90", (questioner.getQuestionercol90()==null?"":question er.getQuestionercol90())); return params; } }; requestQueue.add(request); } و فراخوانی تابع فوق در زیر است: navigation_view.setNavigationItemSelectedListener( new NavigationView.OnNavigationItemSelectedListener() { @Override public boolean onNavigationItemSelected(@NonNull MenuItem item) { switch (item.getItemId()) { case R.id.ExitMenu: activity_manager.closeDrawers(); exitDialog.exit_dialog(ManagerActivity.this); break; case R.id.SendToServerMenu: activity_manager.closeDrawers(); progressDialog = new ProgressDialog(ManagerActivity.this); AllQnum = new ArrayList<>(); if (NetworkState.isNetworkConnected(ManagerActivity.t his)) { progressDialog.setMessage("Please Wait, We are Inserting Your Data on Server"); AllQnum = questionerDbAdapter.SelectAllquestioner(); if (AllQnum.size() > 0) { progressDialog.show(); for (int j = 0; j < AllQnum.size(); j++) { questioner = questionerDbAdapter.SelectRow(AllQnum.get(j).toStr ing()); existqn(); } progressDialog.dismiss(); AllQnum.clear(); AllQnum = questionerDbAdapter.SelectAllquestioner(); msg = "تعداد پرسشنامه های تکراری" + AllQnum.size(); dialog.Dialogbystring(msg, R.string.empty, ManagerActivity.this); } else { dialog.Dialogbystring("پرسشنامه ای برای ارسال یافت نشد", R.string.Error, ManagerActivity.this); } } else { startActivity(new Intent(Settings.ACTION_WIRELESS_SETTINGS)); } break; } return false; } });