[android-developers] Thread Loop

2013-01-29 Thread Diego N.
Good afternoon. I need from time to time do a check on a server, because I'm not using AsyncTask do not need no update from my view. Then I used a Handler that runs a thread from time to time, and this thread makes access to the server. In Honeycomb versions running down blz, already in top get

Re: [android-developers] Thread Loop

2013-01-29 Thread TreKing
On Tue, Jan 29, 2013 at 10:47 AM, Diego N. diegonunes.sist...@gmail.comwrote: Someone uses a different strategy to do this kind of task? AlarmManager. - TreKing

[android-developers] thread wait in android

2012-11-30 Thread Mr cool
i have one problem with handling the thread in android ,in my class i have to create one thread which create some UI after that thread finish i will get some value ,here i want to wait my Main Process until the thread complete it process but when i put wait() or notify in Main process thread

[android-developers] thread life

2012-11-30 Thread bob
If you create a Thread in an activity, does it generally live beyond a call to onPause? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this

Re: [android-developers] thread life

2012-11-30 Thread TreKing
On Fri, Nov 30, 2012 at 3:10 PM, bob b...@coolfone.comze.com wrote: If you create a Thread in an activity, does it generally live beyond a call to onPause? Why wouldn't it? Write a simple test and see for yourself.

Re: [android-developers] thread life

2012-11-30 Thread Kristopher Micinski
Yes, with the caveat that if you're doing this it might not be such a good idea. In Android, you might be better fit with creating a Service that mediates interaction between the Activity and the background thread, that or using an asynctask. kris On Fri, Nov 30, 2012 at 4:10 PM, bob

[android-developers] Thread

2012-09-07 Thread bob
What do you normally do on Android when you spawn a thread but the thread needs to access your Activity object? Do you typically pass the Activity object to your own constructor for the Thread? -- You received this message because you are subscribed to the Google Groups Android

Re: [android-developers] Thread

2012-09-07 Thread Larry Meadors
That's probably unsafe due to the lifecycle of activities. What's the use case? Larry On Fri, Sep 7, 2012 at 10:18 AM, bob b...@coolfone.comze.com wrote: What do you normally do on Android when you spawn a thread but the thread needs to access your Activity object? Do you typically pass

Re: [android-developers] Thread

2012-09-07 Thread bob
The use case is that the thread may want to call Activity.startActivity(). On Friday, September 7, 2012 11:35:50 AM UTC-5, Larry Meadors wrote: That's probably unsafe due to the lifecycle of activities. What's the use case? Larry On Fri, Sep 7, 2012 at 10:18 AM, bob

Re: [android-developers] Thread

2012-09-07 Thread Streets Of Boston
I'm guessing here a little bit, but is this what you want?: The user is in ActivityA. THe user clicks on a button or does something that requires a background Thread to do so processing. When the Thread is done (successfully), the thread needs to spawn/start ActivityB If so, use an AsyncTask.

Re: [android-developers] Thread

2012-09-07 Thread G. Blake Meike
Streets has it right: You probably want an AsyncTask. Using an AsyncTask has several important advantages: it uses a thread pool instead of creating and destroying threads and it also imposes order on things: tasks are executed in the order in which they are started. If you actually need a

[android-developers] Thread usage

2012-05-21 Thread sujit das
Hi all, I have created a thread using C++ under mediaserver application. When I am doing 'top' it is showing only cpu usage of all including 'mediaserver' but the newly created thread. can someone help how to get thread level cpu consumption for the newly created thread. -- You received this

[android-developers] Thread lifetime

2012-05-10 Thread RLScott
I have a working audio input app that uses the AudioRecord class for low-level PCM continuous audio processing. The audio stream is read and analyzed by a separate thread which repeatedly calls audioRecord.read to process the microphone audio one block at a time. Currently I create and start up

[android-developers] Thread started inside Service is killed?

