Hi all,<br>   I&#39;m trying these days to port spicec into Android.But it&#39;s a rather TOUGH way to go because the structure of spicec and android are desperately inappropriate:the linux version of spicec is based on the X11,which is not available in Android,thus the UI of spicec should be rewritten from scratch...More troublesome is that the UI part and data part in current spicec is entangled in the hierarchical system in C++! So my plan is this: first split the spicec into two parts,data and UI,transform the data part into libspicec.so;then rewrite the UI part in JAVA. Besides, I should also tinker some problems caused by the Crippled NDK C++ support and the Lamed bionic c lib in android .<br>
   And now the first step is roughly done,hence the change of the spicec structure:<br>   From               <br><div id=":78">                                                            |--&gt;<span style="color: rgb(0, 0, 153);">playback thread</span><br>
                                                            |--&gt;<span style="color: rgb(0, 0, 153);">cursor thread</span><br>
spicec:<span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">spicec process</span>(application process)--&gt;<span style="color: rgb(0, 0, 153);">main thread-</span></span><span style="color: rgb(0, 0, 153);">&gt;</span>|--&gt;<u><span style="color: rgb(102, 0, 0);">record thread</span></u><br>

                                                            |--&gt;<span style="color: rgb(0, 0, 153);">inputs thread</span><br>                                                            |--&gt;<span style="color: rgb(0, 0, 153);">display thread</span><br>

To:<br>===========================&gt;                          <br style="color: rgb(0, 0, 153);"><span style="color: rgb(0, 0, 153);"></span><span style="color: rgb(0, 0, 153);">                       </span><span style="color: rgb(0, 0, 153);">  </span><span style="color: rgb(0, 0, 153);">|--&gt;<span style="color: rgb(0, 0, 0);">libspicec.so:</span>application thread--&gt;main thread------&gt;|<br>

                       </span><span style="color: rgb(0, 0, 153);">  </span><span style="color: rgb(0, 0, 153);">|                                                       |<br>                       </span><span style="color: rgb(0, 0, 153);">  </span><span style="color: rgb(0, 0, 153);">|              |&lt;--display thread&lt;--|                   |</span><br style="color: rgb(0, 0, 153);">

<span style="color: rgb(0, 0, 153);"><span style="color: rgb(0, 0, 0);">                       </span></span><span style="color: rgb(0, 0, 153);">  </span><span style="color: rgb(0, 0, 153);"><span style="color: rgb(0, 0, 0);"></span>|         |---&gt;|&lt;--cursor thread&lt;---|&lt;------------------|<br>

                         |         |    |</span><span style="color: rgb(0, 0, 153);">&lt;--</span><span style="color: rgb(0, 0, 153);">inputs thread&lt;---|<br></span><span style="color: rgb(0, 0, 153);"><span style="color: rgb(0, 0, 0);">spicec:</span><span style="color: rgb(255, 0, 0);">spicec process</span>---&gt;</span><span style="color: rgb(0, 0, 153);">|         |    </span><span style="color: rgb(0, 0, 153);">|</span><span style="color: rgb(0, 0, 153);">&lt;--playback</span><span style="color: rgb(0, 0, 153);"> thread&lt;-|<br>

                      
</span><span style="color: rgb(0, 0, 153);">  </span><span style="color: rgb(0, 0, 153);"><span style="color: rgb(0, 0, 0);">|         |</span></span><br><span style="color: rgb(0, 0, 153);">                       </span><span style="color: rgb(0, 0, 153);">  </span><span style="color: rgb(0, 0, 153);">|         |<br>

                       </span><span style="color: rgb(0, 0, 153);">  </span><span style="color: rgb(0, 0, 153);">|         |</span><span style="color: rgb(0, 0, 153);">&lt;---------------------------------------------|</span><span style="color: rgb(0, 0, 153);"></span><span style="color: rgb(0, 0, 153);"><br>


                       </span><span style="color: rgb(0, 0, 153);">  </span><span style="color: rgb(0, 0, 153);">|                                                        |</span><br><span style="color: rgb(0, 0, 153);">                       </span><span style="color: rgb(0, 0, 153);">  </span><span style="color: rgb(0, 0, 153);">|                                                        |   <br>

                       </span><span style="color: rgb(0, 0, 153);">  </span><span style="color: rgb(0, 0, 153);">|--&gt;<span style="color: rgb(0, 0, 0);">spicec:</span>platform thread------------------------------&gt;|<br>
<br><span style="color: rgb(0, 0, 0);">The hierarchical relationship has been unleashed with one thread(record channel) deleted and two new threads (app and platform)  created. The first as the &quot;data thread&quot;,the other as the &quot;work thread&quot; which is driven by the signals from the first thread as well as its sub threads and requested to do the UI-related work:<br>
<br></span></span><span style="color: rgb(51, 51, 255);">platform thread:</span>------------&gt;blocked and waiting:--&gt;job request-&lt;--------------|<br>
                                          |           |                         | <br>                                          ^           |                         |        <br>                                          |           |                         |<br>
<div id=":78">                                          |&lt;----------|-&lt;-|                     |<br>
                                                      |   |                     | <br>        platform thread over&lt;----------if(job==die)&lt;--| send req. blocked and waiting<br>                                             
|           ^ |                   |<br>                                              |           | |                   ^<br>                                              |           | |          _________|_________<br>
                                             
|           | |         | <span style="color: rgb(0, 0, 153);">app/plbk/cusor thd</span><br>
             |&lt;---job done----dojob()&lt;--else--|           | |-&gt;go on-&gt;| __________________<br>

             |                                            |           <br>

             |-------------------------------&gt;feed back--&gt;|</div><br><span style="color: rgb(0, 0, 153);"><span style="color: rgb(0, 0, 0);"></span></span><span style="color: rgb(0, 0, 153);"></span><span style="color: rgb(0, 0, 0);" class="f"><cite></cite></span><span style="color: rgb(0, 0, 153);"><br>
</span>So the next work is to expose the native JNI interface in platform thread to the UI written in Android SDK. I try to use the UI<br style="color: rgb(0, 0, 0);"><span style="color: rgb(0, 0, 0);">
frame of AndroidVNCViewer in  </span><span style="color: rgb(0, 0, 0);" class="f"><cite><a href="http://code.google.com/p/">code.google.com/p/</a><b>android</b>-<b>vnc</b>-viewer/</cite></span><span style="color: rgb(0, 0, 153);"><span style="color: rgb(0, 0, 0);"> ,then the work of platform thread will be replaced by UI but the msg communication to libspicec will be remained. That&#39;s the easiest way I can envisage except rewriting all parts in spicec from scratch. </span><br>
</span> It&#39;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 Ideas or help is appreciated.<br>   Best regards.<br style="color: rgb(0, 0, 0);"> </div><br>