Android :: Service.startForeground() Messes With Scheduling?
Apr 8, 2010
I updated my app to use the "new" startForeground() method of Service. Now beta testers are complaining about the foreground app going slow. Is that a coincidence or does startForeground() mess with the thread's prio or does anything else but what is written below? Just as an additional information the background activity does some syncing, reports the progress to the notification using remote views and as it is not latency dependent I use (and did that before already) this: Process.setThreadPriority(Process.THREAD_PRIORITY_LOWEST);
Should I use another Priority? And if it makes any difference, how does that play with Android 1.5 devices?
View 13 Replies
Nov 20, 2009
I am running a background Android Service as VoIP Framework which provides different VoIP services to different Android applications, (VoIP call, Video Call, etc). The service establishes a network connection with the Server(Service Provider) and does some initial handshake before it can start providing service to the Android applications, that's why though of starting the service on BOOT_COMPLETED event.
The problem is when the service gets started on BOOT_COMPLETED event, before even it finishes the initial network connection with server and handshaking, it gets killed by the system. I have tried using setForeground which improves the behavior a bit but still gets killed mid-way. I am working with old version 1.5 r3 of SDK and hence, cannot use "startForeground". Is there a way out or another alternative available with SDK 1.5 r3?
View 12 Replies
View Related
Mar 7, 2010
In the 1.6 API, is there a way to ensure that the onStart() method of a Service is called after the service is killed due to memory pressure?
View 4 Replies
View Related
Mar 7, 2010
In the 1.6 API, is there a way to ensure that the onStart() method of a Service is called after the service is killed due to memory pressure? From the logs, it seems that the "process" that the service belongs to is restarted, but the service itself is not. I have placed a Log.d() call in the onStart() method, and this is not reached.
View 1 Replies
View Related
Aug 9, 2010
This is the second time this has happened to me now. I changed the starting activity of my app, and put out an update, and now the icon on people's phone will not open my app. The only way they can open it is through the downloads section of their Android Market app, or if they uninstall and reinstall the app, causing them to lose ALL their data. I have no problem with updates on my N1, but every other Android phone has a problem with this. Why?
View 1 Replies
View Related
Feb 8, 2010
I've got a button with italics text in an app widget and the last letter gets clipped when I set the width to wrap_content. It doesn't get clipped with fill_parent, but then that messes up the selection order.
Things I've tried: - space after my text - seems to get trimmed off automatically - layout_marginRight - paddingRight
Anybody know what's going on here? Is this a bug?
View 2 Replies
View Related
May 24, 2010
It seems that on the Incredible the startForeground() call is non- functional, causing my process to be put into the background scheduler class even though it has an active ongoing notification. I'm calling it the same as on other 2.x devices (through reflection as suggested by Diane for backward-compatibility), and this works fine on the Droid, with the same OS level (2.1-update1). I can see in the debugger that it gets all the way to ActivityManagerNative.setServiceForeground() with the notification param being non-null, so it's got to be in the ActivityManager or below.
The really telling thing is that the stock music player acts the same way. When I'm playing a song and go to the home screen the com.htc.music process goes into the bg class, even though its notification is still active. This is a real problem for us, as it denies us the CPU we need to play back music in some cases without stuttering. Any ideas on whether this is getting fixed, and how I might work around it?
View 7 Replies
View Related
Oct 9, 2010
Hi, I have a "Remote Service", which I am starting at Bootup of the emulator. I want my service to keep running as a foreground service. For this, I am calling startForeground() from my service's onStartCommand(). I don't want any notifcation from the service. But startForeground() needs a notification object as its second parameter. How can I set my service as a foreground service without using any notification.
View 2 Replies
View Related
Nov 26, 2009
I have a couple of services in my application which need to be marked as foreground to prevent them from being killed unnecessarily. Currently I am building my application with the 2.0 SDK but I have android:minSdkVersion="3" android:targetSdkVersion="5" in my manifest file so that I can support 1.5, 1.6 or 2.0 devices. I am currently using only the 1.5 APIs so that my application will run correctly on the 1.5 devices.
2.0 introduced a nicer startForground method that combines setting the foreground flag and starting a notification which can be used to control the service. The 2.0 documentation says that startForground replaces setForeground, and that due to the fact that many applications were mistakenly using setForeground without a notification that could be used to control and close down the service, that the older setForeground method had been changed so it no longer does anything on 2.0. I tried using the newer 2.0 interface but it caused an exception for phones running 1.5 or 1.6. So I am still using the older setForeground interface and calling notify separately. But it appears that since I am building with the 2.0 SDK the older interface isn't really preventing my services from being killed.
View 4 Replies
View Related
Nov 15, 2009
I've got a question as I don't have an Android 2.0 device to test on and this particular aspect seems untestable in the emulator. I've got a service that needs to be run as a foreground service. I have a notification that stops it etc, so I have no problem using startForeground instead of setForeground. However, I'd like to have 1 version of my app that works across all platforms... Is this possible? If my app is compiled with Android 1.5 and uses setForeground, then will that command actually work on an Android 2.0 device, or does it not matter which sdk was used to compile? I've tried compiling with 2.0, and surrounding the call to startForeground with a try/catch, but that throws a VerifyError when the service is started, when run on a 1.5/6 device since startForeground doesn't exist there. Can I catch and ignore the VerifyError somehow and make it work that way?
View 5 Replies
View Related
Sep 10, 2010
I want to implement startForeground method in Service class for prevent service self kill. Can anybody sent me code for implementing this method?
View 1 Replies
View Related
Jun 21, 2010
My blackberry allowed me to program when my phone would shut off in the evening and turn on in the morning. Is there anything similar?
My wife has a habit of forgetting to lower the volume on her phone at night so we hear her reminders and such all night long (or at least until I get up and silence her phone)
View 5 Replies
View Related
Mar 15, 2009
I'm trying to find the "correct" way to do the following:
I have an activity with a button that starts a repeating task in the background. That is, if the user goes away from my activity, I want my task to still be scheduled and executed every x minutes. I want a status TextView to be displayed on the activity, and if the task happens to start executing while my activity is showing, the TextView should be updated so the user can be aware of what's going on. So basically, is there a way to start a scheduled background repeating task and be notified when it is executed? From what I saw in the sample applications, I understand I'm supposed to use AlarmManager and a Service but I'm not sure about the notification part.
View 7 Replies
View Related
Jun 18, 2009
I am writing a demo app that allows the user to set a number of times they want my app to run. The app has no interface and just puts shows some notifications. Running this as a service seems the most obvious.
View 4 Replies
View Related
Apr 26, 2010
I have a class that extends Application. In the class I make a call to AlarmManager and pass in an intent. As scheduled my EventReceiver class, that extends BroadcastReceiver, processes the call in the onReceive method. How would I call the intent again from the onReceive method to schedule another event?
View 2 Replies
View Related
Nov 18, 2010
I'm trying to schedule my alarm manager to fire up an intent every hour in a day. this is what I do , and it doesnt work properly.
code:
new code after edit:
CODE:.................
View 1 Replies
View Related
May 14, 2014
My internet package is capped but has unlimited usage between 2am to 8am. I have an internet stick (MK808B) running rooted jelly bean connected to my TV that I want to use as an overnight torrent client, but am having no luck finding a solution to the scheduling problem.
I've looked for an android torrent client with a scheduler or a firewall application that can block an app during specific times of day, but have found neither.
View 1 Replies
View Related
Nov 29, 2009
This is quick and easy. Can I get a sampling of what people are using for podcasting apps and likes/dislikes? Here is what I want to be able to do:
1. ESPN-"type" podcasts (scheduled, generally weekly, etc.)
2. Semi-"custom" podcasts (hometown newspaper podcasts, generally not scheduled)
Would preferably like something I can schedule to download at night.
View 20 Replies
View Related
Aug 31, 2010
Is there an app for having a text to be sent at a certain time or a certain place (using GPS)? I was curious because I need to send a text to someone at 5 AM to remind them of something. I'll be asleep, of course.
I thought I remembered reading about something at the Google Apps Innovation conference from last November or so, or an app like this.
View 8 Replies
View Related
Dec 23, 2013
I have connections in all different time zones, and I used to schedule my texts to go out during their daytime hours. Now with 4.3, I do not seem to have that option.
View 2 Replies
View Related
Oct 9, 2009
How long does it take until an application is available to the public once it has been uploaded to android market? I need to know to create a release/marketing schedule.
View 3 Replies
View Related
Jun 24, 2009
I have a service running in the background.I have a background thread that gets a reference to the service from the application's main activity. But when the background thread calls a method in the service to display a toast, I get the "Looper not initialized exception".Why,if I have a valid, bound reference to a Service, does this still happen?
View 4 Replies
View Related
Aug 20, 2009
I am getting following message when i try to launch service.Also is there any specific path on file system where we need to place the .apk file which contains my serivce component only.
View 2 Replies
View Related
Jul 22, 2010
I am trying to run the sample soft keyboard included in the SDK. I am using the debugger, and the literature says that to use a breakpoint while debugging a SERVICE, I need to include:
android.os.Debug.waitForDebugger();
So here is the portion of the code I modified:
CODE:...........
I have put a couple of breakpoints, at the statements indicated by the comments.
This is what happens: the debugger first stops at the breakpoint1, for a few seconds. But then the service restarts. For the life of me I can't figure out what makes the service to restart.
View 3 Replies
View Related
Mar 1, 2009
My service works exactly the way i want as long as i use start and stop and communicate using intents. However my activity needs to change the state of my service as well as retrieving state information.So i thought it would be nice to broadcast some kind of state_changed event from my service and use a binder interface to pull information from the service or change the services state based on user input.This works fine too. The only problem is that my service gets killed when i unbind it just as the documentation says.Is there any way to keep the service alive but still get an interface to control it directly. My activity offers the user a way to stop the service and the service kills itself anyway after it's work is done but i don't want the service to stop every time the activity is destroyed.
View 3 Replies
View Related
Nov 9, 2010
I'm confused about whether I need to run my service in a separate process. What are the advantages / disadvantages of each?For reference I'm trying to create an App that uses a service to play [streaming] audio in the background. So which one is better for my use case?
View 1 Replies
View Related
Nov 20, 2010
what I'm trying to do here is implement something like a peer-to-peer client. Being that, it will start a client thread and a server thread.I know Services themselves run in the main GUI thread, so I'll have to start a couple of independent threads (or Asynctasks?) for each server and client. The only thing I'm not so sure about is if I'll better have 1 Service starting 2 threads, or maybe 2 services, each one of them starting their own thread.
View 2 Replies
View Related
Nov 30, 2009
I got an problem on getting the TelephonyManager in my personal service. The code as below: public class MyService extends Service {@Override public IBinder onBind(Intent intent) { return mBinder;}
View 4 Replies
View Related
Sep 30, 2009
i have an app that binds to a local service.I want to add a desktop widget that binds to the same service. does my service have to be a remote service or can it still be local?if it can still be local, how can I get at the local binder?
View 2 Replies
View Related
Sep 30, 2010
Please show me how to bind to a Service from another Service on Android.
If you have an image to show how to do.
View 1 Replies
View Related