Android :: Framework Support For Detecting Starting And Stopping Of Activities
May 13, 2009
To support usability studies on what applications are used, i want to write a service that logs when an activity is started and also when it has finished. This is to understand how the users are using the device:
One straightforward option is to have the applications modify, to write this out. But this is tedious having to modify all applications and will not work esp with third party or built in applications.
Is there any alternatives that makes this simpler and easier?
BTW: Looking at the android framework source ActivityManagerNative seems to be invoking a Binder interface when an Activity is started and finished. Any information on what this service is? Is this something i can tap into?
View 8 Replies
Aug 14, 2010
I have a service running (Socket), this is how i start the service.
CODE:.......
But this doesn't seem to stop my service? Am i missing something? I need to destroy my service as soon as the home button is clicked.
View 1 Replies
View Related
Mar 29, 2010
I am rotating a view using rotateAnimation with this code new RotateAnimation(0, 360, w / 2, h / 2); I want to rotate this view infinitely, so i put setRepeatCount(RotateAnimation.INFINITE);
But the problem is after every one complete rotation, its stopping and starting again, means by default rotateAnimation have AccelerateDecelerateInterpolator(). I feel because of this. So if i put setInterpolator(null), its throwing null pointer exception. How to solve this.
I want to rotate my view without any lag.
View 4 Replies
View Related
Oct 28, 2010
I have a Service which tracks the location of the user. Currently, the Service boots when the application starts and stops when the application terminates. Unfortunately, if users keep the application in the background, the Service never stops and drains battery.
I would like the Service to stop when my application is not in the foreground. I was hoping the Application class would let me Override onPause and onResume handlers, but it does not have them.
View 1 Replies
View Related
Jan 20, 2010
I have one simple question regarding Java TimerTask. How do I pause/resume two TimerTask tasks based on a certain condition? For example I have two timers that run between each other. When a certain condition has been met inside the task of first timer, the first timer stops and starts the second timer, and the same thing happens when a certain condition has been met inside the task of second timer.how do I pause timer1 while running timer2 and vice versa while timer2 is running? Performance and timing is my main concern as this needs to be implemented inside another running thread. By the way I am trying to implement these concurrent timers on Android.
View 4 Replies
View Related
Jul 13, 2009
I'm writing a game using the drawing method from Chris Pruett's opengl spritemethodtest demo. The Activity running my opengl view works fine on initial load, and about half the time after turning off the phone and turning it back on. However, the other half, it locks up. I'll get a "lock_layer timed out (is the CPU pegged?)" warning that keeps repeating. I tried running the debugger to find the exact line that the error is occurring on, but the strange thing is that this error won't occur if I'm running the debugger on my G1. It only happens under normal operating conditions. Any help would be appreciated, as this bug really has me stumped.
Here are my onPause and onResume activity methods:
CODE:.............
Here's a stack trace, running from the initial onCreate call to the lockup (I added some extra Log warnings to illustrate when different lifecycle methods are being called):
CODE:..................
View 2 Replies
View Related
May 8, 2012
I have an Acer A100 tablet that I've upgraded to ICS (the upgrade went very smoothly, by the way). But under both ICS and the original Honeycomb, the Android OS has an annoying habit of starting a bunch of apps automatically. Facebook, Google Maps, media players and a whole host of apps that I do NOT want to start all by themselves. I found an "Advanced Task Manager" that will check every 5 minutes and kill unwanted apps automatically. But every time I check it there are still half a dozen apps running in the background that I don't want.
If it were just one or two apps, I would simply uninstall them. But it seems like half the factory apps are intent on restarting themselves no matter how many times they're turned off. My Acer has a very small battery, and I suspect I'd get much better battery life if it would only run the apps that I start manually.
Other than email and the system update manager, I really don't want any apps running in the background. And when I turn an app off, I want it to stay off until I restart it. Is there a way to edit the list of programs that start automatically? Do they all have to be disabled individually? I've checked a few of the apps, and don't see any way to disable the "automatic log-in", "check for new data" or whatever each program might call it's annoying insistence on starting whenever it wants to.
View 3 Replies
View Related
Aug 14, 2009
I want to write an Android application using a mouse (like the way that Windows detects the actions of clicking on a right button and a left button of the mouse). However, I cannot find any library of Android OS detecting these actions.
View 3 Replies
View Related
Oct 23, 2010
Understanding how to declare activities in the manifest file, how to set the appropriate flags when starting them through intents, is quite challenging in all but the default cases. The combination of all these settings and flags is daunting. I've been developing for Android for over a year now, have read the application fundamentals and the reference guide for 'Intent' quite a few times and still I don't have a good grasp of which manifest settings or intent-flags should be used for starting activities in many situations (workflows). Is there some source/document that can explain certain work-flows (ways of navigation through activities and tasks), that shows examples of how to configure and start activities?
View 4 Replies
View Related
Oct 21, 2009
If an android device wants to support multiple cameras, then how does the API support this? Right now the framework API is a simple static method to create an instance of camera Camera.open(). I see couple of options:
1. Using camera.setParameters() to set a name/value pair that instructs which camera to choose?
2. It would be nice and cleaner perhaps if this was done right on the open() method perhaps with additional enum.
Obviously option # 1 would not result in any addition to the API. Does this use sound right to you to support multiple cameras?
View 4 Replies
View Related
Jul 27, 2010
I am going to transform my website to mobile phone supported. My website consists of lots of java script and ajax stuffs so looked for a specific JS framework to support all the mobile os (android,ios,windows and blackberry).I googled and found some frame works like phonegap, sencha touch,JQTouch and appcelerator titanium. Can you people help me to find out the right one which will be suitable for my needs.
View 1 Replies
View Related
Apr 20, 2010
I have an application consisting of two activities (call them Display and Preferences) and one service which listens for incoming phonecalls. When it detects one it launches the Display-activity with a delay of 3sec in order to let the PhoneApp launch first. The Display- activity is transparent so the user can still use the PhoneApp as normal (ie answering the call) even though my Display-activity is "on top". So far so good
Now to my problem. Lets say that the Preferences-activity is active when there is an incoming call. The PhoneApp is launched on top of the Preferences-activity as expected. However when the Display-activity is launched the Preferences-activity pops up as well, hiding the PhoneApp. My question is if it is possible to work around this in some way? Since I do not want my Preferences-activity to block the PhoneApp and hence making it impossible for the user to answer the incoming phone call.
View 3 Replies
View Related
Feb 24, 2010
I am currently showing a notification. When the user clicks this noticiation, the application is started. The notification persists, to indicate that the service is running in the background.
CODE:..............
However, I have detected a case where a bug appears. If the user starts the application through clicking the normal icon, and while the activity is running clicks the notification, then a new activity is started without the earlier one exiting, the later being on top of the earlier. And that is not all: Further clicks on the notification will create additional activities and place them on top of those already running. How can I prevent this? Is there a nice check to do to see if a certain activity is currently being shown or is loaded?
View 1 Replies
View Related
Nov 18, 2009
Can some one point towards any documentation/resources/ threads that can explain how a new sensor support can be added in android sensor framework?
View 2 Replies
View Related
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
Jul 7, 2010
I have a single bitmap with several individual pictures in (each one is an option) and I would like to detect when the user touches these pictures. I am using the event.getX and event.getY to detect where is pressed, I know the top left X Y and bottom right location of each of the pictures. What is the best way of detecting which one is pressed? (i.e. tieing up the event press and which picture has been pressed?
View 2 Replies
View Related
Jun 3, 2009
There are return values and such that allow handling if SensorManager sensors and location providers aren't available, but what about the camera and microphone for audio recording? Is there a way to detect those in software, or are we just to assume that every device running Android (even the rumored set-top box) is going to have a camera and microphone and try to use them?
In the case of the camera, it would seem that Camera.open() returning null would indicate the lack of hardware. I don't know if that assumption is valid or not, though, considering it isn't documented as such.
In the case of the microphone, though, I don't see anything that could possibly be checked. The same goes for the camera if you're wanting to do video with the MediaRecorder class.
View 2 Replies
View Related
Sep 2, 2009
I'm trying to figure out how my Activity can detect if it was launched by an alias as opposed to by the main icon.
Is it possible to do this?
CODE:............
alias1 and alias2 appear as expected in the Launcher, but I don't see any way in multipleEntryPointTestActivity to tell which of these icons launched the application.
View 2 Replies
View Related
Oct 31, 2010
I have hooked in a ScaleGestureDetector to an OnTouchListener as instructed in Android documentation. For some reason the ScaleGestureDetector does not always detect end of a pinch gesture. This happens mostly when pinching fast from large to small.
The effect is that after I have released both fingers the detector does not fire the gesture end event. If I touch the screen with one afterwards it still thinks I'm continuing the scale gesture (keeps firing onScale events). I have to do another gesture to get the detector to fire end event.
I have added logs to the OnTouchListener and when the scale gesture gets stuck I still get motion events normally when using one finger and event.getPointerCount() is 1.
I have made sure that I don't have any other listeners intervening. View that has the onTouchListener is not the only view on screen but this effect happens also when I'm very careful to begin and end the gesture inside this one view.
Is there any way to improve the end detection?
Or if there a way for me to manually set the ScaleGestureDetector to fire onScaleEnd and change scaleGestureDetector.isInProgress() to false?
View 1 Replies
View Related
Nov 26, 2009
Is there a way to detect whether a image was pulled from the folder res/drawable or res/drawable-hdpi?I am trying to save space and have a program that is using some hdpi bitmaps and some mdpi bitmaps. When an image is placed in drawable-hdpi it automatically replaces the mdpi version. I need to know when this happens beacuseI am using bitamp.resize() to fix the image sizes.The problem is that the getDensity() method (in the if statment after the && ) returns the screen density and I need the original bitmap density. This allays matched the screenDPI and returns false. I have a lot of artwork and do not want to duplicate everything for every size screen. I am trying to just create hdpi bitmaps for the ones that don't look good when re-sized.
View 2 Replies
View Related
Oct 20, 2010
I'm trying to find out if the user is still within range of his own area code. Detecting roaming doesn't solve the problem since the user may still be in the same network with a different area code. I thought about getting the user's coarse location to find the city he's is in but this approach needs Internet access and might not be fast enough (this is done as the user is making a call and needs to finish before the call is made). Is there any way I can do this with just the info from the cellular network?
View 7 Replies
View Related
Jun 6, 2009
I am writing a Security-oriented application for Android that is supposed to detect abuse of SMS sending.
In my work I encountered the problem of not being able to detect outgoing SMSs sent not through the use of conventional applications, i.e. merely by using SMS Manager's sendTextSMS method.
The conventional SMS applications add the contents of the sent SMS to the SMS Provider after they send it but I can assume that malicious applications will not do that... and neither will they provide the pending intents to the sendTextSMS method to be broadcast upon sending/ delivery.
My question is, is there any way I can detect the sending of the SMS without relying on the SMS provider?
View 2 Replies
View Related
Oct 16, 2010
As far as i know there is no way to detect when an outgoing call is accepted at public API level. I can detect incoming calls (with PhoneStateListener), outgoing calls by NEW_OUTGOING_CALL intent, but i can not find a way to distinguish the dialing and connected phone states.
View 4 Replies
View Related
Oct 11, 2009
I have an SQL which uses something like "LIMIT 100". If the cursor returns 100 rows, is there an efficient way of distinguishing between whether the LIMIT caused it or not? I suppose I could just call LIMIT 101 instead but I was hoping for a nicer way.
View 2 Replies
View Related
Aug 27, 2010
I was trying to come up with an app that works on the call that a user gets on his phone. For this I wanted to know whether it is possible for me to get intimated when a call comes to the phone and is it possible to intercept the same.I tried to go through quite a few forums but could not get conclusive evidence on how to achieve this.Does anyone have an idea whether this is feasible and if so then how?
View 2 Replies
View Related
Feb 18, 2010
I am testing an android device with eclair using the 2.1 CTS version. When CTS completes a set of tests and restarts the device a "device disconnected" messages appears on the CTS console. However after the device completes the restart to the android home screen CTS does not detect that the device is back online. I have to physically disconnect the USB cable and re-connect it. Do you think this is a device side issue or a USB driver issue on the Ubuntu machine (intrepid) where I am running the CTS?
View 2 Replies
View Related
Apr 5, 2010
I have a AppWidget, after I delete it from HomeScreen it seems not stopping the AlarmManager attached with it. I have supported it with the AlarmManger, that call the ProviderImplementation class every 1 minute and in onReceive I put the code to call onUpdate. and in onDelete I explicitly stop the alarm, but it seems it is running continously and not stopping. any cure of it ?
I have stopped it with cancel(pendingintent) function.
View 2 Replies
View Related
Jun 7, 2009
My appWidget is working well. When it's installed and used by user, a Thread is launched to refresh view (like a flipper). Even if the screen is off, the thread is continuing...perfect for me... But after 3 minutes, it's stopped.
Does it a VM restriction avoiding some bad development usage?
How can I use this type of service? Develop a service in place of my thread?
View 3 Replies
View Related
Jun 22, 2010
can someone help me.. i want my service to start as soon as the device starts and also the service to persis and remain started.it should destroy only when device switches off.
View 4 Replies
View Related
Oct 19, 2010
When the GC kicks in during my game I sometimes get a noticeable framerate drop, which is to be expected.Is there any way to get more info as to what is causing this? I.e. what in my code is causing the GC to kick in.
View 10 Replies
View Related