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