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?

Thanks,

James


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



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. Limitations of the MapView and MapActivity design

I was surprised to see a couple major shortcomings in the design of MapView
and MapActivity.

First, MapView requires itself to be hosted in a MapActivity. According to
the documentation,

A MapView can only be constructed (or inflated) by a
MapActivity<http://code.google.com/android/add-ons/google-apis/reference/com/google/android/maps/MapActivity.html>.


This seems pretty weak considering that WebView is at least, if not more
complicated, than MapView and does not have such a requirement. This
limitation means that the application developer is locked into a particular
base class when hosting a map view. Consider the thought experiment about
what would happen if other controls followed the same pattern. If WebView
required itself to be hosted in a WebActivity and ImageView required itself
to be hosted in an ImageActivity, it would not be possible to construct a
user interface that showed a map, a web page, and an image in the same view.
There are other engineering solutions to solve the problem of sharing
various network and file system threads without requiring a specific base
class.

Second, even more limiting is that there can only be a single MapActivity in
the process. According to the documentation,

Only one MapActivity is supported per process. Multiple MapActivities


This means I am forced in my app to choose a single place where a map can be
displayed. Unfortunately, there are multiple places in the app where it is
interesting to show a map. The iphone version of the app shows maps in
multiple places, but this is not possible with the android version because
of this limitation.

Has anybody else had to make compromises to their application because of
these limitations? Is the Google engineer who owns this API aware of
the limitations? Are there any proposals to fix it? Is the best workaround
simply to use a WebView that uses the javascript API? Thanks.

-Jon

--

2. SAX parsing problem..

Hi friends,

              I am new to android. Can any one send me the example on sax
parsing. I got the code  but it's clumsy. So please send me the sample on
Sax parsing






Regards,
Abhilash

-- 

3. How to disable back button..?

4. Portrait and Landscape in Emulator

5. What is the structure of the Android PackageManagerService?

6. Update --- WTI: Silicon Case untuk Nexian Journey

7. oot: Android 3kg