XML With Xliff

by MaTriXy » Mon, 13 Apr 2009 22:06:01 GMT

Sponsored Links
I have seen projects with Xliff and wanted to know how exactly it's
i saw it on the lock screen and wanted to do it myself
so i took this line:
    <string name="lockpattern_recording_incorrect_too_short">Connect
at least
    <xliff:g id="number">%d</xliff:g> dots. Try again:</string>

But i get XML Parsing Error until i erase the entire xliff tag...
Thx for replying.


XML With Xliff

by Dianne Hackborn » Tue, 14 Apr 2009 03:49:00 GMT

 You probably need to declare the xliff namespace prior to its use.

Also the xliff stuff is only for localization; if you aren't giving your
strings to localizers (who use this information to determine how to handle
parts of the string), there is little reason for dealing with it.  Of course
if you think you may be doing this in the future, it is certainly not a
problem to pro-actively but the stuff in now.

Dianne Hackborn
Android framework engineer

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.


Sponsored Links

Other Threads

1. Weird bug when saving picture to file system!?

I am developing a photoshop application for the G1 where you can apply
different filters to your pictures stored in the pictures folder. So I
use a gallery and a cursor to select the picture I want to manipulate,
copy the picture to a bitmap so I can perform some filter operations
and afterwards save the new bitmap as a new file to the phone. So I
figured out that there are basically two options I have to save the
image. One is to use the MediaStore.Images.Media.insertImage()
methode, which generally would work, but I don't want a thumbnail to
be created. The second option, which I actually use, is to use an

import android.provider.MediaStore.Images.Media;
import android.content.ContentValues;
import java.io.OutputStream;

// Save the name and description of an image in a ContentValues map.
ContentValues values = new ContentValues(3);
values.put(Media.DISPLAY_NAME, "road_trip_1");
values.put(Media.DESCRIPTION, "Day 1, trip to Los Angeles");
values.put(Media.MIME_TYPE, "image/jpeg");

// Add a new record without the bitmap, but with the values just set.
// insert() returns the URI of the new record.
Uri uri = getContentResolver().insert(Media.EXTERNAL_CONTENT_URI,

// Now get a handle to the file for that record, and save the data
into it.
// Here, sourceBitmap is a Bitmap object representing the file to save
to the database.
try {
    OutputStream outStream = getContentResolver().openOutputStream
    sourceBitmap.compress(Bitmap.CompressFormat.JPEG, 50, outStream);
} catch (Exception e) {
    Log.e(TAG, "exception while writing image", e);

This snippet can also be found in the devguide (http://
and it saves the image to the phone's photo album. However, after the
image is stored on the phone, I cannot open the picture gallery in the
main menu again. An unknown exception is thrown. I'm still able to
access the gallery using the camera menu and it also works fine within
my application, but anyhow I have to reboot the phone to access the
gallery using the pictures shortcut in the main menu.

Using the insertImage() method I don't have this problem. The image
subsequently appears in the gallery after saving it and I can open the
gallery from the main menu but using the OutputStream, the gallery
crashes when I try to open it and it is not displayed immediatly in
the gallery of my application.

Does anybody know what I am doing wrong?


2. Lost focus on soft keyboard


I implemented a custom preference screen on which I have an EditText
control. The problem I have is when the user clicks on the EditText
control to enter data, the soft keyboard pops-up and the EditText
loses the focus which makes it impossible to enter data.
What do I do wrong?


3. Does anyone do XPath on Android?

4. Browser specs

5. Focus algorithm's default logic

6. Debit Cards Invalid on Android Market.

7. EditText with multiple listners