<div dir="ltr">Got it :D<br><br><div class="gmail_quote">On Mon, Aug 9, 2010 at 2:26 PM, Nordin <span dir="ltr">&lt;<a href="mailto:bouchtaoui@gmail.com">bouchtaoui@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
No problem, I&#39;m glad I can help you.<br>
You can ask me anytime, but than I assume you tried out your code before<br>
or there is something you just don&#39;t understand, no matter how often you<br>
read an article about it. (I mean I don&#39;t like questions like how to add<br>
two variables for example).<br>
<br>
So don&#39;t hesitate to post a question ;-)<br>
<div><div></div><div class="h5"><br>
<br>
<br>
On 9-8-2010 16:13, H. Mohammed Amine wrote:<br>
&gt; Dude, you&#39;re great ! thnx a lot ! i hope you would answer some of my<br>
&gt; questions next time cuz i&#39;m a kind of n00bs :s<br>
&gt;<br>
&gt; On Mon, Aug 9, 2010 at 1:55 PM, Nordin&lt;<a href="mailto:bouchtaoui@gmail.com">bouchtaoui@gmail.com</a>&gt;  wrote:<br>
&gt;<br>
&gt;<br>
&gt;&gt; On 9-8-2010 15:27, H. Mohammed Amine wrote:<br>
&gt;&gt;<br>
&gt;&gt;&gt; great ! and what about using the threads ?<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt; Don&#39;t use threads for now, it&#39;s a horrible thing. Threads make things<br>
&gt;&gt; more complicated than needed. It depends on what you want.<br>
&gt;&gt; As far as my experience goes (on Windows with C++ and C#), you can only<br>
&gt;&gt; access the user interface components like buttons and text fields from<br>
&gt;&gt; the main thread. That&#39;s the thread your application is started from. If<br>
&gt;&gt; you create another thread to do some calculation, than you can&#39;t just<br>
&gt;&gt; access the graphic object to do the drawings. I&#39;m sure there are tricks<br>
&gt;&gt; to achieve that, but than you&#39;ll end up with lots of readings and<br>
&gt;&gt; experimenting to have good control over it.<br>
&gt;&gt;<br>
&gt;&gt; Threads are useful if you have to wait a long time for a connection or<br>
&gt;&gt; data (from a serial port or from a tcp connection), in that case,<br>
&gt;&gt; instead of waiting all the time (which makes your UI not responding),<br>
&gt;&gt; it&#39;s better to do that in a separate thread and let the thread do the<br>
&gt;&gt; waiting. If something happens in that thread, you can inform the main<br>
&gt;&gt; thread with a message, signal or whatever construction they use in Java.<br>
&gt;&gt; In windows (using Visual C++) we have something like PostMessage()<br>
&gt;&gt; function call, to send a message from one thread to another. In C# I<br>
&gt;&gt; don&#39;t remember how to do that, but it&#39;s an ugly way to do that.<br>
&gt;&gt;<br>
&gt;&gt; So my advise is, don&#39;t use it for something like an animation, timers<br>
&gt;&gt; are much better and very simple to use comparing to threads.<br>
&gt;&gt; If you want to play with threads, we can do that next time together ;-).<br>
&gt;&gt; I want to write a simple chat app for Android (just for experimenting),<br>
&gt;&gt; we will use a thread for that (socket connection handling). If you can&#39;t<br>
&gt;&gt; wait, there is enough opensource code that works with threads in Java :).<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;&gt; On Mon, Aug 9, 2010 at 1:24 PM, Nordin&lt;<a href="mailto:bouchtaoui@gmail.com">bouchtaoui@gmail.com</a>&gt;   wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; No problem,<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; This construction is used a lot, because that keeps the user interface<br>
&gt;&gt;&gt;&gt; responsive.<br>
&gt;&gt;&gt;&gt; Imagine your animation is repeating forever in a loop, you want to be<br>
&gt;&gt;&gt;&gt; able to stop with a stop button.<br>
&gt;&gt;&gt;&gt; But because you&#39;re app is caught in a loop, you&#39;re unable to press stop,<br>
&gt;&gt;&gt;&gt; this makes your app is not responding and eats a lot of CPU resource.<br>
&gt;&gt;&gt;&gt; I don&#39;t know if you&#39;ve seen a windows app freezing, well, that&#39;s the<br>
&gt;&gt;&gt;&gt; same result you&#39;ll get with your application.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Using a timer your app can respond on a stop button and everything is<br>
&gt;&gt;&gt;&gt; fine ;-)<br>
&gt;&gt;&gt;&gt; I hope you understand :)<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; On 9-8-2010 14:48, H. Mohammed Amine wrote:<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; nice idea ! thnx :) i&#39;ll try this<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; On Mon, Aug 9, 2010 at 12:16 PM, Nordin&lt;<a href="mailto:bouchtaoui@gmail.com">bouchtaoui@gmail.com</a>&gt;    wrote:<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; On 9-8-2010 14:05, H. Mohammed Amine wrote:<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; No, No Compil Error i&#39;m okeh till now !! i&#39;m looking for how to anime<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; it<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; ! i<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; think something called timer<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; thnx :)<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; Yes, a timer would be the most logical way ;-)<br>
&gt;&gt;&gt;&gt;&gt;&gt; I think you first try it by every time pushing on a button (manually)<br>
&gt;&gt;&gt;&gt;&gt;&gt; and see if your animation does what it should do.<br>
&gt;&gt;&gt;&gt;&gt;&gt; When everything goes fine, you can replace your button by a timer,<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt; that<br>
&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; triggers every 200 ms. In the timer handler you do the calculation and<br>
&gt;&gt;&gt;&gt;&gt;&gt; than update your drawings.<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; On Fri, Aug 6, 2010 at 3:57 PM, Gmail account&lt;<a href="mailto:allali.ayoub@gmail.com">allali.ayoub@gmail.com</a><br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; wrote:<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; @H Mohammed Amine ,*<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; *what is wrong with your code ?<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; did you have any compilation error ?<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; AYYOUB Allali<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; JEE junior developer<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; +(212) 644 67 79 24<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; --<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Ubuntu-ma mailing list<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; <a href="mailto:Ubuntu-ma@lists.ubuntu.com">Ubuntu-ma@lists.ubuntu.com</a><br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Modify settings or unsubscribe at:<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; <a href="https://lists.ubuntu.com/mailman/listinfo/ubuntu-ma" target="_blank">https://lists.ubuntu.com/mailman/listinfo/ubuntu-ma</a><br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; --<br>
&gt;&gt;&gt;&gt;&gt;&gt; Ubuntu-ma mailing list<br>
&gt;&gt;&gt;&gt;&gt;&gt; <a href="mailto:Ubuntu-ma@lists.ubuntu.com">Ubuntu-ma@lists.ubuntu.com</a><br>
&gt;&gt;&gt;&gt;&gt;&gt; Modify settings or unsubscribe at:<br>
&gt;&gt;&gt;&gt;&gt;&gt; <a href="https://lists.ubuntu.com/mailman/listinfo/ubuntu-ma" target="_blank">https://lists.ubuntu.com/mailman/listinfo/ubuntu-ma</a><br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; --<br>
&gt;&gt;&gt;&gt; Ubuntu-ma mailing list<br>
&gt;&gt;&gt;&gt; <a href="mailto:Ubuntu-ma@lists.ubuntu.com">Ubuntu-ma@lists.ubuntu.com</a><br>
&gt;&gt;&gt;&gt; Modify settings or unsubscribe at:<br>
&gt;&gt;&gt;&gt; <a href="https://lists.ubuntu.com/mailman/listinfo/ubuntu-ma" target="_blank">https://lists.ubuntu.com/mailman/listinfo/ubuntu-ma</a><br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; Ubuntu-ma mailing list<br>
&gt;&gt; <a href="mailto:Ubuntu-ma@lists.ubuntu.com">Ubuntu-ma@lists.ubuntu.com</a><br>
&gt;&gt; Modify settings or unsubscribe at:<br>
&gt;&gt; <a href="https://lists.ubuntu.com/mailman/listinfo/ubuntu-ma" target="_blank">https://lists.ubuntu.com/mailman/listinfo/ubuntu-ma</a><br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
<br>
<br>
--<br>
Ubuntu-ma mailing list<br>
<a href="mailto:Ubuntu-ma@lists.ubuntu.com">Ubuntu-ma@lists.ubuntu.com</a><br>
Modify settings or unsubscribe at: <a href="https://lists.ubuntu.com/mailman/listinfo/ubuntu-ma" target="_blank">https://lists.ubuntu.com/mailman/listinfo/ubuntu-ma</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr"><b>H Mohammed Amine</b><br><br>
<blockquote style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><font size="1"><span style="font-family: times new roman,serif;">Ce Qui Ne Nous Tue Pas Nous Rends Plus Fort !</span></font></blockquote>
</div><br>
</div>