corrige utf-8

This commit is contained in:
nicobo 2012-11-10 19:11:45 +01:00
parent 5a4774ff77
commit 99b951e5f6
12 changed files with 155 additions and 4 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -38,6 +38,8 @@ public class Poi implements Parcelable, Comparable<Poi> {
/** Ex: "RD7" */
public String voie;
public String theme;
public Poi() {
super();
}
@ -63,6 +65,7 @@ public class Poi implements Parcelable, Comparable<Poi> {
type = p.readString();
ville = p.readString();
voie = p.readString();
theme = p.readString();
}
public static final Parcelable.Creator<Poi> CREATOR = new Parcelable.Creator<Poi>() {
@ -98,6 +101,7 @@ public class Poi implements Parcelable, Comparable<Poi> {
p.writeString(type);
p.writeString(ville);
p.writeString(voie);
p.writeString(theme);
}
@Override

View file

@ -3,6 +3,7 @@ package bma.groomservice.data.dataprovence;
import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.Arrays;
@ -17,6 +18,7 @@ import bma.groomservice.data.Poi;
import bma.groomservice.data.PoiList;
import com.google.gson.Gson;
import com.google.gson.stream.JsonReader;
public class DataprovenceHelper {
@ -99,11 +101,12 @@ public class DataprovenceHelper {
*/
protected PoiList getContent(InputStream is) throws IOException {
String json = readStream(is);
// String json = readStream(is);
// logger.debug("json={}", json);
Gson gson = new Gson();
PoiList all = gson.fromJson(json, PoiList.class);
PoiList all = gson.fromJson(new JsonReader(new InputStreamReader(is,
"UTF-8")), PoiList.class);
return all;
}

View file

@ -0,0 +1,38 @@
package bma.groomservice.tts;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import android.app.Activity;
import android.content.Intent;
import android.speech.tts.TextToSpeech;
import android.speech.tts.TextToSpeech.OnInitListener;
public class Speaker implements OnInitListener {
private static Logger logger = LoggerFactory.getLogger(Speaker.class);
public static final int MY_DATA_CHECK_CODE = 1;
Activity activity;
String sentence;
public Speaker(Activity activity) {
this.activity = activity;
}
public void say(String sentence) {
logger.debug("say");
this.sentence = sentence;
Intent checkIntent = new Intent();
checkIntent.setAction(TextToSpeech.Engine.ACTION_CHECK_TTS_DATA);
activity.startActivityForResult(checkIntent, MY_DATA_CHECK_CODE);
}
private TextToSpeech mTts;
@Override
public void onInit(int status) {
logger.debug("onInit({})", status);
mTts.speak(sentence, TextToSpeech.QUEUE_ADD, null);
}
}