2012-03-18 Thread svl
Hi, I created a service to read information from the serial port. I start a thread that actually does all the reading from the serial port. It runs for about 10 minutes and then it just stops. No exceptions thrown, no errors on logcat. The question is - how i can make sure that the thread keeps

Re: [android-developers] Thread started inside Service is killed?

2012-03-18 Thread TreKing
On Sun, Mar 18, 2012 at 3:44 PM, svl s.i.vladimi...@googlemail.com wrote: The question is - how i can make sure that the thread keeps running? You can't, not without any guarantee. Another solution was to do it with a handler and run the read from serial port every second. Unfortunately

[android-developers] Thread errors - AsyncTask Fatal Error

2012-01-16 Thread Vanadis International
Hello, We are using threads in our app, to ask for an xml and some remote images which load on our activity's listview. This activity also uses Tabs, so when we click on the tab buttons the info on the listview is updated. However, in certain occasions we get a Fatal Error: Asynctask #1 (or 2, or

[android-developers] thread calls UI

2011-12-18 Thread QuR
Hello, how can I access the UI from a other thread? My scenario: in my activity I create and start a thread, which continously has to do various tasks in the background. On some of this tasks it is necessary to update the UI. To do this I am calling a method in my Task. The problem no is, that

Re: [android-developers] thread calls UI

2011-12-18 Thread Raghav Sood
Try using runOnUiThread(). Thanks On Sun, Dec 18, 2011 at 5:08 PM, QuR rainer.qu...@gmx.de wrote: Hello, how can I access the UI from a other thread? My scenario: in my activity I create and start a thread, which continously has to do various tasks in the background. On some of this

[android-developers] thread caused app to forcedclosed?

2011-06-21 Thread Hitendrasinh Gohil
Hi, I am using thread in my activity class.when the activity is visible there isnt any problem.but when i navigate to previous screen and again going to this activity it causes forced close to my app.I have tried it by removing the thread then it works fine. Here is the code that i m calling

[android-developers] thread UI android Problems

2011-05-28 Thread ingy abbas
here is an important question about thread UI , and please need help in it http://stackoverflow.com/questions/6162756/thread-ui-problem-w-android-and-python-while-sending-data -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this

[android-developers] Re: android-developers Thread escape group

2011-05-02 Thread joseph bashkar
http://123maza.com/65/rings780/ http://123maza.com/65/rings780/ http://123maza.com/65/rings780/ http://123maza.com/65/rings780/ http://123maza.com/65/rings780/ On Apr 30, 1:54 am, a a harvey.a...@gmail.com wrote: I'm modifying the app Gallery3D on android. Meet an issue about thread.

[android-developers] android-developers Thread escape group

2011-04-30 Thread a a
I'm modifying the app Gallery3D on android. Meet an issue about thread. There have a DataSouce class which child class object hold the datasouce. MediaFeed is implement the Runnable, and also have a datasouce object. Now, a create a new thread in the datasouce which i wan't to get other data

Re: [android-developers] Thread and ProgressDialog

2011-04-08 Thread Samson Akisanya
new PersonnelLookUpTask();// start task..choose where u want to start it..oncreate or button click..ur choice. Input|Progress(u can ignore this parameter)|Output private class YourLookUpTask extends AsyncTaskString,Void ,ArrayListPersonnelObject{ @Override protected

[android-developers] Thread and ProgressDialog

2011-04-06 Thread SD315
Hello, i'm trying to do some work in a thread while showing a progress dialog until the work is done in the most simple possible way, so far i got this: // this is the current activity final ProgressDialog prgDialog = ProgressDialog.show(this, , Working..., true, false); new

Re: [android-developers] Thread and ProgressDialog

2011-04-06 Thread TreKing
On Tue, Apr 5, 2011 at 11:45 PM, SD315 sailer...@gmail.com wrote: Hello, i'm trying to do some work in a thread while showing a progress dialog until the work is done in the most simple possible way Use AsyncTask.

[android-developers] Thread + ImageView

