Android :: Aidl's - Service And Multiple Packages

Jul 20, 2010

I've created a service that is meant to communicated to an activity using aidl's and callback functions. I got it working just fine with my test activity in the same package. But I was wanting to expose this service to different activities running in a completely different .apk file. Is it possible to accomplish this? What does the separate package need to bind to my service and register the callbacks? Or am I going about this completely wrong and should I try a different method for conveying information back and forth between two packages.

Android :: aidl's - service and multiple packages


Android :: Access A AIDL Service From Different Packages?

Jun 18, 2010

I have created a service which exposes few AIDL defined interfaces. I want to access this Service from an application with different package. I have no clue how to achieve this. I want to see an example on this.

Unfortunately all examples I see has client application in the Service package it self:(

Could you please share some sample/example code on this?

View 7 Replies View Related

Android :: AIDL In Multiple Projects In Eclipse

Mar 16, 2010

I have problems with the following: I want to create to applications. One with a Android service and one with a Activity that will use functions on the Service. Before I splitted this in to applications I got everything working in one application. I can call functions (that are definned in the aidl - file) on the service without problems.

Now the problems coms. I splitted the application into two parts, a Service application and Gui application. The bindins to the service (in the gui application) works and I see that the service is getting created. Then in the onServiceConnected function of the ServiceConnection class I created the following:

mService = IMyService.Stub.asInterface(service);
And this gives me the following exception:
03-16 13:53:05.549: ERROR/AndroidRuntime(881): java.lang.NoClassDefFoundError: MyPackage.IMyService$Stub

It looks like he can't find the Stub class in IMyService. But the Stub is part of the java file generated out of the aidl-file. Why I get this exception or how I can resolve this?

View 9 Replies View Related

Android :: Multiple Packages In App

May 27, 2010

I am including a class in my app that another developer has made freely available. His class has a different package. Will this cause any issues on Android, the market, etc? Does every single class in the app need to be my own package?

View 2 Replies View Related

Android :: When To Use An Aidl Based Service?

Jul 26, 2010

Under what circumstances would using AIDL to define a service interface be the correct decision (rather than just creating an extension to the service class)?

View 2 Replies View Related

Android : Indicate In Manifest Multiple Packages?

Oct 22, 2009

How do I indicate in the manifest multiple packages

View 4 Replies View Related

Android :: Aidl Remote Service Call Namespace

May 16, 2009

I didn't find a sufficient answer to my problem in any posts, if there already is one, please excuse and point me to it, thanks. I made 2 projects. project 1 hast an activity that binds to a service from project 2 on a button click (all just for testing).

How can I make project 1 know (import) my TestInterface (from TestInterface.aidl out of project 2) for usage in: "TestInterface mService = (TestInterface) TestInterface.Stub.asInterface(service);"

without adding project 2 to the build path, because if I'd have an installed service without the project code, I couldn't do it this way, too...?? I read in one thread that TestInterface.aidl should just be added to project 1, too, but if I do this, in DDMS enforceInterface() complains and seems to just see/use the interface from project 1 and it doesn't work.

2. issue:...............

View 9 Replies View Related

Android :: Implement AIDL For A Service To Run Outside Of Your Apps Life?

Nov 9, 2010

I have a service that will send out notifications with timed tasks. I need this service to run outside the life of the application, but I only need to access the services functions during the lifespan of the app. Is a local service enough or do I need to implement AIDL?

View 2 Replies View Related

Android :: Custom Classes Passed From Service To A UI Threads Via AIDL

May 30, 2010

I have a service that regularly queries a web server for new messages. The service stores the new messages in an arrayList. These messages are implemented using a custom class, storing all kinds of metadata (strings and longs).

An activity then connects to this service to retrieve those messages and display them to the user.

I have an .aidl file that describes the interface that the service exposes.

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

The Message class extends the Parcelable class which should allow for the IPC transfer.

The problem is this: Eclipse gives me an error saying that the type of List<Message> is unknown. Any imports are marked as invalid.

View 3 Replies View Related

Android :: How To Identify Which Client Called Into A Remote/AIDL Service

Jul 26, 2010

In the implementation of my remote service's published API, is there a way to identify which client called a given method? For example, is there a way to obtain a unique ID or address of the caller? I already cache an AIDL callback reference to the client, but not sure how I can use this for identification.

View 4 Replies View Related

Android :: Lot Of Unused Code Is Generated When Aidl Tool Is Run Againt A .aidl File.

Jul 16, 2009

This is my aidl file.

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

View 3 Replies View Related

Android :: Android - Updating TextView String Through AIDL Service

Aug 12, 2010

I have an app that uses a TabHost. Several of the Tabs share a common HUD. I am using a service to periodically update those values by calling an AIDL function when ready.

However, since several of the Tabs are using the same HUD I would like to abstract that part out.

I thought about having the HUD.xml use a String resource as it's value and then the abstracted class can update the String resource. However, apparently Android can not update String resources programatically.

The only alternative solution I see would be using SharedPreference.

I have concerns accessing a Database everytime the value is refreshed.

View 1 Replies View Related

Android :: Multiple Instances Of Service?

Apr 15, 2010

I would like to do this, let me know if it possible in android?

App1 --> bindService() or startService() to AndroidService1 App2 --> bindService() or startService() to AndroidService1 (same service)

I would like App1 and App2 to get different instances of AndroidService1. Why I want to do this is say App2 doesn't need the service any more & it calls stopService() then App1 should still continue to work with its own instance of service app.

View 2 Replies View Related

Android :: Multiple Permissions Of Service?

Aug 13, 2010

I have a service which both downloads a file and saves it, and it seems I can only specify one permission.

<service android:enabled="true"
android:name=".DownloadService" android:permission="android.permission.INTERNET">
</service>

or
<service android:enabled="true"
android:name=".DownloadService" android:permission="android.permission.WRITE_EXTERNAL_STORAGE">
</service>

View 1 Replies View Related

Android :: Multiple Activities Binding To A Service

Aug 3, 2010

I have a service component (common task for all my apps), which can be invoked by any of the apps. I am trying to access the service object from the all activities, I noticed that the one which created the service [startService(intent)] has the right informaion. But rest does not get the informaion needed.

My Code is as below:

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

If I invoke startService(intent). it creates a new service and runs in parallel to the other service.

If I don't invoke startService(intent), serviceObj.getData() retuns null value.

View 1 Replies View Related

Android :: Service Interacting With Multiple Activities

Jun 29, 2010

I'm trying to refactor/redesign an Android app. Currently, I've one UI activity (Activity 1) that creates a DataThread. This thread is responsible for network I/O and interacts (provides data) with the UI activity via a handler.

Now, I want to add another activity (a new UI screen with Video) - Activity 2. Activity 1 is still the main activity. Activity 2 will be invoked when the user clicks a button on Activity 1. Activity 2's data also comes from the DataThread.

My idea is to put the logic of my DataThread inside an Android Service (DataService). My question is - can more than on activity bind to my DataService at the same time? Is there a way to tell the service to provide data to a specific activity only?

View 1 Replies View Related

Android :: Access Service Across Multiple Applications

Apr 19, 2010

I have a service that i need to access across multiple Applications. Can anyone tell me how this can be done?

View 6 Replies View Related

Android :: Multiple Applications Using Single Service

Jan 14, 2010

I have to write an application which starts a service. There will be other applications which have to use the service. Is it possible to write an application that only starts service and finishes with the service running?? How can i communicate from the different applications to the service? Is it possible to expose an interface from the service so that application can pass data to the service?

View 2 Replies View Related

Android :: Multiple Binds To Single Service?

Dec 25, 2009

Is there anything preventing more than one activity from binding to the same running service?

View 2 Replies View Related

Android :: Service Gets Instantiated Multiple Times

Sep 27, 2010

IIUC, there should only be one instance of a given service, it is a singleton. However, my (audio engine) service gets instantiated multiple times, although I do nothing for it. When the service crashes (for example when I uninstall the app through adb), it gets scheduled for restart ("Scheduling restart of crashed service.. "). I understand this is an effect of the service being sticky. After that, when my app starts, it calls startService() and bindService(), and the service gets appropriately started and bound. But the service is then reinstantiated and onCreate() is called repeatedly, as many times it was scheduled for restart.

Each instance then wait for clients to bind and register, but onBind() is only called in the "main" service instance. The additional instances wait a bit for client to bind, and since that doesn't happen, they call stopSelf(). But stopSelf() has absolutely no effect in these "dead" instances, onDestroy() is never called.
The "main" service instance does work as expected, and when it decides to call stopSelf(), onDestroy() is indeed called. Worse, all these dead instances accumulate, they never gets destroyed. Therefore, their only possible end is a crash (which happen every time I launch/install through adb), and thus scheduled restart.
So that in the end I get many of these dead instances, which are restarted progressively once by minute approximately.

View 3 Replies View Related

Android :: Best IM App For IM Junkie (multiple Accounts On Same Service)

Jul 22, 2010

I not only have accounts in all the major IM vendors/formats, but I also have multiple accounts with each service. I have found Fring and Agile, but they appear (from use and FAQ) that they can only support one user per service. Agile is awesome, as it understands how to send video/camera shots directly, and fring seems not to be able to as easy. But that is secondary to being able to load all your accounts, eh? I guess I'm looking for Digsby functionality for Android!

View 4 Replies View Related

Android :: Bind Service To Multiple Activities Advice

May 19, 2010

I'm new to Android development and am working on a small test project. I have a service, which communicates with an SQLite3 database, and two activities. A main activity which fetches database information via the service and displays it and a second activity which allows me to add data to the database via the service.

Currently, I have a singleton class which implements the ServiceConnection interface and I'm binding this to the service in the the main activity using the bindService function. Because it's a singleton, I can then use this service connection in both the main activity and second activity to work with the database and it all seems to work quite well.

However, I'm all the time aware that the service connection is bound to the main activity and I'm wondering if this is the wrong/bad way to do it? Would I be best off having two service connections, one in each activity, and binding each to the service?

View 2 Replies View Related

Android :: Handling Events From One Service For Multiple Activities

Jun 10, 2010

I have a class A which extends TabActivity and creates Activities B, C and D as tabs in its onCreate() function. Also, class A initializes another service handler class S which is responsible for establishing a connection to a service and implementing callback handlers for the service. Any of the Activities B, C and D should be able to receive events from the service and update accordingly. If I receive any event in class S from the the service then I want to call a function in Activity B which would be responsible to update the UI elements in Activity B based on the event received. You can assume that the user is in Activity B when the event arrives.

Can I call an activity function like the following in the stub handler for the callback in my class S -

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

View 4 Replies View Related

Android :: One Local Service Multiple Binding Activities

Nov 20, 2010

I have a local Service to which multiple activites needs to bind. In the first launched Activity, bindService returns true and onServiceConnected is called. But in any additionally launched activites bindService returns false, and I can't get a reference to my Service.

How can multiple activities simultaneously be connected to a local Service?

View 3 Replies View Related

Android :: Want Connected To Phone Service Between Multiple Activities?

Jan 15, 2010

I have multiple activities and one service.. In MainActivity I successfully connect to service (using a class what implements ServiceConnection + bindService() + startService()) but when i try to apply same method in other activity i see in LogCat a error... It Is possible to connect to service in an other way: something like to make static my CounterServiceConnection object in MainActivity and use it in the second one?

View 2 Replies View Related

Android :: Activity Bind To Service - Multiple Thread Design

May 28, 2010

A new question about android and services. Currently I'm developing a App that should send images to a server. It should also be possible to send more images parallel. I made a service that creates for every image a new image. The activity can bind to that service and gather information about the progress. I want to show the current status for every image in a notification (and when the user clicks a notification, an activity with the progress for that image should be shown). But I get several problems with that approach. There are errors with binding, the notification pending event starts the activity completely new, so I lose information about currently sending images and so on. How I could design in a appropriate way.

View 1 Replies View Related

Android :: Designing Service For Consumption On Multiple Mobile Platforms

Apr 27, 2010

I am building and designing a (mostly) read-only interface to some data. I'll be uing ASP.NET MVC to build a psudo-restful API. I'm wondering if anyone can provide some resources for building full-client applications for various mobile platforms, iPhone, Android, Blackberry, Windows Mobile, etc. I'm thinking that serving up XML data is going to be the most simple and universal, but parsing XML in objective-C for example doesn't sound like fun to me, but maybe there are some good libaries out there to help ease this task?

In other words, what formt will be the quickest to implement on the client side? Are there any JSON parsrs for iPhone or Android? I know there are .NET JSON parsers, but not sure about other platforms -- is ther another format that might better? Or should I stick with pure XML and deal with it on each platform differently?

View 5 Replies View Related

Android :: Same Service In Multiple APKs / Want "best One" To Launch

Dec 17, 2009

I have the same service in multiple APKs. In each of the APKs, I am going to launch the service. Because the APK are difference "applications" that have been installed & upgraded at various times, the service implementation in each may be different. I am trying to figure out a way to make sure startService() runs the implementation that is newest.

I have been fiddling around with PackageManager and Manifest meta-data and categories but I can't seem to get my head around it. It's really a leader-election problem... has anyone ever done this ? Any clues?

View 8 Replies View Related

Android :: Errors When Use The Aidl

Jun 17, 2009

I create an aidl file named mp3PlayerInterface.aidl. Then I try to use the aidl tool to parsing the aidl-file to java-file. The error"mp3PlayerInterface should be declared in a file called com mp3playermp3PlayerI nterface.aidl."happened no matter use the aidl-command derectly or eclipse.

View 2 Replies View Related

Android : Can't Use Parcel In Aidl / Way To Fix?

Aug 20, 2009

I sent a intent to call a service interface which returns a parcelable object.

but get errors...

View 2 Replies View Related







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