Android :: Communicate With A Service From An Application

Aug 25, 2009

i have some problem to communicate with a service from an Android application.The service is in a first package "package com.myService" and the application in another on "package com.myApplication".My service work and start well but my next step is to add an AIDL interface to external applications.I have tried to follow the recomandation described here : http://developer.android.com/guide/developing/tools/aidl.html, but i have still the following error (given in the log service):W/ActivityManager( 568): Unable to start service Intent { action=com.MyApplication.IBootstrapService }: not found

Android :: communicate with a service from an application


Android :: How Does A Service Communicate With Activity?

Feb 17, 2010

Suppose I have an Activity that's a list. It calls a Service when this Activity starts.The Service will do background stuff download, parse, and fill the list.My question is this: How can the Service communicate with the Activity?How can I call a method in the Activity, from the Service? (I'm new to OOP)

View 2 Replies View Related

Android :: Service - Communicate With Activities

May 19, 2010

I'm wondering which is the best way to communicate between a Service and an activity..

Broadcast intent
Callback
others?...

View 1 Replies View Related

Android :: Getting Service To Communicate With Activity?

Jun 25, 2010

I currently have a Service and an Activity in my application.I currently bind the Service to the activity without using AIDL as the Service and the Activity are in the same application.This allows me to call the methods from the Service within my Activity when I require them, however it doesn't let me call the methods of the Activity from within my Service when I want to.Can anyone comment on what would be the best way to achieve this?I could use Intents but is there an alternative option?I want to have tight communication between the Service and the Activity, I want to be able to call an Activity method from my Service when an event happens.

I now have it working the way I want, however I have come across a problem.My service gets status updates and my Activity is then supposed to react to the update sent on from the Service.The problem is that when I start my activity I get the Dialling Status and then Connected status before the onBind is called and I get the instance of iCallDialogActivity.

I need to be able to use my iCallDialogActivity when I get the Dialling and Connected Status notifications.But this gives me a NullPointer Exception due to it not being created in time when my Activity starts, binding is the first thing I do in my Activities onCreate().Is there a way to make it bind straight away?

View 1 Replies View Related

Android :: Communicate Progress From Local Service

May 16, 2010

An application I'm building uses a local Service for downloading files from the web to the phone's SD card. In this app users can browse lists of books, and read them while online. A user can also download a pdf copy of a book for offline viewing. To handle downloads I'm using a locally bound Service. I do not want this Service to run all the time, only when downloading files. So that the Service can shut itself down when its tasks are complete, I am not binding to the service, rather I'm sending an "enqueue for download" command through the Intent passed to Context.startService.

Books available for download are shown in a list. A user can choose to download a book by clicking on its row in the list. On download, I need to show download progress using a ProgressBar on the actual book list row. I need to also show, on the rows, if a book is enqueued for download, or if its download has completed or failed. The books can be shown in different activities throughout the application--in search, or in the user's list of favorite books, for example. When the books are shown in different places, these are not the same objects, but they are uniquely identified by their bookId...............

View 1 Replies View Related

Android :: Want Activity / Service To Communicate With Intent

Aug 2, 2010

In the Activity I write Intent i=new Intent("IntentServiceTest"); Bundle bundle = new Bundle(); bundle.putString("abc", "def"); i.putExtra("wer", bundle); IntentTest.this.startService(i); Start Service into Service OnCreate method,but I don't know how to do get this Intent in this method.

View 11 Replies View Related

Android :: Best Way For Service That Starts Activity To Communicate With It

Feb 16, 2010

