Commit d04a2180 authored by Nastuzzi Samy's avatar Nastuzzi Samy
Browse files

Cleaning

Removing all Log.d useless
parent 6ffcaa07
......@@ -47,56 +47,22 @@ public class MainActivity extends NFCActivity {
usernameButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
connectDialog();
/*
if (registered) {
Log.d(LOG_TAG, "Enregistré");
connectDialog();
} else {
Log.d(LOG_TAG, "Non enregistré");
final AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(MainActivity.this);
alertDialogBuilder
.setTitle("Application non enregistrée")
.setMessage("Application non enregistrée")
.setCancelable(true)
.setPositiveButton("Continuer", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,int id) {
setRegistered(true);
dialog.cancel();
}
})
.setNegativeButton("Quitter",new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,int id) {
dialog.cancel();
MainActivity.this.finish();
}
});
createDialog(alertDialogBuilder);
}
*/
}
});
}
@Override
protected void onIdentification(final String idBadge) {
Log.d(LOG_TAG, idBadge);
badgeDialog(idBadge);
}
protected void setRegistered(boolean p_registered) {
registered = p_registered;
protected void setRegistered(boolean registered) {
this.registered = registered;
AppRegisteredText.setText(registered ? R.string.app_registred : R.string.app_not_registred);
}
protected void connectWithCAS(final String username, final String password) throws InterruptedException {
Log.d(LOG_TAG, "Login: " + username);
Log.d(LOG_TAG, "Mdp: " + password);
Log.d(LOG_TAG, "Url: " + casConnexion.getUrl());
dialog.dismiss();
final ProgressDialog loading = ProgressDialog.show(MainActivity.this, getResources().getString(R.string.cas_connection), getResources().getString(R.string.cas_in_connection), true);
......@@ -149,9 +115,6 @@ public class MainActivity extends NFCActivity {
}
protected void connectWithBadge(final String idBadge, final String pin) {
Log.d(LOG_TAG, "ID: " + idBadge);
Log.d(LOG_TAG, "PIN: " + pin);
dialog.dismiss();
if (registered) {
......
......@@ -8,7 +8,7 @@ import android.util.Log;
public class CASConnexion {
private static final String LOG_TAG = "CASConnexion";
private static final String service = "http://localhost";
private static final String service = "http://api.nemopay.net/";
private String url;
private String username;
private String location;
......@@ -50,10 +50,8 @@ public class CASConnexion {
request.setArg("username", username);
request.setArg("password", password);
if (request.post() == 201) {
Log.d(LOG_TAG, request.getHeader("Location"));
if (request.post() == 201)
this.location = request.getHeader("Location");
}
else
throw new RuntimeException("Not Connected");
}
......@@ -72,10 +70,8 @@ public class CASConnexion {
HTTPRequest request = new HTTPRequest(this.location);
request.setArg("service", this.service);
if (request.post() == 200) {
if (request.post() == 200)
this.ticket = request.getResponse();
Log.d(LOG_TAG, this.ticket);
}
else
throw new RuntimeException("Service not added");
}
......
......@@ -35,10 +35,10 @@ public class HTTPRequest {
}
public int get() throws IOException {
String data = "?" + args2String(this.args);
String data = args2String(this.args);
Log.d(LOG_TAG, "get: " + this.url + data);
this.request = (HttpURLConnection) (new URL(this.url + data)).openConnection();
this.request = (HttpURLConnection) (new URL(this.url + "?" + data)).openConnection();
this.request.setRequestMethod("GET");
this.request.setRequestProperty("Cookie", getCookiesHeader());
this.request.setUseCaches(false);
......
......@@ -75,7 +75,6 @@ public abstract class NFCActivity extends Activity {
protected void onNewIntent(Intent intent) {
if (intent.getAction().equals(NFCAdapter.ACTION_TAG_DISCOVERED)) {
Log.d(LOG_TAG, "Lecture d'un ID NFC");
String idBadge = ByteArrayToHexString(((Tag) intent.getParcelableExtra(NfcAdapter.EXTRA_TAG)).getId());
Log.d(LOG_TAG, "ID: " + idBadge);
onIdentification(idBadge);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment