diff --git a/PremiereActivite/.idea/inspectionProfiles/Project_Default.xml b/PremiereActivite/.idea/inspectionProfiles/Project_Default.xml
index 9c52622..8c798ea 100644
--- a/PremiereActivite/.idea/inspectionProfiles/Project_Default.xml
+++ b/PremiereActivite/.idea/inspectionProfiles/Project_Default.xml
@@ -1,6 +1,11 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/PremiereActivite/app/build.gradle b/PremiereActivite/app/build.gradle
index a78f188..3b173ef 100644
--- a/PremiereActivite/app/build.gradle
+++ b/PremiereActivite/app/build.gradle
@@ -6,7 +6,7 @@ android {
defaultConfig {
applicationId "com.example.app_10p5"
- minSdkVersion 20
+ minSdkVersion 21
targetSdkVersion 23
versionCode 1
versionName "1.0"
diff --git a/PremiereActivite/app/src/main/AndroidManifest.xml b/PremiereActivite/app/src/main/AndroidManifest.xml
index fe3ce70..70529bd 100644
--- a/PremiereActivite/app/src/main/AndroidManifest.xml
+++ b/PremiereActivite/app/src/main/AndroidManifest.xml
@@ -4,6 +4,7 @@
+
diff --git a/PremiereActivite/app/src/main/java/com/example/app_10p5/ASyncResponse.java b/PremiereActivite/app/src/main/java/com/example/app_10p5/ASyncResponse.java
new file mode 100644
index 0000000..1e56dc5
--- /dev/null
+++ b/PremiereActivite/app/src/main/java/com/example/app_10p5/ASyncResponse.java
@@ -0,0 +1,10 @@
+package com.example.app_10p5;
+
+import org.json.JSONObject;
+
+/**
+ * Created by beaus on 30/04/2016.
+ */
+public interface ASyncResponse {
+ void processFinish(JSONObject output);
+}
diff --git a/PremiereActivite/app/src/main/java/com/example/app_10p5/CarteActivite.java b/PremiereActivite/app/src/main/java/com/example/app_10p5/CarteActivite.java
index e88ae1e..de4cbd0 100644
--- a/PremiereActivite/app/src/main/java/com/example/app_10p5/CarteActivite.java
+++ b/PremiereActivite/app/src/main/java/com/example/app_10p5/CarteActivite.java
@@ -9,20 +9,56 @@ import android.nfc.tech.MifareClassic;
import android.os.Bundle;
import android.widget.Toast;
+import org.json.JSONObject;
+
import java.io.IOException;
+import java.net.URL;
+import java.util.HashMap;
/**
* Created by beaus on 24/04/2016.
*/
-public class CarteActivite extends Activity {
+public class CarteActivite extends Activity implements ASyncResponse {
private NfcAdapter mNfcAdapter;
+ private HashMap mParam;
+ private String mAPI;
+
+ public static final String HOST = "https://10p5.clubinfo.frogeye.fr/";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.layout_carte);
+ switch (getIntent().getIntExtra("state", MainActivite.STATE_RIEN)) {
+
+ case MainActivite.STATE_COMMANDE:
+ mParam.put("quantite", String.valueOf(getIntent().getIntExtra("quantite", -1)));
+ mParam.put("montant", String.valueOf(getIntent().getFloatExtra("montant", -1)));
+ mParam.put("token", getIntent().getStringExtra("token"));
+ mAPI = "api/client/payer";
+ break;
+ case MainActivite.STATE_CREATION_COMPTE:
+ //TODO: param
+ mAPI = "api/client/ajouter";
+ break;
+ case MainActivite.STATE_RECHARGEMENT:
+ //TODO: param
+ mAPI = "api/client/recharger";
+ break;
+ case MainActivite.STATE_VIDANGE:
+ //TODO: param
+ mAPI = "api/client/vidange";
+ break;
+ case MainActivite.STATE_CONNEXION:
+ case MainActivite.STATE_RIEN:
+ default:
+ Toast.makeText(this, "WTF, le cancer est dans l'application!!", Toast.LENGTH_LONG).show();
+ finish();
+ return;
+ }
+
mNfcAdapter = NfcAdapter.getDefaultAdapter(this);
if (mNfcAdapter == null) {
@@ -62,11 +98,6 @@ public class CarteActivite extends Activity {
handleIntent(intent);
}
- public void taFonction(String id_carte, String login)
- {
- //code fonction
- }
-
@Override
protected void onPause() {
stopForegroundDispatch(this, mNfcAdapter);
@@ -77,6 +108,7 @@ public class CarteActivite extends Activity {
if (NfcAdapter.ACTION_TAG_DISCOVERED.equals(intent.getAction())) {
Toast toast;
String id_carte = ByteArrayToHexString(intent.getByteArrayExtra(NfcAdapter.EXTRA_ID));
+ mParam.put("ID", id_carte);
toast = Toast.makeText(getApplicationContext(), "ID Carte : " + id_carte, Toast.LENGTH_SHORT);
toast.show();
@@ -137,9 +169,9 @@ public class CarteActivite extends Activity {
toast.show();
//Éxécution de la fonction
- taFonction(id_carte, login);
+ clientAPI();
+ }
}
- }
public static void setupForegroundDispatch(final Activity activity, NfcAdapter adapter){
final Intent intent = new Intent(activity.getApplicationContext(), activity.getClass());
@@ -151,4 +183,24 @@ public class CarteActivite extends Activity {
public static void stopForegroundDispatch(final Activity activity, NfcAdapter adapter) {
adapter.disableForegroundDispatch(activity);
}
+
+ public void clientAPI() {
+ try {
+ URL url = new URL(HOST + mAPI);
+ NetworkThread nt = new NetworkThread(url, mParam);
+ nt.execute();
+ }
+ catch (Throwable t){
+ Toast.makeText(this, "WTF, le cancer est dans l'application!!", Toast.LENGTH_LONG).show();
+ finish();
+ return;
+ }
+ }
+
+
+ /* Retour du NetworkThread */
+ @Override
+ public void processFinish(JSONObject output) {
+ //TODO: faire un retour vers l'activity parente des données reçues.
+ }
}
diff --git a/PremiereActivite/app/src/main/java/com/example/app_10p5/MainActivite.java b/PremiereActivite/app/src/main/java/com/example/app_10p5/MainActivite.java
index 924fb0b..c49a474 100644
--- a/PremiereActivite/app/src/main/java/com/example/app_10p5/MainActivite.java
+++ b/PremiereActivite/app/src/main/java/com/example/app_10p5/MainActivite.java
@@ -1,39 +1,48 @@
package com.example.app_10p5;
-import android.app.PendingIntent;
import android.content.Intent;
-import android.content.IntentFilter;
-import android.nfc.NfcAdapter;
-import android.nfc.Tag;
-import android.nfc.tech.MifareClassic;
-import android.nfc.tech.NfcA;
import android.os.Bundle;
import android.support.design.widget.TabLayout;
import android.support.v4.app.FragmentActivity;
-import android.support.v4.app.FragmentManager;
-import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;
import android.view.View;
+import android.widget.EditText;
import android.widget.Toast;
-import java.io.IOException;
/**
* Created by beaus on 24/04/2016.
*/
public class MainActivite extends FragmentActivity {
+ public static final int STATE_RIEN = 0;
+ public static final int STATE_COMMANDE = 3;
+ public static final int STATE_VIDANGE = 4;
+ public static final int STATE_RECHARGEMENT = 2;
+ public static final int STATE_CREATION_COMPTE = 1;
+ public static final int STATE_CONNEXION = 5;
+ public static final long EXPIRATION = 1000*60*10;
+
+ private int mState;
+ private String mToken;
+ private long mTimeToken;
+
@Override
protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.layout_main);
+
+ mState = STATE_RIEN;
+ mTimeToken = -1;
+ mToken = "";
+
TabLayout tabLayout = (TabLayout) findViewById(R.id.tab_layout);
tabLayout.setTabMode(TabLayout.MODE_SCROLLABLE);
+ tabLayout.addTab(tabLayout.newTab().setText("Connexion"));
tabLayout.addTab(tabLayout.newTab().setText("Commande"));
tabLayout.addTab(tabLayout.newTab().setText("Rechargement"));
tabLayout.addTab(tabLayout.newTab().setText("Création"));
tabLayout.addTab(tabLayout.newTab().setText("Vidange"));
- tabLayout.addTab(tabLayout.newTab().setText("Admin"));
tabLayout.setTabGravity(TabLayout.GRAVITY_FILL);
final ViewPager viewPager = (ViewPager) findViewById(R.id.pager);
@@ -44,7 +53,14 @@ public class MainActivite extends FragmentActivity {
tabLayout.setOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
@Override
public void onTabSelected(TabLayout.Tab tab) {
- viewPager.setCurrentItem(tab.getPosition());
+ if(mToken != "" && System.currentTimeMillis() - mTimeToken < EXPIRATION){
+ viewPager.setCurrentItem(tab.getPosition());
+ }
+ else{
+ viewPager.setCurrentItem(tab.getPosition()); //Empeche un bug graphique
+ viewPager.setCurrentItem(0);
+ Toast.makeText(MainActivite.this, "Veuillez vous connecter.", Toast.LENGTH_LONG).show();
+ }
}
@Override
@@ -61,8 +77,78 @@ public class MainActivite extends FragmentActivity {
public void valideCommande(View v)
{
- Intent intent = new Intent(this, CarteActivite.class);
- startActivity(intent);
+ if((mToken != "") && ((System.currentTimeMillis() - mTimeToken) < EXPIRATION)) {
+ EditText champMontant = (EditText) findViewById(R.id.commande_prix);
+ EditText champQuantite = (EditText) findViewById(R.id.commande_quantite);
+ float montant = Float.parseFloat(champMontant.getText().toString());
+ int quantite = Integer.parseInt(champQuantite.getText().toString());
+
+ if ((montant > 0.0) && (montant < 200.0)) {
+ mState = STATE_COMMANDE;
+ Intent intent = new Intent(this, CarteActivite.class);
+ intent.putExtra("token", mToken);
+ intent.putExtra("state", mState);
+ intent.putExtra("montant", montant);
+ intent.putExtra("quantite", quantite);
+ startActivityForResult(intent, mState);
+ }
+ }
+ else{
+ Toast.makeText(this, "Veuillez vous reconnecter.", Toast.LENGTH_LONG).show();
+ final ViewPager viewPager = (ViewPager) findViewById(R.id.pager);
+ viewPager.setCurrentItem(0);
+ }
+ }
+
+ public void valideRechargement(View v)
+ {
+ if((mToken != "") && ((System.currentTimeMillis() - mTimeToken) > 0)) {
+
+ }
+ else{
+ Toast.makeText(this, "Veuillez vous reconnecter.", Toast.LENGTH_LONG).show();
+ final ViewPager viewPager = (ViewPager) findViewById(R.id.pager);
+ viewPager.setCurrentItem(0);
+ }
+ }
+
+ public void valideConnection(View v)
+ {
+ EditText viewUser = (EditText) findViewById(R.id.connection_username);
+ EditText viewPsw = (EditText) findViewById(R.id.connection_password);
+
+ String user = viewUser.toString();
+ String password = viewPsw.toString();
+
+ if ((user != "") && (password != "")) {
+ mState = STATE_CONNEXION;
+ Intent intent = new Intent(this, CarteActivite.class);
+ intent.putExtra("user", user);
+ intent.putExtra("state", mState);
+ intent.putExtra("password", password);
+ startActivityForResult(intent, mState);
+ }
+ }
+
+ @Override
+ protected void onActivityResult(int requestCode, int resultCode, Intent data){
+ //TODO: faire des choses avec ca
+ switch (requestCode) {
+ case STATE_COMMANDE:
+ break;
+ case STATE_CONNEXION:
+ break;
+ case STATE_CREATION_COMPTE:
+ break;
+ case STATE_RECHARGEMENT:
+ break;
+ case STATE_VIDANGE:
+ break;
+ case STATE_RIEN:
+ default:
+ Toast.makeText(this, "WTF, le cancer est dans l'application!!", Toast.LENGTH_LONG).show();
+ break;
+ }
}
}
diff --git a/PremiereActivite/app/src/main/java/com/example/app_10p5/NetworkThread.java b/PremiereActivite/app/src/main/java/com/example/app_10p5/NetworkThread.java
new file mode 100644
index 0000000..c224939
--- /dev/null
+++ b/PremiereActivite/app/src/main/java/com/example/app_10p5/NetworkThread.java
@@ -0,0 +1,95 @@
+package com.example.app_10p5;
+
+import android.os.AsyncTask;
+
+import org.json.JSONObject;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.io.OutputStreamWriter;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.net.ssl.HttpsURLConnection;
+
+/**
+ * Created by beaus on 30/04/2016.
+ */
+public class NetworkThread extends AsyncTask {
+ public ASyncResponse delegate = null;
+ private URL mUrl;
+ private HashMap mParam;
+
+ NetworkThread(URL url, HashMap param){
+
+ mUrl = url;
+ mParam = param;
+ }
+
+ @Override
+ protected void onPreExecute() {
+ /**
+ * show dialog
+ */
+ super.onPreExecute();
+ }
+
+ @Override
+ protected JSONObject doInBackground(Void ... params) {
+
+ /**
+ * Do network related stuff
+ * return string response.
+ */
+
+ JSONObject json = new JSONObject();
+ try {
+ HttpURLConnection httpCo = (HttpURLConnection) mUrl.openConnection();
+ httpCo.setDoOutput(true);
+
+ httpCo.connect();
+
+ OutputStreamWriter wr = new OutputStreamWriter(httpCo.getOutputStream());
+ for (Map.Entry entry : mParam.entrySet()) {
+ String key = entry.getKey();
+ String value = entry.getValue();
+ wr.write(key + "=" + value);
+ }
+ wr.flush();
+
+ String response = "";
+
+ if (httpCo.getResponseCode() == HttpsURLConnection.HTTP_OK) {
+ String line;
+ BufferedReader br = new BufferedReader(new InputStreamReader(httpCo.getInputStream()));
+ while ((line = br.readLine()) != null) {
+ response += line;
+ }
+ } else {
+ response = "Erreur";
+ }
+
+ json = new JSONObject(response);
+
+ System.out.println(json.getString("status"));
+
+ httpCo.disconnect();
+ } catch (Throwable e) {
+ System.out.println(e.toString());
+ }
+
+ return json;
+ }
+
+ @Override
+ protected void onPostExecute(JSONObject result) {
+
+ /**
+ * update ui thread and remove dialog
+ */
+ super.onPostExecute(result);
+ delegate.processFinish(result);
+ }
+}
\ No newline at end of file
diff --git a/PremiereActivite/app/src/main/java/com/example/app_10p5/fonction_API_client.java b/PremiereActivite/app/src/main/java/com/example/app_10p5/fonction_API_client.java
new file mode 100644
index 0000000..cf65d2f
--- /dev/null
+++ b/PremiereActivite/app/src/main/java/com/example/app_10p5/fonction_API_client.java
@@ -0,0 +1,230 @@
+
+/*
+
+public JSON client_ajouter(String logiLille1,String soldeini, String IdCarte, String decouvert){
+ try{
+ Httppost httpost = new HttpPost("10p5.clubinfo.frogeye.fr/api/client/ajouter");
+ List postParameters = new ArrayList>NameValuePair>();
+ postParameters.add(new BasicNameValuePair("loginLille1", loginLille1));
+ postParameters.add(new BasicNameValuePair("soldeInitial",soldeini));
+ postParameters.add(new BasicNameValuePair("idCarte", IdCarte));
+ postParameters.add(new BasicNameValuePair("decouvertAutorise",decouvert));
+ httppost.setEntity(new UrlEncodedFormEntity(postParameters));
+
+ HttpClient httpclient = new DefaultHttpClient();
+ HttpResponse responce = httpclient.execute(httppost);
+ return(responce);
+ }
+ catch(Exception e) {}
+}
+
+
+public void client_carte(String logiLille1,String newIdCarte){
+ try{
+ Httppost httpost = new HttpPost("10p5.clubinfo.frogeye.fr/api/client/carte");
+ List postParameters = new ArrayList>NameValuePair>();
+ postParameters.add(new BasicNameValuePair("loginLille1", loginLille1));
+ postParameters.add(new BasicNameValuePair("idCarte",newIdCarte));
+ httppost.setEntity(new UrlEncodedFormEntity(postParameters));
+
+ HttpClient httpclient = new DefaultHttpClient();
+ HttpResponse responce = httpclient.execute(httppost);
+ }
+ catch(Exception e) {}
+}
+
+public JSON client_liste(){
+ try{
+ Httppost httpost = new HttpPost("10p5.clubinfo.frogeye.fr/api/client/liste");
+
+ HttpClient httpclient = new DefaultHttpClient();
+ HttpResponse responce = httpclient.execute(httppost);
+ return(responce);
+ }
+ catch(Exception e) {}
+}
+
+
+public void client_decouvert(String idCarte,String newDecouvertAutorise){
+ try{
+ Httppost httpost = new HttpPost("10p5.clubinfo.frogeye.fr/api/client/decouvert");
+ List postParameters = new ArrayList>NameValuePair>();
+ postParameters.add(new BasicNameValuePair("idCarte",idCarte));
+ postParameters.add(new BasicNameValuePair("decouvertAutorise", newDecouvertAutorise));
+ httppost.setEntity(new UrlEncodedFormEntity(postParameters));
+
+ HttpClient httpclient = new DefaultHttpClient();
+ httpclient.execute(httppost);
+ }
+ catch(Exception e) {}
+}
+
+
+public JSON utilisateur_connexion(String login, String mdp, String idCarte, String loginLille1){
+ try{
+ Httppost httpost = new HttpPost("10p5.clubinfo.frogeye.fr/api/utilisateur/connexion");
+ List postParameters = new ArrayList>NameValuePair>();
+ postParameters.add(new BasicNameValuePair("login",idCarte));
+ postParameters.add(new BasicNameValuePair("mdp",mdp));
+ postParameters.add(new BasicNameValuePair("idCarte",idCarte));
+ postParameters.add(new BasicNameValuePair("loginLille1", loginLille1));
+ httppost.setEntity(new UrlEncodedFormEntity(postParameters));
+
+ HttpClient httpclient = new DefaultHttpClient();
+ HttpResponse responce = httpclient.execute(httppost);
+ return(responce);
+ }
+ catch(Exception e) {}
+}
+
+public void utilisateur_deconnexion(){
+ try{
+ Httppost httpost = new HttpPost("10p5.clubinfo.frogeye.fr/api/utilisateur/deconnexion");
+
+ HttpClient httpclient = new DefaultHttpClient();
+ httpclient.execute(httppost);
+ }
+ catch(Exception e) {}
+}
+
+
+public void utilisateur_mdp(String login, String newmdp){
+ try{
+ Httppost httpost = new HttpPost("10p5.clubinfo.frogeye.fr/api/utilisateur/mdp");
+ List postParameters = new ArrayList>NameValuePair>();
+ postParameters.add(new BasicNameValuePair("login",idCarte));
+ postParameters.add(new BasicNameValuePair("mdp",newmdp));
+ httppost.setEntity(new UrlEncodedFormEntity(postParameters));
+
+ HttpClient httpclient = new DefaultHttpClient();
+ httpclient.execute(httppost);
+ }
+ catch(Exception e) {}
+}
+
+
+public void utilisateur_droit(String login, String newdroit){
+ try{
+ Httppost httpost = new HttpPost("10p5.clubinfo.frogeye.fr/api/utilisateur/droit");
+ List postParameters = new ArrayList>NameValuePair>();
+ postParameters.add(new BasicNameValuePair("login",idCarte));
+ postParameters.add(new BasicNameValuePair("niveau de droit",newdroit));
+ httppost.setEntity(new UrlEncodedFormEntity(postParameters));
+
+ HttpClient httpclient = new DefaultHttpClient();
+ httpclient.execute(httppost);
+ }
+ catch(Exception e) {}
+}
+
+public void utilisateur_ajouter(String login, String mdp, String loginLille1, String idCarte, String droit){
+ try{
+ Httppost httpost = new HttpPost("10p5.clubinfo.frogeye.fr/api/utilisateur/ajouter");
+ List postParameters = new ArrayList>NameValuePair>();
+ postParameters.add(new BasicNameValuePair("login",idCarte));
+ postParameters.add(new BasicNameValuePair("mdp",mdp));
+ postParameters.add(new BasicNameValuePair("loginLille1", loginLille1));
+ postParameters.add(new BasicNameValuePair("idCarte",IdCarte));
+ postParameters.add(new BasicNameValuePair("niveau de droit",droit));
+ httppost.setEntity(new UrlEncodedFormEntity(postParameters));
+
+ HttpClient httpclient = new DefaultHttpClient();
+ httpclient.execute(httppost);
+ }
+ catch(Exception e) {}
+}
+
+
+
+public void utilisateur_carte(String login, String loginLille1, String idCarte){
+ try{
+ Httppost httpost = new HttpPost("10p5.clubinfo.frogeye.fr/api/utilisateur/carte");
+ List postParameters = new ArrayList>NameValuePair>();
+ postParameters.add(new BasicNameValuePair("login",idCarte));
+ postParameters.add(new BasicNameValuePair("loginLille1", loginLille1));
+ postParameters.add(new BasicNameValuePair("idCarte",newIdCarte));
+ httppost.setEntity(new UrlEncodedFormEntity(postParameters));
+
+ HttpClient httpclient = new DefaultHttpClient();
+ httpclient.execute(httppost);
+ }
+ catch(Exception e) {}
+}
+
+
+public void utilisateur_supprimer(String login){
+ try{
+ Httppost httpost = new HttpPost("10p5.clubinfo.frogeye.fr/api/utilisateur/carte");
+ List postParameters = new ArrayList>NameValuePair>();
+ postParameters.add(new BasicNameValuePair("login",idCarte));
+ httppost.setEntity(new UrlEncodedFormEntity(postParameters));
+
+ HttpClient httpclient = new DefaultHttpClient();
+ httpclient.execute(httppost);
+ }
+ catch(Exception e) {}
+}
+
+
+public JSON transaction_rechargement(String idCarte, String montant){
+ try{
+ Httppost httpost = new HttpPost("10p5.clubinfo.frogeye.fr/api/transaction/rechargement");
+ List postParameters = new ArrayList>NameValuePair>();
+ postParameters.add(new BasicNameValuePair("idCarte",idCarte));
+ postParameters.add(new BasicNameValuePair("montant",montant));
+ httppost.setEntity(new UrlEncodedFormEntity(postParameters));
+
+ HttpClient httpclient = new DefaultHttpClient();
+ HttpResponse responce = httpclient.execute(httppost);
+ return(responce);
+ }
+ catch(Exception e) {}
+}
+
+
+public JSON transaction_paiementt(String idCarte, String montant, String nbConso){
+ try{
+ Httppost httpost = new HttpPost("10p5.clubinfo.frogeye.fr/api/transaction/paiement");
+ List postParameters = new ArrayList>NameValuePair>();
+ postParameters.add(new BasicNameValuePair("idCarte",idCarte));
+ postParameters.add(new BasicNameValuePair("montant",montant));
+ postParameters.add(new BasicNameValuePair("qte",nbConso));
+ httppost.setEntity(new UrlEncodedFormEntity(postParameters));
+
+ HttpClient httpclient = new DefaultHttpClient();
+ HttpResponse responce = httpclient.execute(httppost);
+ return(responce);
+ }
+ catch(Exception e) {}
+}
+
+
+
+public JSON transaction_vidange(String idCarte){
+ try{
+ Httppost httpost = new HttpPost("10p5.clubinfo.frogeye.fr/api/transaction/vidange");
+ List postParameters = new ArrayList>NameValuePair>();
+ postParameters.add(new BasicNameValuePair("idCarte",idCarte));
+ httppost.setEntity(new UrlEncodedFormEntity(postParameters));
+
+ HttpClient httpclient = new DefaultHttpClient();
+ HttpResponse responce = httpclient.execute(httppost);
+ return(responce);
+ }
+ catch(Exception e) {}
+}
+
+
+public void transaction_annuler(String idTransac){
+ try{
+ Httppost httpost = new HttpPost("10p5.clubinfo.frogeye.fr/api/transaction/annuler");
+ List postParameters = new ArrayList>NameValuePair>();
+ postParameters.add(new BasicNameValuePair("id",idTransac));
+ httppost.setEntity(new UrlEncodedFormEntity(postParameters));
+
+ HttpClient httpclient = new DefaultHttpClient();
+ httpclient.execute(httppost);
+ }
+ catch(Exception e) {}
+}
+*/
\ No newline at end of file
diff --git a/PremiereActivite/app/src/main/res/layout-v23/layout_commande.xml b/PremiereActivite/app/src/main/res/layout-v23/layout_commande.xml
new file mode 100644
index 0000000..f65d166
--- /dev/null
+++ b/PremiereActivite/app/src/main/res/layout-v23/layout_commande.xml
@@ -0,0 +1,66 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/PremiereActivite/app/src/main/res/layout/layout_carte.xml b/PremiereActivite/app/src/main/res/layout/layout_carte.xml
index 26a5113..6843fa6 100644
--- a/PremiereActivite/app/src/main/res/layout/layout_carte.xml
+++ b/PremiereActivite/app/src/main/res/layout/layout_carte.xml
@@ -10,11 +10,11 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/passCarte"
- android:id="@+id/textView2"
+ android:id="@+id/textView_carte"
android:layout_gravity="center_horizontal"
android:enabled="true"
- android:inputType="text"
android:textAlignment="center"
- android:textSize="50dp"
- android:layout_marginTop="40dp" />
+ android:textSize="50sp"
+ android:layout_marginTop="40dp"
+ android:inputType="none" />
\ No newline at end of file
diff --git a/PremiereActivite/app/src/main/res/layout/layout_commande.xml b/PremiereActivite/app/src/main/res/layout/layout_commande.xml
deleted file mode 100644
index 3e53f89..0000000
--- a/PremiereActivite/app/src/main/res/layout/layout_commande.xml
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/PremiereActivite/app/src/main/res/layout/layout_connection.xml b/PremiereActivite/app/src/main/res/layout/layout_connection.xml
index 4fbf031..50b577b 100644
--- a/PremiereActivite/app/src/main/res/layout/layout_connection.xml
+++ b/PremiereActivite/app/src/main/res/layout/layout_connection.xml
@@ -15,22 +15,59 @@
android:textSize="@dimen/abc_text_size_large_material"
android:textStyle="bold" />
-
+ android:inputType="text"
+ android:ems="15"
+ android:id="@+id/connection_username"
+ android:editable="true"
+ android:elegantTextHeight="true"
+ android:enabled="true"
+ android:width="300dp"
+ android:hint="@string/identifiant"
+ android:textAlignment="center"
+ android:layout_gravity="center_horizontal"
+ android:layout_marginTop="30dp"
+ android:height="150dp"
+ android:minHeight="50dp"
+ android:maxHeight="500dp"
+ android:minWidth="120dp"
+ android:textIsSelectable="true" />
-
+ android:inputType="textPassword"
+ android:ems="15"
+ android:id="@+id/connection_password"
+ android:editable="true"
+ android:elegantTextHeight="true"
+ android:enabled="true"
+ android:width="300dp"
+ android:hint="@string/password"
+ android:textAlignment="center"
+ android:layout_gravity="center_horizontal"
+ android:layout_marginTop="30dp"
+ android:height="150dp"
+ android:minHeight="50dp"
+ android:maxHeight="500dp"
+ android:minWidth="120dp"
+ android:textIsSelectable="true" />
+ android:text="@string/validate"
+ android:id="@+id/con_validation"
+ android:layout_gravity="center_horizontal"
+ android:layout_marginTop="40dp"
+ android:width="180dp"
+ android:height="80dp"
+ android:onClick="valideConnection"
+ android:nestedScrollingEnabled="false"
+ android:enabled="true"
+ android:focusable="true"
+ android:focusableInTouchMode="true" />
\ No newline at end of file
diff --git a/PremiereActivite/app/src/main/res/layout/layout_rechargement.xml b/PremiereActivite/app/src/main/res/layout/layout_rechargement.xml
index 8eb6bf7..b12d348 100644
--- a/PremiereActivite/app/src/main/res/layout/layout_rechargement.xml
+++ b/PremiereActivite/app/src/main/res/layout/layout_rechargement.xml
@@ -9,15 +9,13 @@
android:layout_height="wrap_content"
android:inputType="numberDecimal"
android:ems="10"
- android:id="@+id/montant"
+ android:id="@+id/rechargement_champ_montant"
android:layout_gravity="center_horizontal"
android:layout_marginTop="80dp"
android:editable="true"
android:elegantTextHeight="true"
android:enabled="true"
- android:focusable="true"
- android:focusableInTouchMode="true"
- android:height="200dp"
+ android:height="150dp"
android:maxHeight="500dp"
android:maxLength="10"
android:maxWidth="600dp"
@@ -25,15 +23,14 @@
android:numeric="decimal"
android:width="300dp"
android:hint="@string/montant"
- android:textAlignment="center" />
+ android:textAlignment="center"
+ android:textStyle="bold" />
+ android:focusableInTouchMode="true"
+ android:onClick="valideRechargement"
+ android:height="80dp"
+ android:maxHeight="200dp"
+ android:maxWidth="150dp" />
\ No newline at end of file
diff --git a/PremiereActivite/app/src/main/res/layout/tab_fragment_1.xml b/PremiereActivite/app/src/main/res/layout/tab_fragment_1.xml
index b5eefa3..ebd6681 100644
--- a/PremiereActivite/app/src/main/res/layout/tab_fragment_1.xml
+++ b/PremiereActivite/app/src/main/res/layout/tab_fragment_1.xml
@@ -4,6 +4,6 @@
android:layout_height="match_parent"
android:orientation="vertical">
-
+
\ No newline at end of file
diff --git a/PremiereActivite/app/src/main/res/layout/tab_fragment_2.xml b/PremiereActivite/app/src/main/res/layout/tab_fragment_2.xml
index 96af496..b5eefa3 100644
--- a/PremiereActivite/app/src/main/res/layout/tab_fragment_2.xml
+++ b/PremiereActivite/app/src/main/res/layout/tab_fragment_2.xml
@@ -4,6 +4,6 @@
android:layout_height="match_parent"
android:orientation="vertical">
-
+
\ No newline at end of file
diff --git a/PremiereActivite/app/src/main/res/layout/tab_fragment_3.xml b/PremiereActivite/app/src/main/res/layout/tab_fragment_3.xml
index 5455b40..96af496 100644
--- a/PremiereActivite/app/src/main/res/layout/tab_fragment_3.xml
+++ b/PremiereActivite/app/src/main/res/layout/tab_fragment_3.xml
@@ -4,6 +4,6 @@
android:layout_height="match_parent"
android:orientation="vertical">
-
+
\ No newline at end of file
diff --git a/PremiereActivite/app/src/main/res/layout/tab_fragment_4.xml b/PremiereActivite/app/src/main/res/layout/tab_fragment_4.xml
index 092bc4e..5455b40 100644
--- a/PremiereActivite/app/src/main/res/layout/tab_fragment_4.xml
+++ b/PremiereActivite/app/src/main/res/layout/tab_fragment_4.xml
@@ -4,6 +4,6 @@
android:layout_height="match_parent"
android:orientation="vertical">
-
+
\ No newline at end of file
diff --git a/PremiereActivite/app/src/main/res/layout/tab_fragment_5.xml b/PremiereActivite/app/src/main/res/layout/tab_fragment_5.xml
index ebd6681..092bc4e 100644
--- a/PremiereActivite/app/src/main/res/layout/tab_fragment_5.xml
+++ b/PremiereActivite/app/src/main/res/layout/tab_fragment_5.xml
@@ -4,6 +4,6 @@
android:layout_height="match_parent"
android:orientation="vertical">
-
+
\ No newline at end of file
diff --git a/PremiereActivite/app/src/main/res/values/strings.xml b/PremiereActivite/app/src/main/res/values/strings.xml
index 9fb0ca0..eb906f3 100644
--- a/PremiereActivite/app/src/main/res/values/strings.xml
+++ b/PremiereActivite/app/src/main/res/values/strings.xml
@@ -1,13 +1,13 @@
PremiereActivite
Settings
-
-
+ Identifiant
+ Mot de passe
Valider
Quantité
Montant
Prix
Vidange
- Passez la carte
+ Passez la carte du client
diff --git a/PremiereActivite/build.gradle b/PremiereActivite/build.gradle
index 168f129..03bced9 100644
--- a/PremiereActivite/build.gradle
+++ b/PremiereActivite/build.gradle
@@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
- classpath 'com.android.tools.build:gradle:2.0.0'
+ classpath 'com.android.tools.build:gradle:2.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
--
libgit2 0.21.2