Android :: Application Service Ever Run In Different Process?

Apr 26, 2010

If an application begins a Service via bindService or startService, will this Service object ever run from a process different from that of the application? I ask because many Android example projects begin a service and communicate to them using IPC which seems wholly unnecessary considering that, according to the Android Service documentation, "... services, like other application objects, run in the main thread of their hosting process." IPC, AIDL, and the IBinder interface only seem useful if connecting to a Service started by an application other than your own. Is this a correct or fair understanding?

Android :: Application Service ever run in Different Process?


Android :: Remote Service Process Persists - I.e. Won't Disappear From Process Table

Feb 21, 2009

At a certain point in my program, when I'm completely done with my service, my activity executes unbindService() and stopService() -- yet the process persists. I can tell that it persists because I run "ps" in "adb -e shell":

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

"adb logcat", I can show you the sequence of events:

ACTIVITY: context.unbindService(serviceConnection);

SERVICE: onUnbind();

ACTIVITY: stopService(serviceIntent); & returns true!

SERVICE: onDestroy();

First, my activity calls unbindService(serviceConnection). According to the documentation, unbindService() will "Disconnect from an application service. You will no longer receive calls as the service is restarted, and the service is now allowed to stop at any time." So that is fine, and it is happening.

Appropriately, we see the onUnbind() call happen on the service side. According to the documentation, onUnbind() is called when "all clients have disconnected from a particular interface published by the service." So this confirms the correct service connection is being passed, and that the service is responding accordingly.

Next, my activity calls stopService(serviceIntent), and returns true. According to the documentation, stopService() does the following: "If there is a service matching the given Intent that is already running, then it is stopped and true is returned; else false is returned." Again, this is happening and returning true.

In response, the service's onDestroy() method is called. According to the documentation, onDestroy() is "Called by the system to notify a Service that it is no longer used and is being removed. The service should clean up any resources it holds (threads, registered receivers, etc) at this point. Upon return, there will be no more calls in to this Service object and it is effectively dead."

At this point I expect the process to disappear from the process table. Yet it remains indefinitely. But why?

Also, the process is so persistent that I can bind to it again, and I see that it is the same exact process responding because the PID (process ID) is the same!

View 4 Replies View Related

Android :: Process Down After Loadlibrary In Service

Apr 1, 2009

I need to load a .so library in my Service onCreate method, but the process just down after System.load. On the other hand, the same code can work in Activity. Are there some differences between activity and service in the way of load .so file.

My code class AisoundService extends Service

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

View 3 Replies View Related

Android :: Singleton In Different Service Which Share Same Process

Mar 25, 2009

I have two services, both of them lies in separate apk, which run in same process. The two service share same jar file by <uses-library> method. The jar file implement a class, say "test", is a singleton. But I found that two instance of test is created under this case, could anybody give me some tips? I want to ensure it's singleton. Code...

View 8 Replies View Related

Android :: Show Dialogs In Service Process?

Feb 5, 2009

I intended to show a dialog in a service process, then I tried to use the AlertDialog but got the below error message: WindowManager$BadTokenException: Unable to add window -- token null is not for an application The reason seems to be that the dialog is not used in a application context (activity should be fine?) Was there any way that can solve this problem?

View 2 Replies View Related

Android : Check The Foreground Process From A Service

Aug 20, 2010

Does anyone know how to, or if it's even possible to check the (foreground process/top of the activity stack) from a service?

View 20 Replies View Related

Android :: Design Considerations - Sync Process And Using Service

Sep 29, 2010

I'm designing an android app which will need to do the following steps:

1. User pushes a button or otherwise indicates to "sync data".
2. Sync process will use rest web services to move data to and from the server.
3. The data will be stored locally in a sqlite database.
4. The sync process should provide status updates/messages to the UI
5. The user should not be allowed to wander off to other parts of the application and do more work during the sync process.

The first time the sync process runs, it may take 10-20 minutes. After the initial sync, less data will be transferred and stored and I expect the process to take 1-2 minutes or less. I've been doing a lot of reading about android's AsychTask and various examples of using a Service. But I don't fully understand the design considerations and trade-offs of choosing one design over the other. I currently have my demo project stubbed out using an AsychTask. After watching (most of) Developing Android REST client applications:
http://code.google.com/events/io/2010/sessions/developing-RESTful-and...
I'm left confused the design patterns described here feel overly complex, perhaps because I just "don't get it" yet.

View 19 Replies View Related

Android :: Signal An AppWidgetProvider From Service Running In Another Process

Feb 2, 2010

