[android-developers] How to set current latitude,longitude text into speech........
I have following code.but it couldn't produce output. myCode: public class SpeakActivity extends Activity implements OnInitListener{ private TextToSpeech tts; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_speak); LocationManager locationManager; String context = Context.LOCATION_SERVICE; locationManager = (LocationManager)getSystemService(context); Criteria crta = new Criteria(); crta.setAccuracy(Criteria.ACCURACY_FINE); crta.setAltitudeRequired(false); crta.setBearingRequired(false); crta.setCostAllowed(true); crta.setPowerRequirement(Criteria.POWER_LOW); String provider = locationManager.getBestProvider(crta, true); // String provider = LocationManager.GPS_PROVIDER; Location location = locationManager.getLastKnownLocation(provider); tts = new TextToSpeech(this, this); updateWithNewLocation(location); } public void say(String text2say){ tts.speak(text2say, TextToSpeech.QUEUE_FLUSH, null); } @Override public void onInit(int status) { say(latLongString); } @Override public void onDestroy() { if (tts!= null) { tts.stop(); tts.shutdown(); } super.onDestroy(); } private void updateWithNewLocation(Location location) { String latLongString; TextView myLocation; myLocation = (TextView) findViewById(R.id.myLocation); if(location!=null) { //tts=new TextToSpeech(this,this); double lat = location.getLatitude(); double lon = location.getLongitude(); latLongString = Lat: + lat + \nLong: + lon; // tts.speak(latLongString, RESULT_OK, null); }else{ latLongString=no location found; } myLocation.setText(Your current position is:\n + latLongString); say(latLongString); -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] How to move Object in android?
Which image you want?Copy that image and paste to drawable folder. On Mon, Dec 19, 2011 at 10:44 AM, android developer android.developer4...@gmail.com wrote: Hi i want small car game, in that let me know how to move object(car image). can anyone send me sample code for that.. Thank you all. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] where can get the Android sample source codes?
developer.android.com Here you get some sample code On Mon, Dec 19, 2011 at 11:32 AM, android developer android.developer4...@gmail.com wrote: where can get the Android sample source codes? send me the site links Thanks you all... -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en