Skip to content
This repository has been archived by the owner on Apr 8, 2018. It is now read-only.

Commit

Permalink
Exchanges messages and points and small bugs fixed
Browse files Browse the repository at this point in the history
(still needs to update the server when points are exchanged between users)
#49, closes #48, #43, #39, closes #33, closes #20
  • Loading branch information
vicenterocha committed Apr 27, 2016
1 parent 506d3ee commit cb222d1
Show file tree
Hide file tree
Showing 12 changed files with 1,010 additions and 187 deletions.
17 changes: 11 additions & 6 deletions app/src/main/java/pt/ulisboa/tecnico/cmu/ubibike/ScoreHistory.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import android.widget.Button;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;

import org.json.JSONException;
import org.json.JSONObject;
Expand Down Expand Up @@ -179,9 +180,11 @@ protected Void doInBackground(Void... params) {

json = new JSONObject();
json.put(REQUEST_TYPE, ADD_POINTS);
json.put(CLIENT_POINTS, ADD_POINTS_TEST_125);
json.put(POINTS_ORIGIN, ADD_POINTS_TEST_125_ORIGIN);
json.put(POINTS_TO_ADD, ADD_POINTS_TEST_10);
json.put(POINTS_ORIGIN, ADD_POINTS_TEST_10_ORIGIN);
json.put(CLIENT_NAME, bikerName);
// TODO: 27-Apr-16 so funciona quando é a joana a querer adicionar
json.put(USER_WIFI, "joao");


dataOutputStream = new DataOutputStream(
Expand All @@ -194,12 +197,14 @@ protected Void doInBackground(Void... params) {
dataOutputStream.writeUTF(json.toString());

// Thread will wait till server replies
String response = dataInputStream.readUTF();

// Toast.makeText(ScoreHistory.this, response,
// Toast.LENGTH_LONG).show();
final String response = dataInputStream.readUTF();


ScoreHistory.this.runOnUiThread(new Runnable() {
public void run() {
Toast.makeText(ScoreHistory.this, response, Toast.LENGTH_SHORT).show();
}
});

// new BufferedWriter(new OutputStreamWriter(mySocketOutputStream, "UTF-8")));

Expand Down
Loading

0 comments on commit cb222d1

Please sign in to comment.