The UK Release and Internationalization

by cyntacks » Wed, 29 Oct 2008 19:07:17 GMT


Sponsored Links
 Hi,

Last I read here on the board Android did not yet fully support
internationalization (even though we have the directories for
different languages, etc).

1) Is this true?
2) Will the normal Java syntax involving Locales be a valid work
around?

I ask because our application needs to know whether to use metric
units or not. Just wondering what the best way to determine this may
be on Android for the UK release today.

Thanks for your help,

Kevin
--~--~---------~--~----~------------~-------~--~----~



The UK Release and Internationalization

by cyntacks » Thu, 30 Oct 2008 04:11:31 GMT


 Hi Everyone,

I just wanted to give this a bump.

Has anyone successfully "internationalized" their application? For
example, I want to determine what region the user is in (UK or US) so
I can provide English or Metric units on the backend for calculations.
Is this as simple as using Java's "locale", or does Android provide
another type of support on top that I should be implementing?

The API says this is "coming soon": 
 http://code.google.com/android/devel/resources-i18n.html #i18n

I realize I can provide different languages using the values-en,
values-xx, etc. But what about determining that region in the java
code?

Thanks for your help,

Kevin




--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


The UK Release and Internationalization

by qvark » Thu, 30 Oct 2008 22:17:21 GMT


 I don't think the API is ready yet according to their roadmap:
 http://source.android.com/roadmap 

Q4 2008

Localization

The UI and Application Framework for the Android 1.0 platform
primarily targets English-speaking regions. To enable handset
manufacturers to deploy devices in non-English-speaking countries, we
will support the following localizations:

    * Strings localized into various languages.
          o Q4 2008: German
          o Q1 2009: French, Italian, es_es, zh_TW, Ja, NL, CZ
    * UI modifications (tabs, menus, homepage shortcuts, etc.) to
support non-English languages.
    * New date and numeric formats.





--~--~---------~--~----~------------~-------~--~----~



The UK Release and Internationalization

by cyntacks » Fri, 31 Oct 2008 01:37:54 GMT


 Hi qvark,

Thanks for the link, I hadn't seen the Roadmap yet.

That's a bummer for us, but it does say q4, so hopefully the change
will be right around the corner.

Thanks again,

Kevin





--~--~---------~--~----~------------~-------~--~----~



The UK Release and Internationalization

by Al Sutton » Fri, 31 Oct 2008 02:46:09 GMT


 evin,

After doing some poking around the Android browser on the UK phone
identifies itself with an en-gb localisation, so maybe you can already
use Locale.getDefault() to see whats what.

Al.

cyntacks wrote:


--
Al Sutton

W: www.alsutton.com
B: alsutton.wordpress.com
T: twitter.com/alsutton


--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Progress Dialog: how to pass context or adapter to the thread

I am trying to display a progress bar while download data and store it
in my database.
My problem is that I need to pass the database adapter or the context
to the thread.

This is what I have tried.

public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        try{
        adapter = dbInit();
        button = (Button)findViewById(R.id.progressDialog);
        button.setOnClickListener(new OnClickListener(){
          public void onClick(View v){
               showDialog(PROGRESS_DIALOG);
          }
        });
        }finally{
          adapter.close();
        }
    }

    protected Dialog onCreateDialog(int id){
     switch(id){
     case PROGRESS_DIALOG:
          progressDialog = new ProgressDialog(ProgressBarSample.this);
          progressDialog.setMessage("loading message...");

          thread = new MyThread(handler);
          thread.start();

          return progressDialog;
     default:
          return null;
     }
    }

    private MyDbAdapter dbInit(){
     adapter = new MyDbAdapter(this);
     adapter.open();
     adapter.deleteMyTable();
     adapter.createMyTable();
     return adapter;
    }

    final Handler handler = new Handler(){
     public void handleMessage(Message msg){
          int status = msg.getData().getInt("status");
                if (status >= 0){
               progressDialog.setMessage("Downloading data part2...");
               dismissDialog(PROGRESS_DIALOG);
          }
     }

    };

    public class MyThread extends Thread{
     private Handler myHandler;
     int downloadStatus;
     final String dUrl = MY_XML_URL;

     public MyThread(Handler handler){
          this.myHandler = handler;
          downloadStatus = -1;
     }

     public void run(){
          Message msg = myHandler.obtainMessage();
          Bundle b = new Bundle();
          downloadStatus = downloadTables(dUrl);
               b.putInt("status", downloadStatus);
               msg.setData(b);
               myHandler.sendMessage(msg);
     }

        public int downloadTables(String xmlUrl){
          int downloadStatus = 0;
          try{
               URL url = new URL(xmlUrl);
               SAXParserFactory factory = SAXParserFactory.newInstance
();
               SAXParser parser = factory.newSAXParser();
               XMLReader reader = parser.getXMLReader();
               MyHandler handler = new MyHandler(adapter);
               reader.setContentHandler(handler);
               reader.parse(new InputSource(url.openStream()));
          }catch(Exception e){
               Log.e("Error: ", "" + e.getMessage());
               System.exit(0);
          }finally{
               downloadStatus = 1;
          }
          return downloadStatus;
        }

    }
}

