Locale and TTS problem

by jax » Sun, 01 Nov 2009 12:37:05 GMT


Sponsored Links
 I have set my emulator to use US English.

When I run Locale.getDefault()

There is no country code!
The language code is set to "en_us"

When I set a varaible "audioLocale" using

audioLocale= Locale.US

The country code is "US"
The language code is "en"

When I run

mTts.isLanguageAvailable(audioLocale) == TextToSpeech.LANG_AVAILABLE

I get

-2 == 0

Why is mTts reporting that the US language is not available?


--



Other Threads

1. Dialog with backgroundDimAmount=0 may cause black screen! (Bug?)

Hello, all!
For some reason, I need a dialog with "backgroundDimAmount=0".
But I found that if  I start a "new" emulator, show my dialog will get
a black screen, and never come back even press BACK key. This will
happen every time I test on 1.6 donut version.
To solve it is to show any dialog without this setting first in my
activity or not, and then my dialog will work well.
I could not figure out why this is happened. Is that a bug?

Anyone could test using the following sample code.

public class mydialog extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        //showDialog(0); // backgroundDimAmount default setting
        showDialog(1);  // backgroundDimAmount=0

    }

    @Override
        protected Dialog onCreateDialog(int id) {
        if(id==0)
        {
                Dialog dialog = new Dialog(this);
                dialog.setContentView(R.layout.custom_dialog);
                dialog.setTitle("Custom Dialog");

                TextView text = (TextView) dialog.findViewById(R.id.text);
                text.setText("Hello, this is a custom dialog!");
                ImageView image = (ImageView) dialog.findViewById(R.id.image);
                image.setImageResource(R.drawable.icon);

                return dialog;
        }
        else
        {
                Dialog dialog = new Dialog(this,R.style.Theme_doNotDim);

                dialog.setContentView(R.layout.custom_dialog);
                dialog.setTitle("Custom Dialog with doNotDim");

                TextView text = (TextView) dialog.findViewById(R.id.text);
                text.setText("Hello, this is a custom dialog!");
                ImageView image = (ImageView) dialog.findViewById(R.id.image);
                image.setImageResource(R.drawable.icon);

                return dialog;
        }
    }
}

# res/layout/custom_dialog.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/
android"
              android:id="@+id/layout_root"
              android:orientation="horizontal"
              android:layout_width="fill_parent"
              android:layout_height="fill_parent"
              android:padding="10dp">
    <ImageView android:id="@+id/image"
               android:layout_width="wrap_content"
               android:layout_height="fill_parent"
               android:layout_marginRight="10dp"
               />
    <TextView android:id="@+id/text"
              android:layout_width="wrap_content"
              android:layout_height="fill_parent"
              android:textColor="#FFF"
              />
</LinearLayout>

# res/value/styles.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="Theme.doNotDim" parent="@android:style/Theme.Dialog">
        <item name="android:backgroundDimAmount">0</item>
    </style>
</resources>

2. SQLite encryption of file storage

I've been thinking of writing a "secret storage" system for Android --
does such a thing already exist?  I've used Zetetic's open-source
Strip tool for many years on PalmOS, and found it handy, so I'd like
to have something like that on Android.

Ideally, I would use SQLite databases to store the info, but it seems
that there's no way to encrypt those database files.  This is a huge
security hole.  SD card storage of course can be compromised, but even
on-device storage is available to a sophisticated attacker who
actually has the physical phone.

I see that a ticket was opened about this in Feb 2008, but apparently
closed shortly thereafter with a somewhat short-sighted analysis of
the security problem.  Would it be futile to re-open such a ticket?
Does anyone else have a solution to this?

3. what is a suitable upper limit for application size?

4. pxafb

5. Nexus One - Please make available as DEV phone, so non US dev's can buy/support apps

6. Active Activity?

7. OpenGL; GL11.glDrawTexiOES does not seem to work for Nexus One