Android :: Creating A Service That Survives Application That Started It?

Nov 10, 2010

I'm developing an Android application that consists of:

a lightweight background service that logs events to a DB
a heavier GUI application that summarizes these events and displays graphs.

I'm having trouble creating the service part, though. The graphic application can use quite some RAM, and when it goes to the background, the OS closes it after some time of not being used.

The problem is, when the application gets shut down, so does the service. This is bad because this keeps me from recording further events. I don't care if the application gets terminated, but the service needs to keep on running.

I have tried numerous ways to keep the service alive, like having it use threads or a differently named process than the main app. Nothing has worked, and I have found no help on any of the android developer pages or forums.

Android :: Creating a service that survives application that started it?


Android :: Know Who Started(bind) Service?

Jun 14, 2009

How can I know who started(bind) service?

I already check 'RunningServiceInfo()' but I couldn't find.

View 2 Replies View Related

Android : Name Of Package That Started A Service?

Jul 8, 2010

I am writing a service that will be compiled into a .jar file for use in other apps. is there any way to get the name of the package that uses or launches the service?

View 2 Replies View Related

Android :: How Can I Ensure A Service Is Started At 9am And Stopped 9pm Every Day?

Jun 25, 2010

I have a service that will monitor location changes daily. What I know so far that to start a service at boot, I have to follow the linked tutorial. This way I can get the service started at boot, but to save battery I need it only between 9am-9pm.

Question is pretty simple, so I will repeat:

How can I ensure a service is started at 9am and stopped 9pm every day?

View 2 Replies View Related

Android :: Detect Activity Started From Service

Jun 25, 2010

I have small simple Service and big MainActivity with UI. Service is called periodically from AlarmManager. My Service need to know if MainActivity is on the screen and inform MainActivity about state changing.

View 3 Replies View Related

Android :: Finish An Activity Not Started From Service

Jun 17, 2010

I've a service which listens to user request for ending one activity and starting another activity. For Ex: Say there are activities1,2 ,& 3. Now if there is already activity1 started by someother activity then based on the user request i need to stop activity1 and start activity2 or activity3. If the acitivity1 is started by my service then i can do finishactivity(requestcode) and shall receive a call to onActivityResult() then i can start next activity 2 or 3. But can i stop the activity1 which is started by some other activity from a service?

View 2 Replies View Related

Android :: How To Start Activity From Service - If Not Already Started

Mar 19, 2010

I've successfully implemented a BootReceiver, AlarmManager, and Service per the code here: http://github.com/commonsguy/cw-advandroid/tree/master/SystemServices...

Inside the doWakefulWork method of the Service I am instantiating a few classes, but some of them require my Activity to be running. How do I actually start the Activity? The code above only starts the AlarmManager and Service.

There are also times where the Activity *is* already started, like if the user manually opened it. So I also need to start the Activity "only if it's not already running". Hows that work?

And what about the situation where the user first installs your application and may not even reboot their phone for a week. In that case, do you have to start the Service from the Activity? But then the Service will die with the Activity.

View 7 Replies View Related

Android :: Reconnect With Started Service And Want To Kill It / Know Its Already Working?

Mar 20, 2010

I am looking to code simple application

let's say I have an activity that starts a service which is simply a counter and counter value is reflected on activity UI , when I navigate away from this .I want this counter to be continue and when I get back to Activity I want to see counter count.so the question is

how can a reconnect with the started service and then if I want to kill it ? how can I know the service is already started?

View 3 Replies View Related

Android :: How To Stop Service Started By BindService() With Bind_auto_create Option

Nov 18, 2010

I start service by using:

private ServiceConnection _serviceConnection = new ServiceConnection() {...}
bindService(new Intent(this, MainService.class), _serviceConnection, Context.BIND_AUTO_CREATE);

I want to 'restart' the service. (Let's not argue why I want to do that)
I do that by:

unbindService(_serviceConnection);
// Do some initialization on service
bindService(new Intent(this, MainService.class), _serviceConnection, Context.BIND_AUTO_CREATE);

I noticed service doesn't die(onDestroy doesn't run) until I call next bindService();
So some static initialization I did on service got cleared by onDestroy() implementation.

Question: How do you make sure unbindService() will stop service (run onDestory()),
so that I could do initialization after and re-run bindService()?

View 3 Replies View Related

Android :: Creating A Service Using Eclipse

Feb 3, 2009

How to create an Android service (that uses IPC) using eclipse?

View 2 Replies View Related

Android :: Creating A Web Service Project

Aug 4, 2010

How do I start a project wherein I can design an application which fetches weather forecasts from existing web sites?

View 1 Replies View Related