I have a service that listens to a socket. When receiving certain input it is to create an activity. When receiving other input, it is to kill this activity. I have struggled for a while to make the service communicate with the activity through AIDL (http://developer.android.com/guide/developing/tools/aidl.html), but this seems to not be effective. I think AIDL is only effective when the process that is to be talked to is a service, not when it is an activity? I would love some directions or suggestions on how to solve my problem.

View 1 Replies View Related

Android :: Communicate Between Applications (service Vs Intents)

Sep 13, 2010

What is the difference between 2 ways of interaction between applications on android:

1. implementing service in app #1 and using it in app #2.
2. handling intentions and posting answer intention.

View 2 Replies View Related

Android :: How To Communicate Back To Service From Broadcast Receiver?

Aug 17, 2010

I have a widget which starts a service. The service registers two broadcast receivers. I would like to send back intents from the receivers to the service, so that the service can react.I remember reading (on some blog) that this won't start a new service, but will simply pass the intent to the already running service. Is this correct? Is it a bad way of doing it? Is there a better way?

View 1 Replies View Related

Android :: How To Get Droid Application Id Programatically / Communicate It With Other Apps

Aug 12, 2009

In Android, how do I get the application's id programatically (or by some other method), and how can I communicate with other applications using that id?

View 3 Replies View Related

Android :: How To Have Android Service Communicate With Activity?

Mar 17, 2010

I'm writing my first Android application and trying to get my head around communication between services and activities. I have a Service that will run in the background and do some gps and time based logging. I will have an Activity that will be used to start and stop the Service.So first, I need to be able to figure out if the Service is running when the Activity is started. There are some other questions here about that, so I think I can figure that out (but feel free to offer advice).My real problem: if the Activity is running and the Service is started, I need a way for the Service to send messages to the Activity. Simple Strings and integers at this point - status messages mostly. The messages will not happen regularly, so I don't think polling the service is a good way to go if there is another way. I only want this communication when the Activity has been started by the user - I don't want to start the Activity from the Service. In other words, if you start the Activity and the Service is running, you will see some status messages in the Activity UI when something interesting happens. If you don't start the Activity, you will not see these messages (they're not that interesting).

It seems like I should be able to determine if the Service is running, and if so, add the Activity as a listener. Then remove the Activity as a listener when the Activity pauses or stops. Is that actually possible? The only way I can figure out to do it is to have the Activity implement Parcelable and build an AIDL file so I can pass it through the Service's remote interface. That seems like overkill though, and I have no idea how the Activity should implement writeToParcel() / readFromParcel().Is there an easier or better way? Thanks for any help.

View 2 Replies View Related

Android :: Linux Kernel - Communicate With Android Application

Dec 4, 2009

I want to deliver some event to android application. I thought it should pass the event to android framework library and then transfer the event to android application. Is there any clear sample about such scenario? or anyone can show me the hint how to make it work.

View 2 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

Android :: One Application Requiring Another / Service?

Mar 24, 2009

I'm writing an app that needs one or more applications/services that are distributed with their own seperate apk file. I'm writing a user-app that allows the user to upload pics using a service. The service can be used by multiple user-apps, not just mine. I'd like to have the service being installed in its own apk, instead of bundling it with each user-app. Has anyone had experience with this scenario? What is the best scenario i should implement so that the user downloads the service that the user-app needs? Can be this be done automatically (that would be best)? If not, in your opinion, what would be the most user-friendly way for doing so?

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 :: Application Using Service In Different Project?

Sep 1, 2009

I want create a service and that other application use this service. I want that the other application is in a different project that the service.

It is possible? If is possible somebody can show me a sample code.

View 6 Replies View Related

Android :: Possible To Implement An Application As A Web Service?

Jul 7, 2010

Is it possible implement an Android application as a web service? On the official site I've read:

Note: If you want to develop a server-side application, we recommend that you implement your application as a servlet running in a servlet engine like Tomcat or full-blown JSEE container like Geronimo. If you prefer to implement a server-side application based on our HttpService, we'll assume that you know what you're doing and that you don't need help in figuring out which interceptors need to be configured.

How can I implement this? Apache TOMCAT can run on Android?

View 2 Replies View Related

Android :: Is It Possible For An Application To Use Open-ID Service

Aug 6, 2010

I have a C/S solution, which take Android as its client and PHP as its server.

I have my own account system.

I'm wondering whether I could provide my user to login my system with Google Account?

I saw there are web-solution for this, like this stackoverflow.com could use Google Account to directly login.

Is there a solution for C/S system?

View 1 Replies View Related

Android :: Service Won't Stop When Exiting Application

Jul 13, 2009

I have a service receiving and sending data to a server in separate threads each. The service lifecycle methods look like this:..................

View 3 Replies View Related

Android :: Sharing Data Between An Service And An Application

Jun 28, 2009

In order to share data between one of my own Android service and an application i am looking for the best way to do this. I have seen the shared memory drivers inside the GNU Linux kernel, but no Java api. Maybe the specific Google IPC Blinder cad be used for my need ?

View 10 Replies View Related

Android :: Binding Service To Activity Vs Application

Jul 1, 2010

Is there any fundamental difference in binding a service to an android.app.Activity vs binding it to an android.app.Application. I want to bind the service to an Application because I want to keep some global state/data in the Application instead of duplicating it in all my activities.

View 1 Replies View Related

Android :: Access Remote Service In Different Application

Apr 30, 2010

I defined a remote service over a AIDL file. Now i want to access this service in a different application. But how can I do that? The AIDL file is not accessible in my second application, and if i just copy the AIDL file, then the service can't be found.

View 1 Replies View Related

Android :: Any Application That Shows What Service Using Net Traffic?

Jun 27, 2009

Are there any applications that shows exactly what applications or services that uses 3g traffic? My Magic uses pretty much 3g traffic, it looks like it updates every half hour/hour.

27.06.2009 10:42 38.9 KB GPRS 0.04
27.06.2009 10:07 36.9 KB GPRS 0.04
27.06.2009 09:32 36.9 KB GPRS 0.04
27.06.2009 08:30 40.1 KB GPRS 0.04
27.06.2009 08:15 2.3 KB GPRS 0.00
27.06.2009 07:40 36.7 KB GPRS 0.04
27.06.2009 07:05 37.0 KB GPRS 0.04
27.06.2009 06:30 36.8 KB GPRS 0.04
27.06.2009 05:55 36.9 KB GPRS 0.04
27.06.2009 05:20 38.2 KB GPRS 0.04
27.06.2009 04:44 35.8 KB GPRS 0.04
27.06.2009 04:10 78.6 KB GPRS 0.08
27.06.2009 03:34 38.2 KB GPRS 0.04
27.06.2009 02:05 43.8 KB GPRS 0.04
27.06.2009 01:56 36.5 KB GPRS 0.04

View 2 Replies View Related

Android :: MVC - Application Or Service For Asynchronous Updates

Jul 3, 2010

I have data that is to be refreshed from the Internet. Let's call it Model.

What I want to do: Basically it sounds like an MVC model, where the Model is also kept persistent in local (private) storage. The Model and its associated methods are application-wise. There are several Activity's that display and manipulate different aspects of it:

User
navigates across different Activity's
that display Model
from different perspectives. Currently I have a ListActivity for all elements, and an Activity for one element's details
Sometimes Model needs refreshing.
Surely this is done on a different thread. Refreshing can be triggered from several Activity's.
There are several (time consuming) common
tasks that can be triggered from different Activity's
My application loads and saves Model
to private storage when it starts
and stops

My problem: I'm not sure where to put Model and the related tasks in. Also, I don't know what mechanism to use to notify Activity's. Currently I come up with 2 approaches:

Use Service and send broadcasts. Saving to disk is performed in Service#onDestroyed(), so I want to minimize that by binding it to Activity's. At this point, I'm also not sure how to deliver the updated information: whether to provide a getter in Binder, or include that in the broadcast message.
Customize the Application object so that refreshing methods and getters are available globally. I then perform update from Activity's using AsyncTask. If there are other Activity's that are behind the current Activity, they will update in onResume() when the user navigates back.

Reasons I'm not using a class with static methods:

I need to save and store Model to disk. Some of the methods need a Context for displaying toasts, notifications, caching, etc.


Also, I don't put these functionalities in an Activity because there are several activities that manipulate the same piece of persistent data.

Below are pseudocode illustrating what I mean:

Using Service:

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

Make the functionality globally accessible in the custom Application object

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

Weaknesses I can think of for the Service approach is complexity, since Binding is asynchronous. And it's very likely that I have to repeat some code because I have both ListActivity and Activity

For the Application approach, the documentation says not to rely on onTerminate() being called.

View 3 Replies View Related

Android :: Service And Application Got Crash / Installing A New Apk

Sep 16, 2010

I m developing an app.in which service start at boot time. but after some time it goes crash and also it is installing a new apk.. i m not understanding what is the problem..becoz there are so many problems in this Plz take a look at it and help me..

I/DEBUG ( 30): debugged: Jun 30 2010 13:59:20

D/qemud ( 37): entering main loop

I/Netd ( 29): Netd 1.0 starting

I/Vold ( 28): Vold 2.1 (the revenge) firing up

D/Vold ( 28): Volume sdcard state changing -1 (Initializing) -> 0 (No-Media)

W/Vold ( 28): No UMS switch available

D/qemud ( 37): fdhandler_accept_event: accepting on fd 10

D/qemud ( 37): created client 0xe078 listening on fd 8

D/qemud ( 37): client_fd_receive: attempting registration for service 'boot-properties'

D/qemud ( 37): client_fd_receive: -> received channel id 1

Code...

View 5 Replies View Related

Android :: Starting Class1 From Service Without Application?

Jul 2, 2010

I have a call blocking application. It has 3 files:
1) class BlockMyCall extends BroadcastReceiver
2) class SimpleClass1 extends Service
3) PhoneBlock extends Activity

