Android How to change String with Edittext and reuse in same activity

ruthalarson219

New Member
I have a serious problem, I have a card swiper app that passes all of card data threw a xml (the way the xml is structured in my code was writted by the sdk provider). I need to make it possible to do a manual entry using 2 EditText (1 for Card number and 1 for ExpDate) and then pass that data to the same Activity (OR A NEW Activity) to be used in the xml that processes the order. Can this be done? How can this be done? Below is my Code - and edits or corrections will be very helpful ... Thank you in advance.\[code\]String tranXmlFmt = "<?xml version=\"1.0\"?><TStream>" + "<Transaction>" + "<IpAddress>66.173.160.125</IpAddress>" + "<MerchantID>002649</MerchantID> " + "<OperatorID>50</OperatorID>" + "<TranType>Credit</TranType>" + "<CardType>VISA</CardType> " + "<TranCode>Sale</TranCode> " + "<OperatorID>55</OperatorID> " + "<InvoiceNo>100001</InvoiceNo>" + " <RefNo>100001</RefNo> " + "<PartialAuth>Allow</PartialAuth>" + "<Account>" + "<AcctNo>4104891389583005</AcctNo>" + "</Account> " + "<ExpDate>0214</ExpDate>" + "<Amount><Purchase>13.00</Purchase></Amount>" + "<UserTraceData>GBTE130116</UserTraceData>" + "</Transaction> " + "</TStream>";String initXml = "" + "<?xml version=\"1.0\"?>" + "<TStream><Admin>" + " <MerchantID>002649</MerchantID>" + " <TerminalID>002</TerminalID><TranCode>SecureDeviceInit</TranCode>" + " <PadType>None</PadType>" + " <TranType>Setup</TranType>" + " <SecureDevice>UniMagSecureMagDsi</SecureDevice>" + " <ComPort>1</ComPort>" + " </Admin>" + "</TStream>"; '\[/code\]Help \[code\]Button btnNextScreen = (Button) findViewById(R.id.btnNextScreen); //Listening to button event btnNextScreen.setOnClickListener(new View.OnClickListener() { public void onClick(View arg0) { //Starting a new Intent } }); Button btnInit = (Button) findViewById(R.id.btnInit); btnInit.setOnClickListener(new View.OnClickListener() { /** * initialize epay client */ @Override public void onClick(View v) { libReady = true; ca = new ClientActivity(getApplication(), readerType); Log.d("MAINACTIVITY", "reader type: " + readerType.toString()); initReturn = ca.initialize(initXml); Log.d("MAINACTIVITY", "init return: " + initXml); libReady = true; EditText et = (EditText) findViewById(R.id.editXml); et.setText(initReturn); Log.d("MAINACTIVITY", "Library Loaded"); } }); Button btnClose = (Button) findViewById(R.id.Close_button); btnClose.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { LineDisplay ld = new LineDisplay(); ld.open(DeviceCommon.DEVICE_MODE_COMMON, null); ld.clear(); ld.setBacklight(LineDisplay.LCD_BACKLIGHT_OFF); ld.close(); finish(); } });\[/code\]I just need to add 2 Edittext and change the AcctNo and ExpDate STRING to be used in this same activity. please any help will be greatful.
 
Back
Top