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?

Android :: show dialogs in service process?


Android :: Clean Up All Dialogs Show By My Activity?

Sep 30, 2010

In my activity, I show a dialog under some condition like this:

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

My question is what do I need to do to ensure there is no resource leak? From the logcat, i see there is a case where it said a window is leaking or something like that.

View 1 Replies View Related

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 :: 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?

View 1 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 : 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 :: DDMS Doesn't Show Process List On Device

Oct 15, 2009

I have two phones, one running 1.5 and the other on 1.6. When I connect the 1.6 device via usb, DDMS recognizes it and in the top-left pane shows: HT842....... | Online | 1.6, debug

It then lists the individual processes, I can select them and use various tools like allocation tracker.

But when I connect the 1.5 device, DDMS recognizes it but shows: HT95A....... | Online | 1.5

But it does not show any of the processes on the device, so I am not able to do use allocation tracker and such. The sysinfo tab works, and I can monitor logcat with filter and such in the bottom pane.

What am I missing here? Obviously the 1.5 device has USB debugging enabled. Why does it not show 'debug' in DDMS? I'm using SDK 1.5_r2 on linux (Ubuntu 9.04), if that makes a difference.

View 5 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 :: Show Pop Up From Background Service

Sep 15, 2010

it is possible in android to show pop-up dialog from background running service?

View 1 Replies View Related

Android :: Service - Show Progress In Activity

Jan 2, 2010

I have a service that downloads something from the Internet, it shows progress in notifications and in MyActivity (only when MyActivity is on foreground of course). How should the service post the progress to MyActivity? I know this could be done somehow with IBind but can I just simply do this in MyActivity:

MySevice.myActivity = this; startService(new Intent(....));

From MyService I can now call MyActivity's methods because I have a static reference to it in MySevice.myActivity, so I can call e.g. myActivity.sendProgress(63).

View 5 Replies View Related

Android :: Show Notification While Service Running?

Sep 30, 2010

I want to show notification in service..! While I click button in my home screen I just call service.! That service run every 30 seconds with the help of timer..! I want to show result to user..! How can I implement this..! Herewith I attached code..

HOme screen

package com.servicetest;

import java.util.Timer;

import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.Toast;....................

View 4 Replies View Related

Android :: AlertDialog.show Silently Ignored Within Service

Nov 9, 2010

I have a service running a background thread. What I'd like to do is to show an AlertDialog initiated from my background thread. I know that this is not the recommended way of notifying the user and that it interrupts the workflow (as they can pop-up in any application at any time) but it's a suitable way for my use case. There is a handler registered with the background thread and showing a Toast notification withing the handler works fine. But after switching to an AlertDialog nothing happens anymore. My showDialog logic is silently ignored. No Dialog window appears, no log entry. It's a bit strange as I'd expect at least a log entry saying that I'm doing something wrong or whatever. Are there any limitations for showing an AlertDialog initiated from a service background thread? Some people seem to recommend a Dialog themed Activity to get a similar behavior.

View 2 Replies View Related

Android :: Show / Pop-up Dialog From Service In Droid?

Aug 19, 2010

I want to show/pop-up dialog from service in android.
can any one guide how to work around for that.

View 1 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 :: Background Service To Show Toasts On Device Screen

Mar 20, 2009

I have a background service component which is reacting to changes in network connectivity. I would like to alert the user that a a connectivity change event has occurred by popping up a Toast View on the device screen. Is this possible ? Can it be done even though a Service component does not have a UI associated with it ?

View 3 Replies View Related

Android :: DDMS Not Listing Process - Via Command Line To Attach Process To Debug

May 21, 2010

Sometimes the DDMS in the Eclipse not listing the process.

To do the debug in this condition,

1) Is their any way force the DDMS to list the process?

2) Any command to attach the process from the command line?

View 2 Replies View Related

LG Ally :: Process' Won't Open - Pop-up - The Process Com.android Phone Has Stopped Unexpectedly

Nov 24, 2010

So, I decided to give Tridents ROM a try about 10-minutes ago.

I used ROM Manager, backed-up my old ROM, then downloaded Velocity 0.2.

Now, my phone will do nothing, it turns on and shows the red Droid eye, then when it's time to go to the home screen I get pop-up after pop-up saying that "The process com.android.phone has stopped unexpectedly. Please try again."

I have no way of getting on my phone at all, what can I do?

View 11 Replies View Related

Motorola Droid :: Update App - Message Process Android Media Process Stopped Unexpectedly

Nov 12, 2010

I Just installed a new theme (Live Wire) for my Lithium Mod Rom. Don't know if there is a connection, but when I need to update an app, I get the message something like "process android media process stopped unexpectedly" and it will not allow the update. Everything else works well. I have turned it off for awhile, and have done a battery pull.

View 1 Replies View Related







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