views:

70

answers:

1

I am looking to create an app with plugin functionality. What I want is to allow a separate plugin "app" to provide me with the view, and take care of the updating of the view that I will use in my list adapter. Essentially, I want the separate app to take care of the bindView and newView methods of my adapter.

I am looking at RemoteViews, but I am not sure if that is exactly what I need, if it would work, or maybe it's what I have to use, since it would be cross-process.

Thanks for your help.

A: 
  1. RemoteViews is the only thing vaguely practical, because you are communicating between processes.

  2. Performance will be awful. Getting a ListView to behave quickly when everything is in one process takes a bit of work. Going across process boundaries for every row will either be very slow and memory intensive. This is why, for example, ContentProvider returns its full result set on a query(), to avoid dozens or hundreds of extra RPC calls.

I strongly suggest you reconsider your proposed architecture.

CommonsWare
Appreciate the feedback. Still looking for an alternate solution. I have thought about using reflection, but the cross process issue comes into play with security. I have also thought about a drawn out process of allowing the plugin to send an update via intent extras... something like: "imageview","img",new_img_resThe update would not be constant, only when requested by the plugin. I can pull their layout from their resources, but it may have other views that I am not expecting, and won't know how to update - I need a way for the plugin to explain what and how to update their layout views.
Tim H