Wow, I really hope that's not for an enterprise application.
I believe this is a candidate for http://thedailywtf.com

Don't bother stripping bad characters/phrases, do this on the server side.
Also, don't ever mix UI code and networking code in the same thread.

Read:
http://developer.android.com/resources/articles/painless-threading.html

On Mon, Jun 6, 2011 at 9:41 AM, Knutsford Software <
[email protected]> wrote:

>
> ----- Original Message ----- From: TreKing
> To: [email protected]
> Sent: Monday, June 06, 2011 5:17 PM
> Subject: Re: [android-developers] login form
>
>
>
> On Mon, Jun 6, 2011 at 10:20 AM, Knutsford Software <
> [email protected]> wrote:
>
> 3) If it is correct then why is it failing in eclipse? I get a message that
> it has stopped unexpectedly please try again and I don't know where to look
> to find out why. I am brand new to Android and it is several years since I
> did any java
>
> Use LogCat and the debugger. See the Android documentation section on
> debugging your application.
>
>
>
>
>
> Thanks I have now managed to sort part of out. It was the casting of the
> check box that was wrong.
>
>
> I am stuck on this now though
>
> LogCat has
>
> 06-06 16:29:53.071: ERROR/AndroidRuntime(2145):
> java.lang.ArrayIndexOutOfBoundsException
> 06-06 16:29:53.071: ERROR/AndroidRuntime(2145):     at
> extraplay.login.login.StrippedChars(login.java:263)
> 06-06 16:29:53.071: ERROR/AndroidRuntime(2145):     at
> extraplay.login.login.access$1(login.java:255)
> 06-06 16:29:53.071: ERROR/AndroidRuntime(2145):     at
> extraplay.login.login$3.onClick(login.java:203)
> 06-06 16:29:53.071: ERROR/AndroidRuntime(2145):     at
> android.view.View.performClick(View.java:2485)
> 06-06 16:29:53.071: ERROR/AndroidRuntime(2145):     at
> android.view.View$PerformClick.run(View.java:9080)
>
>
>
> StrippedChars is
>
>
> private String StrippedChars(String strWords) {
>
>
>       String badChars[] = {"/select/i", "/drop/i", "/;/i", "/--/i",
> "/insert/i", "/delete/i", "/xp_/i","/SELECT/i", "/DROP/i'", "/INSERT/i",
> "/DELETE/i", "/XP_/i", "/Xp_/i", "/xP_/i","/sELECT/i", "/dROP/i",
> "/iNSERT/i", "/dELETE/i","/seLECT/i", "/drOP/i'", "/inSERT/i",
> "/deLETE/i","/selECT/i", "/droP/i", "/insERT/i",
> "/delETE/i","/seleCT/i","/inseRT/i", "/deleTE/i","/selecT/i","/inserT/i",
> "/deletE/i", "/DRop/i", "/DroP/i", "/DrOp/i", "/dRoP/i", "/DROp/i",
> "/DRoP/i","/Insert/i","/iNsert/i","/inSert/i","/insErt/i","/inseRt/i","/inserT/i"};
>
>       String newChars = strWords;
>
>       newChars = strWords;
>
>
>       if (strWords.trim() != ""){
>
>           for (int i = 0; i <= badChars.length; i++) {
>
>               newChars = newChars.replace(badChars[i], "");
>
>           }
>
>   }
>
>
>   return newChars;
>
> }
>
>
>
>
>
> It is being called from
>
>
>
>
> btnLogin.setOnClickListener(new OnClickListener() {
>
>   public void onClick(View v) {
>
>       String email = StrippedChars(Email.getText().toString().trim());
>
>
>
>
>
>
>
> This is the on Resume
>
>
>
>
>
>
> public void onResume() {
>
>       super.onResume();
>
>       setContentView(R.layout.main);
>
>
>       Email = (EditText)findViewById(R.id.email);
>
>
>
> I am entering information into the Email box so it should be empty or null
>
>
>
>
>
> Thanks
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



-- 
~ Jeremiah:9:23-24
Android 2D MMORPG: http://solrpg.com/,
http://www.youtube.com/user/revoltingx

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to