Android :: Creating Service With Bluetooth Activation

Apr 6, 2010

I want to create a service in Android which will initially ask user if he/she wants to start blue-tooth and set the blue-tooth discovery.

My questions are

1) Can i launch in the service following activities? if

CODE:.............

2) I want to set discoverabilty of the phone on for lifetime of application. is it possible??

3) I want to access empty space available on sd card. How should i do it??

View 2 Replies View Related

Android :: Creating And Showing A View/window From A Service

May 22, 2009

I want to show a view on calling a Service API. Currently the only way looks like using the Toast class.

I tried the following after getting the WindowManager service, but it crashes at addView. I looked into the Toast class and found that it uses WindowManagerImpl which is not accessible publicly - is there any way to access the WindowManagerImpl functionality?

CODE:.................

View 4 Replies View Related

Android :: Droid App To Know When Another Application Has Been Started?

Aug 14, 2010

I would like my app to do something when another application is opened.

The current approach I have taken is to create a broadcast receiver that monitors all

android.intent.action.MAIN
events, but either I am not doing it correctly or the way I am going about it is incorrect. The section of the manifest looks like this code...

I included the launcher category just as a test. GetApp currently is only set to make a log entry when called.

View 1 Replies View Related

Android :: Keep Broadcast Receiver Process Alive / By Creating Service That Stays Around?

Sep 16, 2009

The app widget documentation indicates that the "widget provider"being a receiver of a broadcast service may not exist (the process) beyond the completion of the call.If I want to maintain state between two broadcast events, such as say widgetProvider.onUpdate(), can I start a local service and leave it hanging there until my widgets are disabled? If I didn't explicitly stop that service will it be loaded again and resumed when the device wakes up.

View 4 Replies View Related

Android :: Get Informed Whenever An Application Is Started / Created?

Nov 16, 2009

I'd like to write sthg like a logger for my Android phone where I log whenever an application/activity is started respectively created. So it's not only about my own stuff but about all the stuff that gets started on the phone. Is there sthg like an intent flying around or any kind of stuff that I could catch?

View 6 Replies View Related

Android :: Detect Another Application Started Playing Audio

Aug 26, 2010

My music application constantly plays music in the background, however I'd like to be able to detect when another application starts playing audio (such as the YouTube app) so I can pause/mute/stop the audio in my application. This will allow a user to continue browsing the web whilst listening to music, but then if they wish to watch a video at any point, they can do so without audio conflict.

One solution might be to listen for a broadcast which states when an application begins using the AudioManager. Does such an Intent Action exist? Edit: As in the answer provided below, there appears to be a method of detecting the loss of audio focus in 2.2 with AudioManager.OnAudioFocusChangeListener.

View 1 Replies View Related

Android :: Application To Be Started Whenever The Phone Is Turned On Or Restarted

Sep 8, 2010

I want my application to be started whenever the phone is turned on or restarted.

View 1 Replies View Related

Android :: Stop All Started Services On Application Close / Exit

Apr 18, 2010

Is it possible to stop all started services when the user hits the Home Button? I use:
startService(new Intent(ClassName.this, ClassName2.class));
stopService(new Intent(ClassName.this, ClassName2.class));

This means I will have to somehow add the 'stopService()' for 7+ of my app classes
I've researched this topic and I think there's 'onTerminate' but still not sure how this should be implemented.

View 2 Replies View Related

Motorola Droid X :: Overclock That Survives A Reboot?

Aug 10, 2010

Warning, this process may cause our phone to become unstable if you clock it at the wrong speed. I advise that you do not continue onto steps 2 and 3 until you find the settings that work for YOUR phone best.

All credit goes to Fab for his how-to post, Elkay for the original mod of the milestone overclock and to Hilbe for his install-recovery.sh and setscaling.sh files as well as figuring out where to add on these commands. And also Airmaxx23 for helping me refine the commands. As well as FreeWELL for his Root Explorer guide and his stop overclocking commands

I am not responsible for anything that happens to your phone.

First, things first download the attachment at the bottom of this post
Now on to how to overclock that survives a reboot,
1. First follow Fabolous's guide to overclocking,
http://androidforums.com/all-things-root-droid-x/145209-how-overclock-your-droid-x.html
Here is his OP, also the overclock.ko and overclock.sh files are both in the attached Zip file at the bottom.

Quote:

View 49 Replies View Related

HTC EVO 4G :: No Need Of Protective Skins - Device Survives Scratch Test

Jun 11, 2010

I thought it was pretty interesting. Glad I just bought no skins. Sprint HTC EVO 4G Survives Scratch Test.

View 6 Replies View Related

