Android :: Stop An Application If Any Of Activities Were Killed By OS

Sep 10, 2010

I have an application with many forms implemented as separate activities. The form variables are dynamically built based on a database, and there are a ton of variables in the C++ side of the application (accessed via JNI). I don't see how saving out all of this data to persistent storage each time the onPause() or the onSaveInstanceState() of one of these many activities goes into the background is a smart use of processor time. And I don't see how even if I save the local variables for each activity during that time I'd be able to restore a single activity within the context of all the others.

I have set up a service that auto saves the files when I detect that the app has gone into the background. (I set a time stamp when onPause() is called in any activity and then clear the time stamp when onResume() is called on any other activity. If the time elapsed is more than a few seconds, I know I'm not the top activity any longer and the service saves the files).

What I'd like to do is continue on as normal unless the OS kills one of my activities. Since we don't always get notified of this, I thought it would be nice if there were a way to tell the OS that I'd rather you kill the whole app than just one activity.

Android :: stop an application if any of activities were killed by OS


Android :: Android - Massage Viberator - Application Does Not Stop Vibrating Even After The Process Is Killed

Oct 18, 2010

I will try to be as brief as possible... I have published a very simple android application it's name is "Vib-e-rator PRO". It's purpose is obvious, it can be used as a masssage vibrator or as an erotic stimulator...

My Problem is don't have an Android Phone to test my app in real time.

I have been recieving mixed comments from people. A few users say its working fine. But majority of them complained that the Phone would n quit vibrating even after the closing application.

Later i speculated that when ever the user switched off the vibrator and quit the app it would work as expected. If any user (most of em) directly closed the application ( either through the close option provided in the app itself or by pressing the END button in the phone ) without switching off the vibrator then it would not stop vibrating.

So i added myvib.Cancel() (myvib is the context for Phone Vibrator) in the exit block the close option provided in my app. For the other scenario, when it is closed by pressing the END button in phone, i have no idea how to solve it... So friends please advice me what is necessary to do... The comments i have been receiving from many users of my app is really embarassing....

View 3 Replies View Related

Android :: Test Application Killed / But It Got Intent

Dec 8, 2009

I created application with name Test, and has a class that extends broadcastreceiver that listen for PACKAGE_RESTARTED. I use Advanced Task Killer, and killed the Test application. But when I kill another application, for example gmail, the Test's broadcastreceiver got the intent (I logged it). Does it means that broadcastreceiver will never died?

View 4 Replies View Related

Android :: Froyo - Killed Application Detection?

Jul 29, 2010

On Froyo, we found that some new "Task Manager" apps are now using the ActivityManager.killBackgroundProcesses() to kill apps. When this happens, Intent.ACTION_PACKAGE_RESTARTED is no longer fired. How can I find out that my application has been killed? I tried to start a service, and I do see this message printed in logcat:

W/ActivityManager( 2426): Scheduling restart of crashed service com.example.android.apis/.app.RemoteService in 20000ms

However, the service is never restarted as advertised, if the app is killed using the killBackgroundProcesses API. (If I go into adb shell and kill the service process, the service will indeed be restarted ...) This looks like a bug anyway, because the notification created by the app is no longer removed like in eclair (the StatusBarService, and a bunch of other system services, depend on the Intent.ACTION_PACKAGE_RESTARTED broadcast).

View 14 Replies View Related

Android :: GPS Application Gets Killed On Screen Timeout

Apr 9, 2009

I can see on OMAP zoom2 platform, the moment screen timeout happens my application is getting terminated. I have a Google map based LBS application which is running on Zoom. I have implemented the interfaces given in gps.h to libhardware_legacy/gps.cpp .

GPS application talks to android framework and Framework talks to libhardware to get the GPS info. Now I can see that the moment screen timeout happens and the display goes off, my application killed. Actually from the framework the stop interface (hgps_stop() ) gets called on screen timeout.

I am wondring why this is happening, as I am not sending any stop request form my GPS application to the libhardware.

Is it something related to Android power manager, that android Power manager does not know about my application is running?

View 2 Replies View Related

Android :: How To Stop Service - When All Activities Are Finished

Jan 26, 2010

I am programming a game. I have a service for the background-music. When I press the home-button and leave my activities, the service still runs in background. How can I stop the service, when there is no more visible activity in my program and restart it, when the user goes back to my game (some activity of it)?

View 8 Replies View Related

Android :: Stop Service Only When There Are No Other Activities In App Running

Mar 13, 2010

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 that if a user launches my app, then launches a few activities in my app, then hits the home screen and RELAUNCHES my app, they will subvert my order and the main activity will now be above other activities of my app. From this state, if they hit the back button and 'back out' of my home screen they will trigger the onDestroy() method and kill the service even though there are other activities open on the stack. I want to avoid this by stopping the service ONLY if I am sure there are no other activities of mine open on the stack.

View 1 Replies View Related

Android :: Application Gets Killed - Because Provider Is In Dying Process

Apr 9, 2009

After long running the Media|Player (audio mode) the app I'm developing often crashes w/ the following error: > Process android.process.media (pid 14795) has died. > Killing <my app> because provider com.android.providers.media.MediaProvider is in dying process android.process.media

View 3 Replies View Related

Android :: Registered Broadcast Receivers After Application Is Killed?

Mar 25, 2010

Currently my application is configured to always receive the CONNECTIVITY_CHANGED action to force an update if the previous update failed because there was no connectivity. What I don't like about this is that the broadcast receiver gets to be called too many times although it is not needed. I was thinking to register my broadcast receiver only if an update failed using the Context.registerReceiver(BroadcastReceiver receiver, IntentFilter filter) method. But I'm not so sure if this is a good idea. I'm concerned that if my application is evicted from memory the broadcast receiver will be unregistered or lost and my application will not be notified about the future CONNECTIVITY_CHANGED actions. The update is done in a short lived service. So if the update fails, the service will register the broadcast receiver just before it ends its execution time. Can somebody explain what happens to my broadcast receiver after the application is evicted from memory?

View 4 Replies View Related

Android :: Alarm Manager Broadcasts Canceled When Application Killed?

May 15, 2010

I have two BroadcastReceiver registered. When the app is closed they both fire at the appropriate times and do the appropriate things. If the app is closed then killed (say with an AppKiller), the receivers never receive their broadcasts, and nothing happens. Presumably the same thing happens if the parent app is killed due to low memory, so how do I ensure those broadcasts are fired/received. The API states that even if the app is killed it should fire, does anyone else have experience with this situation? If it helps my manifest is:

<!-- receivers for AlarmManager -->
<receiver android:exported="true" android:label="Shift roster updating calendar."
android:name="com.skooter.shiftroster.backend.service.UpdateCalendar" >
</receiver> <receiver android:exported="true" android:label="Shift roster checking alarm."
android:name="com.skooter.shiftroster.backend.service.SetWakeup" >
</receiver>
and nothing esoteric is going on in the AlarmManager/BroadcastReceivers

View 1 Replies View Related

Android :: Start And Stop Music On Application Launch And Stop

Jan 5, 2010

In my application i have several activities and i want to start background music whenever my *Application* is launched and stop music whenever *Application* is paused or stopped.

View 4 Replies View Related

Android :: Want To Relaunch Application When Killed By Android

Aug 18, 2010

I am working on Gps based application which runs all the time in background. But in extreme low memory case(or when i open many apps) my app is killed by the android system. I want to relaunch my app when it is killed by android system.I goggle it for this but don't get any solution.Any help would be appreciated.

View 5 Replies View Related

Android :: Multiple Activities In Application

Mar 17, 2010

I seem to be missing something obvious here, why would I want more than one activity per application in Android? Does somebody have some solid examples?

View 3 Replies View Related

Android :: Activities In Application - Which Should Launch First?

Nov 9, 2010

I created an app with one activity, and it works just fine. Having though more about the app, I decided to add another activity which be the welcome screen of the app, with a nice logo and some buttons. This app should direct the user to the activity I mentioned before. The only trouble is - I can't find out where and how can I determine which activity should launch first, the moment the app loads. Do I need to create the entire app from scratch, but this time programing the home activity first?

View 1 Replies View Related

Android :: Kill An Application With All It's Activities?

Jun 23, 2010

I want to offer the user an option to exit the application as I need to delete some sensitive data, which is stored in the SharesPreferences as long as the application needs it.

As soon as the user wants to exit, the password in the SharedPreferences should be wiped and of course all activities of the application should be closed (it makes no sense to run them without the known password - they would crash).

How can I do that?

System.exit(0) and finish() only exit the current activity - useless. I know there is a taskmanager app. How is that one doing it? It's able to kill the whole application ...

View 4 Replies View Related

Android :: Closing Old Methods / Activities In Application

Nov 24, 2010

Need help closing/accessing my views in a simple app (included an img of my program layout) but I might have been too confusing. Basically, I have an app that has a main menu where the user can click a button to open a camera. The user then snaps a photo and it is displayed on a page. The user will then click another button that detects faces. If faces are detected, the user is sent to a final page that shows the cropped face, etc. I give the user the ability to return to the main menu or snap a new photo.

Let's say a new photo is snapped and the user does it a few more times. Now I have multiple saved instances of old snapped photos (presented on the layout). How do I kill the previous instance (the layout from before he decided to snap a new photo)? So when I try to close the app it doesn't go back to the previous instance (displayed layout of said snapped photo). I am so confused on this one thing.

View 1 Replies View Related

Android :: List All Activities Exposed By An Application

Nov 17, 2010

I think that it should be possible to get all the activities from 'third-party' application, described in the manifest file. I can't figure out how.

for example: List<Activity> aList = packManager.getActivitiesForPackage("package.name");

View 2 Replies View Related

Android :: Close All Activities In Tabbed Application

Feb 20, 2009

Can someone tell me how to close all activities running under a tab?My initial activity does not need a tabbed view. Therefore, to initiate a tab for the next (remaining) activities, I call a class that extends TabActivity, from the first tab.All this class does is to assign and call activities based on the tab click.Currently, to close all activities i am using StartActivityforResult.But in this case, while calling activites from the TabHost, setContent does not accept a result code as a parameter.Help me to solve this one. My application is stranded in a blank screen before closing. i.e. in the TabActivity class.

View 2 Replies View Related

Android :: Creating Options Menu Available To All Activities In Application

Jun 20, 2010

I want to have an options menu that is available to all Activities in my app (on pressing the MENU button). I've been doing this by creating it in onCreateOptionsMenu(Menu menu) for each Activity but this seems redundant. Is there a way to create it in one place and have it available in all Activities?

View 1 Replies View Related

Android :: Application Background Image With Transparent Activities

Oct 29, 2010

I have run into an requirement of my application that i cant find a way to do this.

I need my application to be fullscreen and no title bar (done), and this application will have a background image. However, all the activities/views of my application must be transparent/translucent so the application background will be visible all the time behind the information i am displaying.

Basically i would like to have this behavior

http://www.geeky-gadgets.com/wp-content/uploads/2010/05/amazon-kindle-android-app.jpg

supousing that the image you see is not the phone wallpaper, but the application background image. What would be the application configuration in the manifest file and what would be the configuration for eacy activity/view?

I also noticed that, i need to setup each activity to be fullscreen without title bar. Is there a way to do this globaly in the application so all activities will behave this way?

View 1 Replies View Related

Android :: How Do I Get Multiple Icons To Launch Different Activities In One Application?

Jul 17, 2010

I have an application with two activities and I'd like to be able to have two icons appear in the launcher, each launching the respective activity within the app.Specifically, I want one icon to launch my main app, and another icon to launch my settings activity. Is this possible?This creates two launcher icons, but they both run my main app instead of the second icon running my settings app. I've tried just having the launcher category but then I don't get an icon so it looks like I need the main action as well.Is this the right approach or should I be declaring two applications in the manifest instead?

View 2 Replies View Related

Android :: Subactivity - Created An Application Which Consists Of Several Activities

Aug 3, 2009

I created an application which consists of several activities. If I start a subactivity named DlgTitleTags from main activity everything goes well.

Another case is when I start a subactivity DlgLibrary and then from DlgLibrary DlgTitleTags the execution fails on line:

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

In the first example this line executes without errors so I'm wondering what could be wrong here.

This is the copy from log:

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

View 1 Replies View Related

Android : Application With Multiple Activities - Single Launcher

Oct 6, 2010

I have an application which has multiple activities associated with it. When the user clicks on the launcher icon I want the last used activity of the application to be shown.

What's the best way to accomplish this?

View 1 Replies View Related

Android :: Pass Data Between Activities In Droid Application?

Jun 3, 2010

How to pass data between activities in an Android application?

View 1 Replies View Related

Android :: Share Files With Different Activities Running / In Different Processes In Application

Mar 16, 2010

I would like to share a cache file across activities, which are running in different processes but in a same application.So, is there any way to make it thread safe (probably not "thread safe", should we call it "activities safe" or "process safe" ?

View 2 Replies View Related

Android :: Design Application With Multiples Activities And Operations Running In Background?

Nov 22, 2010

I am designing an app that will have some activities separated in tabs. Some of them will have to perform tasks in the background will the user is in another tab. What is the best strategy for designing an app like this? I was thinking about using a service but it can be killed by android dalvik, isnt it?

View 1 Replies View Related

Android :: Switching Activities / Passing Data Between Activities

Jun 30, 2010

how to call BarCodeScanner, and return the value to a field.so now, i have a toast that says "successful scan" and then i want to pass the result to a new activity. when i comment out my intent, everything works (minus the passing of data/switching of screen, obviously) but when i run my project as is, it FC's no errors reported by eclipse in code or xml. any insights?

View 2 Replies View Related

Android :: Android - Accessing Single Database From Multiple Activities In Application

Dec 15, 2009

I have a todo list type application that stores all of the note data in a sqlite3 database. Each activity in the application needs access to the database to edit different parts of the data in real time.

Currently, I have each activity open its own DBManager object (the helper class I created to manage the database). This is causing problems though and I would like a slightly more global access solution so I don't have to keep opening/closing/creating a database.

I'm considering several options, and would like to hear pros and cons of each as well as other suggestions.

Singleton style. Have a wrapper class that returns a reference to the only database manager so any activity that needs it can use it.

Static Manager. Have the manager class be entirely static members and have it open the database on load. Easily accessible by anyone that needs it (which is everyone).

Merger between 1 and 2. I could make a database manager class that initializes the member singleton instance of the database and all of the data manipulation methods were static. Then I wouldn't even need a reference to the singleton to access the database.

View 3 Replies View Related

Android :: Too Many Activities Being Started When Launching An Android Application

Dec 24, 2009

You can see property action android:name= property is "android.intent.action.MAIN" and categoryandroid:name= is "android.intent.category.LAUNCHER" for all activities.When application starts up, it calls First Activity. Then calls useless Activity such as ThirdActivity or Second Activity.In this case, is my manifest.xml correct?Or, do I need to set another property to Second and Third activity? If so, what is that?I wonder manifest.xml file is right for my case.

View 3 Replies View Related

Android :: Launching Unknown Activities From An Android Application

Apr 5, 2010

I want to make an android application that shows a listing of applications (downloaded from the android market) and launches the one that the user selects. From what I've read, I'd have to use intents like this:

Intent intent = new Intent();
intent.setClassName(packageName, className);
startActivity(intent);

I just want to be able to launch the applications, not a specific activity that they could have.

My question is: How could I launch these applications if I don't know their packageName or className? or maybe, how could I get to know their className and packageName, if it's a closed source application that I didn't develop.

View 2 Replies View Related







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