but when I run this i get the following error.


I/ActivityManager(   57): Starting activity: Intent
{ act=android.intent.action.MAIN cat=
[android.intent.category.LAUNCHER] flg=0x10200000
cmp=com.achie.test/.ProgressBarSample }
I/ActivityManager(   57): Start proc com.achie.test for activity
com.achie.test/.ProgressBarSample: pid=548 uid=10024 gids={3003}
D/ddm-heap(  548): Got feature list request
I/ActivityManager(   57): Displayed activity
com.achie.test/.ProgressBarSample: 1235 ms (total 1235 ms)
E/Error:  (  548): database not open
I/AndroidRuntime(  548): AndroidRuntime onExit calling exit(0)
I/WindowManager(   57): WIN DEATH: Window{43be4df0 com.achie.test/
com.achie.test.ProgressBarSample paused=false}
I/ActivityManager(   57): Process com.achie.test (pid 548) has died.
I/WindowManager(   57): WIN DEATH: Window{43c94128 Downloading Data
paused=false}
W/UsageStats(   57): Unexpected resume of com.android.launcher while
already resumed in com.achie.test
W/InputManagerService(   57): Got RemoteException sending setActive
(false) notification to pid 548 uid 10024

It looks like I cannot pass the adapter from the thread as I am doing
as its running as a separate thread and have to use handler to pass
it. Can anyone let me know how to do this.

thank you,

-- 

2. Media Player and FileDescriptor Issues

I'm attempting to play files located in a Sounds directory located in
my assets directory.

The code below is what im using in my Listener method of my activity

 try {
    AssetManager mgr = getAssets();
//Lets me get file as i i'm using the Tag object of a radio button to
store the filename
    AssetFileDescriptor mgrFileDesc = mgr.openFd("Sounds/" +
grp.getChildAt(chkId).getTag().toString());

  FileDescriptor fd = mgrFileDesc.getFileDescriptor();
 MediaPlayer mPlay = new MediaPlayer();
 mPlay.setDataSource(fd);
Toast.makeText(getBaseContext(),fd.toString() ,
Toast.LENGTH_SHORT).show();
mPlay.prepare();
mPlay.start();
                        } catch (IOException e) {
                                        // TODO Auto-generated catch block
                                //      e.printStackTrace();
                                        
Toast.makeText(getBaseContext(),"ERROR:"+ e.getCause() ,
Toast.LENGTH_SHORT).show();
                                }

The first Toast message shows me that i have a FileDescriptor

The IOException error is telling me that the e.getCause() is null.
If i change the e.getMessage() it tells me    "prepare failed. status
0x1"

I'm lost..

What im attempting to achieve overall is to create a dynamic list of
radio buttons, that play a file.   So i used the assetManager to work
with the files in my assets folder, and was able to write the filename
to the radioButtons Tag object, and then reference that in my listener
method.

If someone can point me in the right direction, to either debug this,
or approach my task in a different manner.

Thanks in advance

-- 

3. SIGSEGV 11 OpenGL - Only on Droid, not 2.0 Emulator

4. Replace incall screnn

5. Problems playing MediaPlayer using FileDescriptor

6. Using styles from application

7. Trouble with Basic SQLite Methods, Can't Open Database