2011-03-11 Thread Marc CG
Hi everybody! First, sorry if my English is bad, usually i don't use it... I am making a program witch have 2 java class. The first class is the main activity and the second is a thread. In the main activity i have some ImageViews, Textviews, CheckBox and RadioButtons. My Problem is that when i

Re: [android-developers] Thread + ImageView

2011-03-11 Thread Kostya Vasilyev
Marc, You cannot directly call UI functions in Android from a background thread: http://developer.android.com/guide/topics/fundamentals/processes-and-threads.html#Threads This explains how you can trigger UI updates: http://developer.android.com/resources/articles/timed-ui-updates.html --

Re: [android-developers] Thread Problem

2011-03-06 Thread Krishna Shetty
When I set *yourThread.instanceBooleanAttribute = false;* , the Thread may be sleeping. How to destroy a sleeping thread? thanks,Krishna -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to

Re: [android-developers] Thread Problem

2011-03-06 Thread Kostya Vasilyev
If the thread is sleep()-ing or wait()-ing, call notify() to wake it up. -- Kostya 07.03.2011 8:39, Krishna Shetty ?: When I set *yourThread.instanceBooleanAttribute = false;* , the Thread may be sleeping. How to destroy a sleeping thread? thanks,Krishna -- You received this message

[android-developers] Thread problems

2010-12-22 Thread Schoel
I have a function call from a large engine (which I can not change) which asks the user whether to save or not. Before this function call returns, I need an answer from the user whether to save. There is, as far as I know, no way to start an activity (or show a dialog) that synchronously returns

Re: [android-developers] Thread problems

2010-12-22 Thread Dianne Hackborn
startActivity() always runs the activity on the main thread. How about just looking at your app in the debugging to see where the threads are stuck? On Wed, Dec 22, 2010 at 7:11 AM, Schoel samuelsson.j...@gmail.com wrote: I have a function call from a large engine (which I can not change)

Re: [android-developers] Thread problems

2010-12-22 Thread Kostya Vasilyev
Just to add my two cents: You didn't include information on what s_Semaphore is, but I'm guessing it's from java.concurrent. Although I'm not too familiar with this package, the docs say this: http://download.oracle.com/javase/1.5.0/docs/api/java/util/concurrent/Semaphore.html Conceptually,

Re: [android-developers] Thread problems

2010-12-22 Thread Kostya Vasilyev
Oh, and one more thing: the activity not getting displayed likely has something to do with the thread going into a wait state right after you call startActivity. Since the call to queryUserSave comes from background thread (as I understand from your email), you could use runOnUIThread() with

Re: [android-developers] Thread problems

2010-12-22 Thread Mark Murphy
On Wed, Dec 22, 2010 at 10:11 AM, Schoel samuelsson.j...@gmail.com wrote: I have a function call from a large engine (which I can not change) which asks the user whether to save or not. Before this function call returns, I need an answer from the user whether to save. Ask the save/no-save

Re: [android-developers] Thread problems

2010-12-22 Thread Kostya Vasilyev
22.12.2010 22:15, Mark Murphy пишет: activity run on the main application thread (which you are blocking) Mark, I don't believe this is the case. In fact, Schoel wrote this in his original message: I've checked the thread id of the thread in which queryUserSave is called and the thread id

Re: [android-developers] Thread problems

2010-12-22 Thread Mark Murphy
Ah, sorry, I missed that. On Wed, Dec 22, 2010 at 2:58 PM, Kostya Vasilyev kmans...@gmail.com wrote: 22.12.2010 22:15, Mark Murphy пишет: activity run on the main application thread (which you are blocking) Mark, I don't believe this is the case. In fact, Schoel wrote this in his

[android-developers] Thread handling problem in Test Case

2010-11-15 Thread Mahabaleshwara Vasishta
Hi, I am implementing a testcase in Android Juint. I am facing problem in handling threads. After the successful running of a test case, it will not wait for child thread to be finished. e.g. If one testcase call some services in server. testcase will successfully send request to a server, but it

[android-developers] Thread handling problem in Test Case