I am attempting to signal my widget such that it receives my new Intent from my service

The code I am using to send from the service is as follows:

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

View 2 Replies View Related

Android :: No Network Connectivity In Service/AlarmManager Process

Mar 24, 2010

I have a Service/AlarmManager set to go off ever hour; as seen at: http://github.com/commonsguy/cw-advandroid/tree/master/SystemServices...

The Alarm triggers a Socket connection to communicate with a Web Server. I'm logging the interaction to a file so I can see it later. When I leave the phone on my desk for a day, it seems that more often than not I get a "Network unreachable" error when trying to do any networking.

I believe it is related to how deeply the phone goes into sleep. Is there a special kind of lock I have to hold, or some command required to prep the wireless radio so that it can be ready to access the Internet?

View 21 Replies View Related

Android :: Inter-process Communication With A Service And Notifications

Dec 13, 2009

I'm having an issue with inter-process communication with a Service and Notifications

The structure of my application is as follow: - ListActivity (TunnelDroid), once the user presses a listitem it will start a Service. The ListActivity is binded to the service for intra-process communication

- Service (TunnelManagerService): running in the background. This service will add a (permanent) Notification in the statusbar. Using a Handler I sometimes need to communicate with the ListActivity (to show GUI Dialogs)

- Notification: Once this notification is clicked it should open the ListActivity.

To add the action when the user touches the notification I use the following code: notificationIntent.setClassName("net.sourceforge.tunneldroid","net.sourcefo­rge.tunneldroid.TunnelDroid"); Then I use the intent to create the notification.

Unfortunately a new Intent is opened. When I press the back button the original ListActivity is shown. So I have two instances of my same class/list.

How could I make sure the original ListActivity is opened when the user touches the Notification?

It's OK for me if the original ListActivity was previously destroyed, but I cannot have two instances. The problem is that the Handler in the Service has a reference to the ListActivity (PARENT_ACTIVITY), so if another instance is created I have invalid references. I could overwrite the PARENT_ACTIVITY, but then when the user presses the back button I have an instance with no correct link to my Service resulting in a crash/nullpointer.

The complete source can be found here: http://tunneldroid.svn.sourceforge.net/viewvc/tunneldroid/tunneldroid. Attached you can find a drawing of (most of the) inter-process communication. Could someone point me in the right direction?

View 3 Replies View Related

Android :: How To Establish A Two-way Communication Between Activity And Service In Different Process

Mar 19, 2010

I'm working on establishing a two-way communication between an Activity and a Service which runs in a different process.

Querying the process from the Activity is no big deal. But I want the process to notify the Activity on events. The idea behind it is this: the service runs independently from the actual app. It queries a webserver periodically. If a new task is found on the webserver the process should notify the activity.

I found this thread over at AndDev.org but it doesn't seem to work for me. I've been messing around with BroadcastReceiver. I've implemented an interface which should notify the Activity but the problem is that the listener is always null since the Broadcast from the process is done via Intent, hence the class that extends BroadcastReceiver will be newly instantiated.

How can I establish a 2-way communication? This has to be possible.

View 3 Replies View Related

Android :: Remote Process - Service Fetches Data From Network

Sep 15, 2009

I needed to call a remote service. The service basically fetches data from the network. I am bind the connection once,and then I unbind the connection when the user is no more in that page. Everything works fine.Except that when I call the sa,e remote method for 17th time,it just does not call the service at all.It neither throws the DeadObjecti Exception. I have run out of ideas.Is there anything that I may be missing.

View 7 Replies View Related

Android :: Automate Process Of Publish Droid App / Google Have Web Service To Do That?

Nov 10, 2010

We have several Android apps and found that the process of uploading apps for each release via Android Developers website slow and ineffective. We like to automate the process. To be more clear, we have automation for compiling and building the apps, it's a matter of uploading them to Android Market and fill in the app details for publishing. This is where we are left with manual publishing.

I am interested to learn how people automate the processing?

Does Google have a web service of some sort for publishing Android App on Android Market?

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 :: Resulting Thread Id Scoped Per Process / Current Activity / Service?

Jul 21, 2010

When you do a Thread.currentThread().getId(), is the resulting thread id scoped per process or scoped to the current Activity/Service?

View 1 Replies View Related

Jelly Bean :: Unknown Android OS / Service Process Battery Drain?

Sep 16, 2013

What is weird to me is that on the closeup line graph the second half plummets much faster than the first half. But at the same time, the second half doesn't nearly have as many wakelocks (as indicated by the "Awake" bar being basically completely empty during that time.

