Hi, friends,<br> Thanks for your replies. It's definitely right till now I've been working a tougher way compared to spice-gtk.And actually I've considered to steer my way to the latter in fear of the troublesome and crippled C++ support in Android NDK:C is more "simple and safe" in Android than C++. But,AFAIK,there is no gtk port for Android yet. And the biggest obstacle is the <span style="color: rgb(0, 0, 153);">framework</span> of Android:in its design,all UI should be done in JAVA powered by SKIA libs.Therefore the port of UI libs(GTK,etc) will be choked by the I/O level because Android don't completely expose them at all!(I once managed to port Xfbdev onto it,but that's not commercially practical at all, it's just a geeky trick maybe,an app in Android SHOULD NOT do this.) Only the algorithm/data computing-related C/C++ libs are welcomed to be the JNI servants to JAVA UI apps in Android.<br>
You see, in such aspect, there is not too much diff between the C++ way and gtk way in the porting of UI part.<br> So for me the shining light of spicec-gtk is not in "GTK" but in "C". I dare not to say I'm clear about every nook in spicec at all. <span style="color: rgb(0, 0, 153);">My best hope</span> is that the IO in spicec shall be straight and succinct ,the inner graphic/sound computing(decompress,etc) shall have NO relation with upper UI libs at all, so I can pipe the <span style="color: rgb(255, 0, 0);">Finished image</span> flow into UI through JNI interfaces and direct the user input backward. (That's why I can borrow the UI from AndroidVNCViewer)<br>
<br> libspicec.so(do most jobs) <==<span style="color: rgb(255, 0, 0);">finished</span> images/audio>>===<<inputs==>spicec.java.ui(only UI)<br><br>Am I right? Is there any design that will frustrate this in spicec or spice-gtk?<br>
Regards.<br> <br> <br><div class="gmail_quote">On Fri, Mar 4, 2011 at 4:36 PM, Alon Levy <span dir="ltr"><<a href="mailto:alevy@redhat.com">alevy@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">On Fri, Mar 04, 2011 at 03:38:51PM +0800, Shuxiang Lim wrote:<br>
> Hi all,<br>
> I'm trying these days to port spicec into Android.But it's a rather TOUGH<br>
> way to go because the structure of spicec and android are desperately<br>
> inappropriate:the linux version of spicec is based on the X11,which is not<br>
> available in Android,thus the UI of spicec should be rewritten from<br>
> scratch...More troublesome is that the UI part and data part in current<br>
<br>
</div>Haven't looked at your proposal below yet, but did you check the spice-gtk<br>
work? maybe it is easier to start from that? are gtk libraries available on<br>
android? not talking about X. spice-gtk has objects for connection and channels<br>
that afaik don't do any output, that's separate from the actual widget that<br>
uses X. Also, gtk 3 has backends - did anyone do a backend for android?<br>
<br>
Since going forward we plan to ditch the spicec client, that would be really<br>
preffered. Now that I see what you have planned it sounds good, but better<br>
to use spice-gtk.<br>
<br>
of course that's not to say we won't love to see this working anyway :)<br>
<div><div></div><div class="h5"><br>
> spicec is entangled in the hierarchical system in C++! So my plan is this:<br>
> first split the spicec into two parts,data and UI,transform the data part<br>
> into libspicec.so;then rewrite the UI part in JAVA. Besides, I should also<br>
> tinker some problems caused by the Crippled NDK C++ support and the Lamed<br>
> bionic c lib in android .<br>
> And now the first step is roughly done,hence the change of the spicec<br>
> structure:<br>
> From<br>
> |-->playback<br>
> thread<br>
> |-->cursor<br>
> thread<br>
> spicec:spicec process(application process)-->main thread->|-->*record thread<br>
> *<br>
> |-->inputs<br>
> thread<br>
> |-->display<br>
> thread<br>
> To:<br>
> ===========================><br>
> |-->libspicec.so:application thread-->main<br>
> thread------>|<br>
> |<br>
> |<br>
> | |<--display thread<--|<br>
> |<br>
> | |--->|<--cursor<br>
> thread<---|<------------------|<br>
> | | |<--inputs thread<---|<br>
> spicec:spicec process--->| | |<--playback thread<-|<br>
> | |<br>
> | |<br>
> | |<br>
> <---------------------------------------------|<br>
> |<br>
> |<br>
> |<br>
> |<br>
> |-->spicec:platform<br>
> thread------------------------------>|<br>
><br>
> The hierarchical relationship has been unleashed with one thread(record<br>
> channel) deleted and two new threads (app and platform) created. The first<br>
> as the "data thread",the other as the "work thread" which is driven by the<br>
> signals from the first thread as well as its sub threads and requested to do<br>
> the UI-related work:<br>
><br>
> platform thread:------------>blocked and waiting:-->job<br>
> request-<--------------|<br>
> | |<br>
> |<br>
> ^ |<br>
> |<br>
> |<br>
> | |<br>
> |<----------|-<-|<br>
> |<br>
> | |<br>
> |<br>
> platform thread over<----------if(job==die)<--| send req. blocked<br>
> and waiting<br>
> | ^ |<br>
> |<br>
> | | |<br>
> ^<br>
> | | |<br>
> _________|_________<br>
> | | |<br>
> | app/plbk/cusor<br>
> thd<br>
> |<---job done----dojob()<--else--| | |->go on->|<br>
> __________________<br>
> | |<br>
> |------------------------------->feed back-->|<br>
><br>
><br>
> So the next work is to expose the native JNI interface in platform thread to<br>
> the UI written in Android SDK. I try to use the UI<br>
> frame of AndroidVNCViewer in<br>
> <a href="http://code.google.com/p/*android*-*vnc*-viewer/,then" target="_blank">code.google.com/p/*android*-*vnc*-viewer/,then</a> the work of platform<br>
> thread will be replaced by UI but the msg<br>
> communication to libspicec will be remained. That's the easiest way I can<br>
> envisage except rewriting all parts in spicec from scratch.<br>
> It's tough too, for I have poor experiance in Java...<br>
> Anyway, is there any other guy working on this? Is my way feasible??Any<br>
> Ideas or help is appreciated.<br>
<br>
</div></div>See above for ideas, don't read them as a criticism, I think this is fantastic<br>
what you've done so far. I remember someone posting "we are working on andriod<br>
in our spare time" post to spice-devel, please grep the archive.<br>
<font color="#888888"><br>
Alon<br>
</font><div><div></div><div class="h5"><br>
> Best regards.<br>
<br>
> _______________________________________________<br>
> Spice-devel mailing list<br>
> <a href="mailto:Spice-devel@lists.freedesktop.org">Spice-devel@lists.freedesktop.org</a><br>
> <a href="http://lists.freedesktop.org/mailman/listinfo/spice-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/spice-devel</a><br>
<br>
</div></div></blockquote></div><br>