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
Feb 2, 2009
I am trying to launch an activity from another activity .. Within the com.android.SingleLauncher..
I have activity launch code as ..
CODE:...........
I have set the android:multiprocess="true" in the AndroidManifest.xml of TargetSL I don't seem to see the multiple instances of TargetSL, which i am expecting ..
All i see is 2 process, where i was hoping to see an instance of TargetSL, for each launch that was invoked by the singleLauncher!
View 3 Replies
View Related
Sep 14, 2010
is it possible to run multiple instances of the same app on android? What I mean if the app does not support multiple identities is it possible to install it twice and configure each instance separately?
View 1 Replies
View Related
Feb 19, 2010
I want to create multiple instances of an activity in the same process. Should I use FLAG_ACTIVITY_NEW_TASK flag like the code below?
CODE:...............
This code is executed in class A to create another instance of activity A.
This question, will this code create another task? As I understand is a process can only have one task. Does it mean the two activities will exist in different tasks? That's what I want. I want the two activities to be in the same process.
View 1 Replies
View Related
Jul 1, 2010
I was wondering is it possible to create multiple instances of a single Activity in Android?
I currently start my own inCall screen for a Voip Test by using the following code...
This allows me to start the Activity fine. However when I call it for a second it just returns to the Activity already created rather than creating a new Activity and placing it on the stack.
I would like to be able to create the activity multiple times so that I have two or 3 Activities on the stack and the user can switch between them, using Home, Back buttons etc... Is this possible and if so what am I doing wrong?
View 1 Replies
View Related
Jan 12, 2010
I've been attempting to use the <include> tag in some layouts and it seems that these are of limited use because of the flat namespace of the R.id.x approach.
Suppose I have a layout (attribs and xml namespace decl omitted for clarity).
CODE:.......
Now in my java code I have a conundrum. I am not able to identify each individual instance o f the children included layouts root view. In the include tags I can replace the root id with "row1" and "row2" so I can find the individual linear layouts using findViewById
eg:
CODE:.........
However, I can't easily access the two instances of the TextView which are children of row1 and row2 because all I have to play with is the single id "text"
ie:
CODE:..........
In this case, which instance (row1.text or row2.text) does this refer to, both of them, or none?
I guess I would need to use another means of accessing the children of row1 and row2.
View 3 Replies
View Related
May 13, 2014
I'm wanting to install 2 instances of the same APK.The app is: Star Wars Force Collection..Once you install the app and login to your account, theres no way to change accounts without uninstalling / reinstalling and logging into new account.
View 4 Replies
View Related
Jul 19, 2010
I love how SharedPreferences work in android and I would like to know if there is an easy way to save them to another file so I could load a previous instance of the prefs and vice versa. Basically when you load this file, all the preferences would change to how you had it before at once. I want to be able to swap 3 or 4 different versions of the same pref keys in this way. Is there an easy way to do this?
View 1 Replies
View Related
Jan 25, 2012
I was tinkering and editing an apk, and i managed to compile it and install it fine and it works and is suited to me. So i was wondering ( not too good with xmls ), is it possible to edit the manifest file to rename the apk so I can install multiple copies ( i.e. have the original unmodified one and the modified one at the same time ). I need this for testing purposes. Which lines do i need to edit exactly so the phone doesn't give me the "installing this application will replace the current..." warning, so I can multiple instances of it?
APKs are managed by package name, not by file name, but you can't simply change the package name in the manifest of a compiled APK.
Even assuming you manage to do it without messing up the file, which is not a simple task, there will still be code referring to the package name, so the app will crash.
View 4 Replies
View Related
Feb 16, 2010
I added an intent filter to one of my activities, so that when a user clicks a URL like "www.mysite.com", and if my app is installed, my registered activity can be launched. It works well.
I see that this creates a new instance of my registered activity though, every time a link is clicked. Is there any way to prevent multiple instances from being created - just recycle an existing instance if one already exists?
View 6 Replies
View Related
May 3, 2010
OK, here goes my first post.
I have the calendar syncing with my gmail calendar, which has multiple calendars inside (mine, my wifes, ours, baseball schedule, cavs schedule, etc..)
I also have the stock "mail" (not Gmail) application syncing with my exchange at work.
Since I got 7 home screens to work with, I wanna put my Gmail calendar on home screen #1, and my exchange calendar on home-screen #7. Sort of a seperation of home and work
So I put the stock widget on home-screen#1, and again on home-screen#7. But a widget is basically just a frontend for an app running in the background. When I go to home-screen#1 and select MINE, WIFES, and CAVS.......that selection affects the widget on home-screen #7 as well. I go to screen #7, tell it to display Exchange only.......and when I go back to #1, it is switched to exchange.
So.....any way to do what I want?
1) Have a calendar on home-screen#1 that shows my Gmail calendar(s)
2) Have a calendar on home-screen#7 that shows my Exchange calendar
View 2 Replies
View Related
Nov 12, 2010
I'm struggling with my app that launches multiple instances of the same Activity using the same intent. My main activity is of class type A and it does a startActivity() of two children that are of the same class type B. So we have B1 and B2 launched. If B1 and B2 are both paused (by pushing back button and making sure finish() is not invoked on them so they are truly paused), how can A uniquely bring either B1 or B2 to the foreground again? I do want to launch a new B activity. I want to uniquely bring B1 or B2 to the foreground.
so both B1 and B2 were created like this... Intent intent = new Intent(context, B.class); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(intent);
Now I want A to bring B1 (or B2) to the foreground/front so I use the below code, but how do I distinguish B1 or B2 when starting the activity? This only brings the last instance of B that was on top to the foreground.
Intent intent = new Intent(context, B.class); intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); startActivity(intent);
I've tried keeping around references to B1 and B2 and doing something like this, but this also only goes to the last instance of activity class B that was on top...
Intent intent = new Intent(B1context, B.class); intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); B1context.startActivity(intent);
I even tried this, but it still doesnt get me my unique B1 or B2... Intent intent = B1.getIntent(); // i.e. the original intent that started me startActivity(intent); // still only brings to front the last B that was on top.
View 3 Replies
View Related
Jul 22, 2009
I need to correctly be able to differentiate between emulator instances. I know it's easily done with real devices. With real devices, you can use getDeviceId or getLine1Number from TelephonyManager. With emulators, all the instances have the same device id, same subscriber id, and same line1 number. Is there a way to differentiate them? Using NetworkInfo, I can call the toString method and I get my ip and the port on the computer. The problem with that is that the port is always different. I would like something more stable. Like when you use "adb devices" in command line. Emulator #1 is almost always "emulator-5556" and emulator#2 is almost always "emulator-5554". Is there a way to get the same info I get from "adb devices" in my code? If not, is it possible to use a command line parameter to force the emulator to use a certain phone number?
View 3 Replies
View Related
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
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
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
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
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
Dec 25, 2009
Is there anything preventing more than one activity from binding to the same running service?
View 2 Replies
View Related
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.
View 3 Replies
View Related
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
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
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
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
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
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
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
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
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
Apr 14, 2009
My app has 4 activities on the stack A->B->C->D (top)
If you press home and re-enter the application, another instance of A is started, so the stack is A->B->C->D->A (top). I know this because when I press BACK, A is popped off and I now see D (instead of going to the Home screen).
What I want is that when the user re-enters the app, they re-enter on the same activity they were in before (D).
CODE:................
View 2 Replies
View Related