TextToSpeech mTts; mTts=newTextToSpeech(this, newTextToSpeech.OnInitListener() { @Override publicvoidonInit(int status) { // status can be either TextToSpeech.SUCCESS or TextToSpeech.ERROR. if (status == TextToSpeech.SUCCESS) { // Set preferred language to US english. // Note that a language may not be available, and the result will indicate this. intresult= mTts.setLanguage(Locale.CHINA); // Try this someday for some interesting results. // int result mTts.setLanguage(Locale.FRANCE); if (result == TextToSpeech.LANG_MISSING_DATA || result == TextToSpeech.LANG_NOT_SUPPORTED) { // Lanuage data is missing or the language is not supported. Log.e(TAG, "Language is not available."); IntentinstallIntent=newIntent(); installIntent.setAction(TextToSpeech.Engine.ACTION_INSTALL_TTS_DATA); startActivity(installIntent); } else { // Check the documentation for other possible result codes. // For example, the language may be available for the locale, // but not for the specified country and variant. // The TTS engine has been successfully initialized. // Allow the user to press the button for the app to speak again. Log.i(TAG,"初始化成功"); mTts.speak("初始化成功",TextToSpeech.QUEUE_FLUSH,null); } } else { // Initialization failed. Log.e(TAG, "Could not initialize TextToSpeech."); } } });
private GoogleMap mMap; // Create a LatLngBounds that includes Australia. privateLatLngBoundsAUSTRALIA=newLatLngBounds( newLatLng(-44, 113), newLatLng(-10, 154));
// Set the camera to the greatest possible zoom level that includes the // bounds mMap.moveCamera(CameraUpdateFactory.newLatLngBounds(AUSTRALIA, 0));
publicclassUserGlobalAppextendsApplication{ privatestatic UserGlobalApp application; privatefinalstaticStringdbName="HiJia"; //数据库名字 /** A flag to show how easily you can switch from standard SQLite to the encrypted SQLCipher. */ publicstaticfinalbooleanENCRYPTED=false; //改为true需要加入包compile 'net.zetetic:android-database-sqlcipher:3.5.1' private DaoSession daoSession; @Override publicvoidonCreate() { super.onCreate(); application=this; initDb(); }