What the mobile network colours represent but I never had this problem previously with it on all the time so this shouldn't be an issue. GPS is always on. Again, this was never an issue until supposedly now so this also shouldn't be an issue.

Now, the four big drainers are Cell Standby, Android System, Google Services, and Android OS. Cell Standby I know is due to a missplaced decimal point in the framework, so I know that's just false battery recording. Android System I don't have a clue what the problem is, I read somewhere it might have to deal with wakelocks. But it won't tell me what process exactly is causing battery drain. Google Services are well, google services. I don't know what are classified as google services exactly (like this was never a problem before..), and finally Android OS. Again, the battery statistics thing isn't nearly specific enough.

View 4 Replies View Related

General :: ICS Find Which App Is Calling Service / Process

Jun 9, 2012

I am trying to reduce the battery consumption on my Note. I have several apps which use the GPS but the gpsd process is being called quite a lot, even when I am not using any GPS app.

Simple question - now that I have established which service is being called (using better battery stats) is there a way to determine which app(s) are using it? GT-N7000

View 2 Replies View Related

General :: Find Exact Process / Service That Is Triggering Wakelock?

Mar 20, 2013

I'm getting beat down with GTALK_ASYNC_CONN wakelocks while on my work's AP.... the specific WL is :gtalk_async_conn com.google.android.gsf.gtalkservice.androidendpoint.... something everyone has been complaining about recently, and I never saw it until recently (now that I got up to 4.1.2 a short time ago.

Is there a way to determine exactly who is generating that WL? It's not related to GTALK, as the WL name incorrectly leads us to believe, but it must be google, and I only see it fire when the Wi-Fi is connected and in use. It's non-existent when I'm on Mobile. It comes and goes, sometimes chugging wake time like its cheap beer, othertimes it's dormant, and I haven't been able to figure out who is using it based on the context of when it occurs.

There HAS to be a log or something somewhere that says process X is responsible.

View 1 Replies View Related

Android :: How To Get Application Name From Process?

Jul 12, 2009

I am trying to retrieve all applications that are running on the android phone. Following is the code I have wrote, but how do I get the application name into my Array items?

Context context = getApplicationContext(); Resources appR = context.getResources();
ActivityManager actmgr=(ActivityManager)context.getSystemService (Context.ACTIVITY_SERVICE);
List<RunningAppProcessInfo> appList = actmgr.getRunningAppProcesses();
CharSequence[] items = new CharSequence[appList.size()];
Vector <Process>allProcesses = new Vector <Process>();
for (int i=0;i<appList.size();i++) {
RunningAppProcessInfo rti = (RunningAppProcessInfo)appList.get (i);
Process p = new Process (rti.pid,rti.processName,rti.pkgList);
allProcesses.add(p); items[i] = p.getProcessName(); } : : :

View 2 Replies View Related

Android :: Cannot Start Parent Application / Process Is Bad

May 12, 2009

As an exercise I attempted to add an AppWidgetProvider-derived class to one of our existing Android applications. When the widget is created and appears on the home screen, the output from adb logcat notes: W/ActivityManager(58): Unable to launch app com.mycompany.myapp/ 10042 for broadcast Intent { action=android.appwidget.action.APPWIDGET_ENABLED comp= {com.mycompany.myapp/com.mycompany.myapp.MyAppWidgetProvider} }: process is bad

This output comes from around line 10814 in ActivityManagerService (looking at cupcake on git). This is running on an ADP 1.5, FWIW. The same AppWidget code, once separated from the main application's project and put into its own simple project, runs as expected, so I know my manifest entries/XML/Java are all as they should be. Has anyone else run into this, or perhaps can the Android team comment on what aspect of my application might be preventing the AM from starting up the process when the widget is added to the home screen?

View 6 Replies View Related

Android :: Application Process Has Stopped Unexpectedly

Apr 22, 2009

For some reason I can't explain, when my app runs, I will on occasion get the following error message: "The application xxxxxxxx (process xxxxxx) has stopped unexpectedly. Please try again". When I debug my code, it seems to break at random places that doesn't make sense. On top of that I tried to surround the entire code with a try/catch block just to try to catch the exception, but it doesn't work either. I'm suspecting it's the OS that is producing this error message but I don't know why. As far as my code goes, if there were exceptions caused by it, it would've been caught by the try/catch block. Can someone shed some light here?

View 13 Replies View Related

Android :: Process Died After Exiting Application

Jan 14, 2010

I am seeing a curious behaviour in my app. I have a widget that gets updated by a service every # hours, when the service finishes I stop it, using "stopService(new Intent(this, MyService.class));", the widget if pressed launches an Activity. Now it gets interesting, while im on the activity everyting works fine, then when I exit the app(by the back key or a button I designed which simply calls this.finish() ) the ActivityManager would tell me that my process has died, I do not see any error of any kind, just that the process has died.

Why I am seeing that message and what does it mean exactly? That is having a side effect on my service regarding static variables getting set to default. Could my code be the cause of this? Is there any way to know that your process has died? I have tested my app on a HTC Hero running 1.5, it always works well on the emulator and I never get that message. I know android kills processes to reclaim memory but Im always careful to close apps heavy on resources.

View 4 Replies View Related

Android :: Memory Limit 16 MB Per Process Or Application?

Aug 5, 2010

Is android's memory 16MB limit per Process or Application? If the limit is by process, I can make some services remote. That means the service will be in different processes, and the limit will be 16 x N.

View 3 Replies View Related

Android :: Process And Application Lifecycles Are Separate?

Mar 15, 2010

Being interested in Android development and still in the experimentation phase - there's something I haven't been able to grasp. As far as I've been able to understand, the process lifecycle and application lifecycles are separate and as such, it would be possible for the application to still to exist, even if it's process has been killed. So I guess my question would be, in what scenario could this occur and how is the application accessible if the containing process has been killed?

View 5 Replies View Related

Android :: One Process - Two Live Application Objects?

Oct 31, 2010

In a comment on an epic StackOverflow question-and-answer, a gentleman who I will call Tim has outlined a scenario he says he is running into, one I have some difficulty believing. Reading somewhat between the lines, the flow would appear to be this:

1. User taps on an activity icon in the launcher 2. Process starts up 3. Application object is put in that process -- and a custom Application object loads an NDK library which initializes some statics/singletons 4. User uses application 5. User abandons application (e.g., HOME) 6. Later, user returns to application, before the first process is killed or recycled for use with another app 7. A second Application object is created, in the same process, before the first Application object is called with onTerminate()

This screws things up for Tim's app -- apparently, it does not deal with pre-initialized statics/singletons well. They were presumably counting on onTerminate() to let them clean up the NDK space. As a result, they are relying upon killProcess() (somehow...unclear under what conditions they might call this) to force their own process to go away, so their statics get cleaned up. Step #7 is what confuses me. I can see a new Application object being created, but only if the first Application object were terminated. I don't see any NDK-related bugs out on b.android.com that seem to match this complaint, though in principle it might cause problems for non-NDK apps as well. Has anyone encountered a new Application object being created in a process before the old one is terminated?

View 16 Replies View Related

Android : Closing Activity Completely / Process Killed By Activity Manager Service

Aug 2, 2010

Whenever the memory needs to be reclaimed, the process is being killed by Activity Manager Service in killPidsForProcess. I have a back button in my activity window on right corner of the title bar.

I want to kill the activity completely on clicking the close button. Can I reuse the same function and will it have any major effect? Please help me out in this.

View 3 Replies View Related

Android :: Application Gets Killed - Because Provider Is In Dying Process

Apr 9, 2009

After long running the Media|Player (audio mode) the app I'm developing often crashes w/ the following error: > Process android.process.media (pid 14795) has died. > Killing <my app> because provider com.android.providers.media.MediaProvider is in dying process android.process.media

View 3 Replies View Related

Android :: Application To Capture And Process Whiteboard Data

Nov 4, 2008

One of the winners of the Google app contest was Jigsaw by Mikhail Ksenzov, an app to capture and process whiteboard data. The app isn't in the market, and I can't find anything via Google about it's status. Is it still beta, or what?

View 1 Replies View Related

Android :: Uploading Application To Market - The Server Could Not Process Your Apk Try Again

Jun 24, 2010

I have been struggling with uploading my application to android market. I keep getting the same old "The server could not process your apk. Try again.". I tried for hours to change and modify my AndroidManifest.xml file but no luck.

Here is my my AndroidManifest.xml:

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

View 2 Replies View Related

Android :: Sorry Application Keyboard In Process (Force Quit / Wait)

Sep 1, 2010

When a try to deploy my android App in the emulator, after the application(.apk) gets loaded in to the emulator, when I tap on the menu button in emulator for loading my application's initial screen, its is raising me a alert message with this information:
<pre>Sorry Application Keyboard in Process (Force Quit / Wait)..</pre>
and some other similar messages too..
How can I avoid this issue that is happening at all time, When this happens, unless I tap on Wait button, I can't able to proceed.

View 1 Replies View Related







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