2010-11-15 Thread Mahabaleshwara Vasishta
Hi, I am implementing a testcase in Android Juint. I am facing problem in handling threads. After the successful running of a test case, it will not wait for child thread to be finished. e.g. If one testcase call some services in server. testcase will successfully send request to a server, but it

[android-developers] Thread crash if activity is restarted

2010-10-01 Thread Saren Inden
Good day, I am writing a program that uses a UDP poort to listen to information send from a system. First the users sees an activity that allows them to close the activity or start it on a port they can select (edittext) The port is checked and if correct a new activity is launched. This display

[android-developers] Thread

2010-08-04 Thread perumal316
Hi All, I want to write a separate Thread within my application(to do Bluetooth connection). Any idea where I can find any reference for help to write Threads in Android? I searched online but could not find any proper reference. Thanks In Advance, Perumal -- You received this message because

Re: [android-developers] Thread

2010-08-04 Thread Alex Xin
Try AsyncTask On Wed, Aug 4, 2010 at 4:43 PM, perumal316 perumal...@gmail.com wrote: Hi All, I want to write a separate Thread within my application(to do Bluetooth connection). Any idea where I can find any reference for help to write Threads in Android? I searched online but could not

Re: [android-developers] Thread

2010-08-04 Thread Shawn Brown
I want to write a separate Thread within my application(to do Bluetooth connection). Any idea where I can find any reference for help to write Threads in Android? http://lmgtfy.com/?q=android+bluetooth+threads -- You received this message because you are subscribed to the Google Groups

RE: [android-developers] Thread Problem

2010-06-18 Thread Ted Neward
-developers@googlegroups.com [mailto:android- develop...@googlegroups.com] On Behalf Of brijesh Sent: Thursday, June 17, 2010 3:40 AM To: Android Developers Subject: [android-developers] Thread Problem Hello, I want to stop currently running thread but -Thread.stop() - Thread.destroy

Re: [android-developers] Thread Problem

2010-06-18 Thread Roc Boronat
Hi Brijesh, You have a *while(true){...}*, haven't you? Change it to: *while(instanceBooleanAttribute){...}* Now, you can stop the Thread process from another Class, simply calling *yourThread.instanceBooleanAttribute = false;*. Roc Boronat from Barcelona http://piposerver.com -- You

[android-developers] Thread Problem

2010-06-17 Thread brijesh
Hello, I want to stop currently running thread but -Thread.stop() - Thread.destroy() are DEPRECATED so can any one tell me how to stop the Thread -- Regards, Brijesh Masrani -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to

Re: [android-developers] Thread Problem