I start "PhoneBlock " Activity to call Service "SimpleClass1 ", which eventually calls "BlockMyCall" intended to block outbound calls (by setting result to "null").

I want to know if I can run the class1 from service without starting activity. If so , how?

View 2 Replies View Related

Android :: Expose Service Interface To Other Application

Aug 31, 2009

I have created a service and want to expose the interface to other applications. For one service I have done this successfuly. I just put the AIDL interface into the new project and all worked fine. Now for this service I've done the same but I get a java.lang.VerifyError when trying to use this interface. I think that the problem is that the AIDL uses a class (PolicyRole) that is only defined in the source code of the service. To compile the source that uses the interface I had to link against the code of the service but at runtime the error appears. Code...

View 2 Replies View Related

Android :: Need To Store Preferences - When Application Only Contains Service

May 12, 2010

I have a app that only consists of 2 services and a broadcast receiver (they check the internet periodically). I need to store preferences that can be shared across those services. Is this the same as for an activity? Just use getsharedpreferences()? This doesn't seem to be documented very well.

View 1 Replies View Related

Android :: Trying To Create A Service With Application Lifecycle

Jul 8, 2010

I am trying to create a Servicefor my application which will negotiate Bluetooth connections and data. I want this service's lifecycle to start and end with the Application, but still be able to have specific Activities listen for events that occur within this service (in addition an Activty should be able to call specific methods of the Service to write data or query connection state).

I started by creating AIDL interfaces for my callbacks and service, but I can't figure out exactly what I'm doing.

How is the best way to go about this? EDIT: To be clear, I do not specifically need (or want) more than one process for my application. Right now I don't have more than one; I'm just using AIDL because it is the only way I know of for a Service to communicate with an Activity.

View 1 Replies View Related

Android :: How Does Getting Application Reference From A Service Work

Jul 28, 2010

I have a local Service running together with my application. I also have a class derrived from Application class.

When the local service is created it gets and uses the Application instance using getApplication.

Can the app itself be terminated while my service is still running and what happens if so? Would getApplication return null?

View 1 Replies View Related







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