Importing a layout xml file from a remote server

by kingkung » Fri, 27 Jun 2008 01:10:34 GMT

Sponsored Links
 Is this possible?  Can I import an android layout xml file from a
remote server, and use it within the application (without writing my
own parser)?  If not, is there an easy way to parse out a remote xml
file and create a layout on the fly?




Importing a layout xml file from a remote server

by hackbod » Fri, 27 Jun 2008 08:59:01 GMT

 Currently view inflation only works on compiled XML resources.  Being
able to operate on any generic XML file is in the design, but won't be
available for 1.0.  Even if it was, I suspect the performance
difference between the two would be pretty disturbing.  Once the code
is open-source, I think a good project for someone would be to take
the current aapt code, and add an option so it can compile a single
XML file against the resources of an application (and system).  Then
your server could generate the XML file, compile it to binary, serve
that to the application, and let the app load its layout efficiently
from that.


Sponsored Links

Other Threads

1. could not resolve android.view.View$OnClickListener

Hi all,

I tried out the tutorial code of different layout.

When I have :
import android.view.View$OnClickListener;

Eclipse gives me an error msg of "The import android.view.View
$OnClickListener" cannot be resolved.

I believe Google had overridden the way library is imported using "$".
So, eclipse is not picking up the android.jar and reading it

But I have the "preferences" > "android" > SDK location pointing to
the right dir.

Anything I am missing?

Thank a lot!

Jimmy Chu


2. why is bitmap .getWidth() and .getHeight() returning -1

im having trouble with why these values are being returned to me.

the bitmap is being loaded using BitmapFactory.decodeResource() and
the image loaded displays correctly when i draw it onto a canvas.

however, the only quirk i've encountered so far is that i cannot
retrieve the bitmap width/height.

i've even moved the loading of the images from the constructor into
the onSizeChanged() event of the view just to make sure that the
unloaded view isnt affecting the results.

any insights to this would be appreciated.


3. NullPointerException error while displaying database contents.

4. Form View Example!!

5. Device Chooser in Eclipse with ADT installed not working, no way to test with device

6. option of setWallpaper()

7. MediaRecorder.VideoSource and MediaRecorder.VideoEncoder classes can't be resolved.