I have three separate applications A, B and C. All of them use service S. When A, B or C connect to service S and service S must start, it must gather credentials from the user using form F.
I want the user experience to go like this:
From the Android main menu, the user taps one of the applications; A, B or C.
Form F appears beca...
Is there a way I can test if there are any other activities in my app still alive? I am looking to stop a service in an onDestroy method, but only want to do this if there are no other activities from my app still alive on the stack.
I have the call stop the service in the main activity's onDestroy() method. This works perfect EXCEPT t...
I want to be able to start a short video on an incoming phone call. The video will loop until the call is answered. I've loaded the video onto the emulator sdcard then created the appropriate level avd with a path to the sdcard.iso file on disk. Since I'm running on a Mac OS x snow leopard I am able to confirm the contents of the sdcard....
hi
my application objective is to save location updates every ,let say, 20 minuets .
I used service and it worked fine , but when i lock the screen or it is locked automatically the service stop running .
when i unlock it , service runs again.
highlight on my code:
Service()
onCreat(){
call timer();
}
timer(){
code
}
How ...
Hello everyone,
I would like to know the best practices for running a Service every day at 4AM.
The way I think I should be doing it is to create a new repeating alarm using AlarmManager and having it run the service at 4AM. Problem is, I'm not sure where to put the code to set the alarm.
Do I do it in my main activity as one of th...
I'm trying to write an Android application that will use plugins. These plugins will just be other Android applications without a launcher. For instance my application can fire an intent saying "I want to get a list of images". Then, the user can pick from which application he/she wishes to find the list of images (typical facebook-plugi...
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 ...
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.
Thanks.
...
Hi y'all!
I'm coding on the android right now, and I have an Activity which starts and stops a Service. However, related to this whole application will be a non-android java application which runs in the background alongside this app. I need this separate activity to be able to launch a notification, but I don't know how to do this. I c...
I have a service MyService.java in Application "ServiceDemo". The manifest of this application looks like this
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.moto.dev"
android:versionCode="1"
android:versionName="1.0">
<application android:ic...
Hi all,
I have a service that starts and binds correctly when it's first called, but successive bindings to that same service fail when called by other activities.
The code:
activity.startService(new Intent().setClass(activity, ServerListenerService.class));
xmppServiceConnection = new ServiceConnection() {
public void...
Is there a good sample application for creating android services that run in the background?
...
Hello,
1/I don't want to notify user if this one is already running my app in foreground,
is it possible before create nofification to check if my app is not in front ?
2/if app is in background, is it possible to bring last state in front ?
I know that Os can destroy some Activity, but is it possible to restore last state, don't s...
I have a Service that creates AsyncTasks for downloading files. In activities, we create Runnables or Threads that we pass to Activity.runOnUiThread(). I can't access that method from a service, so how do I use AsyncTask correctly, (do heavy work without blocking the UI Thread)?
...
My application has an IntentService which runs periodically to
download data from a remote server. The download task is run inside an
AsyncTask which has reference to Application context only.
The data downloaded is for entire application and is displayed across
four different activities. When the download completes(AsyncTask
completes)...
can anybody give example with service in android?
Thanks
...
I have a service with AIDL callbacks. I would like to know if it is possible to make an AIDL callback implement another AIDL callback in order to avoid multiple callback register
For example :
A.aidl :
interface A {
void doSomething();
}
B.aidl :
interface B implements A {
void doSomethingMore();
}
IService.aidl :
interfac...
I would like to write an app on Android to upload my GPS location to an external website once every ~5 minutes. This needs to have as minimal an impact on battery life as possible, but it also needs to work without any user interaction. (Background: I'm competing in an Ironman triathlon which will take me about 14 hours to complete, and ...
I'm quite new to Android development.
When is it a good idea to create an Android Service instead of just using a simple Singleton class?
Take, for example, the data layer downloading information feeds from the internet.
Using a Service seems too much for some cases but sometimes I might need access to a Context so I'm a little unsure...
Is it reliable to save the connection state (i.e. save which connection is used and make connections and disconnections of sockets based on new states) ?
...