2010-06-17 Thread YuviDroid
In your thread you probably have something like: public void run () { while (true) { doSomeWork(); } } what you need is a boolean var that checks whether to continue 'doing work', or stop the thread. Like this: public void run () { while (!stopThread) { doSomeWork();

[android-developers] Thread in Service paused after screen is turned off?

2010-06-15 Thread Chi Zhang
Hi In my application I created a service in which I download stuff from the internet. The code of the service looks like this: class SomeService ... { @Override public void onCreate() { super.onCreate(); Thread t = new Thread(fetch); t.start(); } private

[android-developers] Thread and return values.

2010-05-30 Thread Robin van Leeuwen
I have a time consuming task i don't want to run in the main UI thread, so i do the following (pseudo-code): onClick: getresults() public void getresults(): TextView tv; String result = dolongjob() tv.setText(result); public void dolongjob():

Re: [android-developers] Thread and return values.

2010-05-30 Thread Mark Murphy
Robin van Leeuwen wrote: I have a time consuming task i don't want to run in the main UI thread, so i do the following (pseudo-code): onClick: getresults() public void getresults(): TextView tv; String result = dolongjob()

[android-developers] Thread always seem to throw exceptions although no erros in program

2010-04-11 Thread Bevor
Hello, I use a thread for drawing to the canvas. By coincidence I recognized that in the program always jumps into the finally part. After view.onDraw(c); is reached it steps back to synchronized (surfaceHolder) and then it steps into the finally part. This happens every time. This means to me

[android-developers] Thread execution hiccups on Motorola Droid

2010-04-09 Thread Andrew P. Lentvorski, Jr.
Occasionally I see thread execution hiccups on my Motorola Droid (currently running 2.1 but I saw it with 2.0.1, too). Normally my dummy thread (full tilt, foreground, not doing *anything* else) runs in about 5-6mS. However, I see a second hump around 13-14mS and stragglers anywhere out to 80mS

[android-developers] Thread lifecycle

2009-10-09 Thread Tiger
A new thread is created to do some time-consuming tasks and may take a long time, When the thread is active, the orientation of the phone is changed, the activity will be killed and re-created. How about the thread? Will the thread be destoryed?

[android-developers] Thread in multiple Activities .

2009-08-23 Thread rizwan
Hi All , I have started a thread from one Activity and then i have started another activit from parent Activity . Now my Parrent Activity is in pause state . but what will happen to thread that I have started from parrent . I belive it will continuenot going in sleep state any

[android-developers] Thread problem

2009-08-04 Thread Stefan
Hi, i use a Thread to make buttons visible for some seconds. If the location change, the buttons should gets visible for x seconds. My code: dialog = new Thread (new Runnable() { public void run() { try {

[android-developers] Thread CPU Usage Monitoring

2009-07-15 Thread dadical
Is there a way to monitor the resource usages of a Thread in Android? Resources of interest include CPU, memory, etc. It doesn't seem like ManagementFactory or ThreadMXBean are supported in Android. Are there other options? I would want to do this at runtime, from within a deployed

[android-developers] Thread

2009-06-26 Thread Mr.No
hello, how can i trigger in tread A a methode from thread B? the methode schould be than executetd in thread b. I want to manipulate within a thread A a View from Thread B, how can i do that? rgds mr.no --~--~-~--~~~---~--~~ You received this message because

[android-developers] thread question.

2009-06-09 Thread Gavin
Hi, I have a question. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email

[android-developers] thread questions.

2009-06-09 Thread Gavin
Hi, I have a question. If I have a list which has many url links. I want to download all url. How should I do? There are two solutions: 1) use only one thread to download all links. It needs a while loop. for example, int i=0; while(ilist.length){

[android-developers] Thread is stopping alone...

2009-06-07 Thread arnouf
Hi, My appWidget is working well. When it's installed and used by user, a Thread is launched to refresh view (like a flipper). Even if the screen is off, the thread is continuing...perfect for me... But after 3 minutes, it's stopped. Does it a VM restriction avoiding some bad development usage?

[android-developers] Thread stopping

2009-02-17 Thread Dilli
Hi all, I am developing a simple application with thread concept problem: In one thread i write { Thread.sleep(1) //10 sec sleep m_handler.post(my_runnable); // to post to run another runnable } before the thread wake up ( 10 sec) i stopped

[android-developers] Thread Allocation Question

2008-12-10 Thread beachy
Hi Guys, Just a quick general question someone might be able to answer off the top of their head, does the JVM scheduler use time slicing when allocating process to threads of the same priority? Cheers, Greg B. --~--~-~--~~~---~--~~ You received this message

[android-developers] Thread instead of Service, is it safe ?

2008-11-10 Thread Derek
Hi, I've an Activity A that starts a Thread T which download a file through HTTP. It works fine. If I close my Activity (back button) while downloading, it is destroyed (onDestroy called) but download Thread still continue and download is completed fine. For testing purposes I've moved my

[android-developers] Thread safety of using a Handler

2008-06-19 Thread Gavin Bong
Consider the following:- 0Handler mHandler = ... 1Foo foo = new Foo( a ); 2Message.obtain( mHandler, 1, foo ).sendToTarget(); Many threads will be calling line #2 using the shared Handler. Is this thread safe ? Regards, Gavin --~--~-~--~~~---~--~~