Android :: Creating Database For Application

Apr 18, 2010

I have started creating database for my application. It is working well. The data is also getting stored.But the issue is that i require dropping table, that already exists, every time i run the application.

But one thing i found is that whenever i change the version of the database in my code, the table gets dropped. But i would like to know whether it is possible to drop table without changing the version number of the database.

View 2 Replies View Related

Sony Ericsson Xperia X10 :: Everything Get Stuck When Application Download Started

Jun 8, 2010

Now I know this has been brought up before and I've followed the advice: tried turning on Google Talk, rebooting etc. In fact I can rarely get GT to sign in either but even when I do, it makes no difference to the apps I'm trying to download. When I first got the phone, I managed to download a couple of apps without problems but now I can't. Everything gets stuck on 'starting download' whatever I do. I'm trying it on a wireless network as it's rare I can get 3GS up.

View 1 Replies View Related

Android :: Creating Application Shared Libraries

Sep 16, 2010

Is it possible to install a java library in a folder and have this code dynamically linked into another program? In other words, i have a major code base that would be shared among different projects.Assume that all them are created with the same shared user id.

View 4 Replies View Related

Android :: Creating An Android Service That Cannot Be Killed

Sep 10, 2010

I am trying to write an app that cannot be killed by a user or another application. I understand this goes against what Android has designed for its platform, this is more of a proof of concept. The plan is two have two apps, app1 and app2. When app1 starts it will start app2 and then bind onto app2, when app2 starts it will make sure app1 is started if not, then start it and bind onto app1. The point of app1 binding on app2 and app2 binding on app1 is so when one of them gets killed a method will be called that the binding has been disconnected and the app can then be restarted. I currently have the apps starting each other when they start up but I cannot seem to get them to restart when I force close one of them.

For App1 service I have and app2 very similar:

CODE:..............

And for my class that implements ServiceConnection I have:

CODE:............

I think the issue I am having is that onServiceDisconnected never gets called when app1 or app2 is killed. I think this may be because I am not correctly binding to a service.

W/JavaBinder( 884): ibinderForJavaObject: 0x436274a0 is not a Binder object
W/JavaBinder( 891): ibinderForJavaObject: 0x43621d30 is not a Binder object

How can I bind services together so when one gets force closed that I will get a notice on the other?

View 2 Replies View Related

Android :: Creating Options Menu Available To All Activities In Application

Jun 20, 2010

I want to have an options menu that is available to all Activities in my app (on pressing the MENU button). I've been doing this by creating it in onCreateOptionsMenu(Menu menu) for each Activity but this seems redundant. Is there a way to create it in one place and have it available in all Activities?

View 1 Replies View Related

Android : Recommended Way Of Creating A Demo Version Of Application

Apr 23, 2010

What is the recommended way of creating a demo version for an application. Basically, the demo version will be fully functional, but will be limited to running it 25 times. My worry is that if the user uninstalls and reinstalls, the count will be reset. I thought about writing a data file to the SD Card with the count of executions (hoping that would persist after uninstall), but I do not want to add that permission if I can avoid it. Any suggestions on how to have some type of demo flag persist after an uninstall?

View 1 Replies View Related

Android :: Too Many Activities Being Started When Launching An Android Application

Dec 24, 2009

You can see property action android:name= property is "android.intent.action.MAIN" and categoryandroid:name= is "android.intent.category.LAUNCHER" for all activities.When application starts up, it calls First Activity. Then calls useless Activity such as ThirdActivity or Second Activity.In this case, is my manifest.xml correct?Or, do I need to set another property to Second and Third activity? If so, what is that?I wonder manifest.xml file is right for my case.

View 3 Replies View Related

Android :: Creating Static Data Structure On Application Startup For Android

Oct 27, 2010

In my application, I am going to create a few listviews that are dependent on the listview before it. For example,Then, depending on user choice, will go next screen, let's say, it contains a submenu of each type of school,that may be different or may be the same to other states.What I want to know, is how to populate these different lists dynamically as the user goes on? I don't know what the best of doing this is, and I seem to be looking in the all the wrong places because I keep getting stuck. Once all the data is added into whatever structure is used, it will be static. I basically just need help as to how to code information into some sort of hashtable or anything of the sort that can be easily referenced, and later when the Application is updated, be able to add more schools/states/submenus etc.

View 1 Replies View Related

Android :: Running Application As Service

Sep 9, 2009

I want the application to run in background. This application should run continuously and should never get killed. Will running application as Service solve this issue? The application should get started automatically on start up. I don't need any GUI for this application. The main issue is Service getting Killed. Does service get killed ? and in what conditions will that happen?

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved