Created
June 2, 2012 21:11
-
-
Save gehaxelt/2859966 to your computer and use it in GitHub Desktop.
SQLInjectionActivity-Class for an android application
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package in.gehaxelt.sqlinjection; | |
import android.app.Activity; | |
import android.os.Bundle; | |
import android.view.View; | |
import android.view.View.OnClickListener; | |
import android.widget.Button; | |
import android.widget.EditText; | |
public class SQLInjectionActivity extends Activity implements OnClickListener { | |
/** Called when the activity is first created. */ | |
Button gobutton; | |
EditText injection; | |
Databasehelper DB; | |
@Override | |
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.main); | |
gobutton=(Button)findViewById(R.id.gobutton); | |
injection=(EditText)findViewById(R.id.injection); | |
gobutton.setOnClickListener(this); | |
DB = new Databasehelper(getApplicationContext()); | |
} | |
@Override | |
public void onClick(View v) { | |
// TODO Auto-generated method stub | |
if(v==gobutton) { | |
debugger.debug(injection.getText().toString()); | |
try { | |
String ouput= DB.getID(injection.getText().toString()); | |
debugger.debug(ouput); | |
} catch (Exception e) { | |
// TODO: handle exception | |
e.printStackTrace(); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment