Android :: Capture The Events For An Application?
May 19, 2010I want to capture the events like user clicked on so and so button, or > entered some text in Edit Box and etc...
View 3 RepliesI want to capture the events like user clicked on so and so button, or > entered some text in Edit Box and etc...
View 3 RepliesI am developing an application that has to capture the key events both in foreground and in background. I used the following code. But am unable to capture the keys in background.
CODE:............
I used broadcast reciever..
CODE:.................
I am planning to port an application from Symbian to Android and I'm looking at the possibilities of the Android platform.
My application runs in background and needs to detect when the user presses and holds a button (for 3-4 seconds) on the phone even when the phones key lock is on.
I am in the process of learning Android programming but so far what I understand is that if my application runs as a service it would be able to receive broadcast such as ACTION_MEDIA_BUTTON. Am I looking in the right direction?
I had a quick look at the list of native android broadcast actions and I could only find broadcast actions for Camera, Media and Call buttons. What about the other buttons?
I have an Activity which has no window (but it has a view). I'm using: getWindowManager().addView(view, params);I've attempted to call takeKeyEvents(true), however I see that takeKeyEvents first retrieves the Window and then calls takeKeyEvents on that Window.In my case, the Window is null.What this means is that I never receive onKeyUp and onKeyDown calls, which I need in order to intercept some key presses from external input devices (similar to a handsfree set for example).
View 10 Replies View RelatedI am facing a problem any one can help me regarding this. I have an EditText and a list of contacts. I want to search a contacts on matching with characters entered in EditText field.
View 6 Replies View RelatedI am popping an alert box whenever an user exceeds 100 characters in a text-box(EditTextPreference). Now i am able to capture the hard keyboard's, i.e. computers's keyboard, events, but i am not able to capture the sofkeyboard's key events. There are some keys like numbers, enter, delete etc. in the softkeyboard which i am able to capture using onKey, but i am not able to capture the alphabets and other keys. i also tried setOnKeyboardActionListener, but didnt get the desired results,( may be i was not using it correctly). Can any one suggest how to capture the click of alphabets on the sofkeyboard.
View 12 Replies View RelatedIs there a way to capture a key event from the Menu button using an Intent or Broadcast Receiver? Basically I want my app's Service to be activated when the Menu key is pressed.
View 1 Replies View RelatedIf you ever tried to write a locker app on Android sure you meet this problem: Code...
Seems like onKeyDown is filtering out all keys but "Back" and "Menu". Well, it's not true! Home button will still bring you Home screen and End Call button will run native Locker application!
Fellow's out there also claim it as a problem: How to listen from ENDCALL button problem With Home Back screen button Suppressing Key presses in Activity, especially in Options Menu
Issue 4202: Feature Suggestion: permission for intercepting KEYCODE_CALL
Do you know any workaround to block two those buttons? Is the only way (as often) - write in C ?
I'm trying to work with a custom build of Android based on KitKat to incorporate a stylus, copying some of the functionality (though not code) from Samsung which sells Android-with-stylus builds for e.g. the Note 3. I'm not including details of the specific device because right now I am working on a custom dev device and my aim is to write code which is generic enough to be usable from any Android (based on KitKat). The build (written by others) already incorporates drivers and sends stylus events correctly as motion events etc. Programming at the app level I can receive onHover, ontouch, onClick etc
The specific functionality I am trying to achieve is to pick up a stylus-button-click while hovering. It's perfectly possible to do this in any app, using an onGenericMotion Listener.
However, I want to make my "stylus-action" have system-wide effect - so that anywhere (in any other app, or in the launcher or whatever) I will pick up the event (prior to any other app) and bring up my custom menu. (just like AirCommand in Samsung Note 3) I guess in my custom Android this would then make that particular action somewhat protected or unusable for other users, but I'm ok with that.
In older Android (prior to ICS) you could try something by putting up a System Overlay (i.e in regular app code, without hacking the ROM at all), but this is no longer possible.
This is not an attempt to tapjack or whatever, I understand why this functionality has been removed from the domain of the regular programmer, and I don't want to regress my ROM back to pre-ICS behaviour by allowing the System Overlay hack. Now I am programming the system (if my change is good enough I'd like to submit it back to AOSP) so I would like to know the best method to address this. Since Samsung have already done this, it must be legal (using legal in the terms of "Android will allow it"), and I want to do it right.
Is it possible to write something similar to the System Overlay when you are running from a system service? Or is there a good choke-point to capture events before they are broadcast to the current running apps?
I was looking at AndroidXRef /frameworks/base/core/java/android/view/View.java specifically in the function dispatchHoverEvent() which looks like a promising place. My naive idea is that I would place code here checking the MotionEvent to see if the button is pressed and if it is, don't call any listeners and instead call my little menu app (or broadcast a custom message, or something anyway). However, I've never written code on the ROM level before (LOTS of experience writing app code) so I don't know if this is a really bad point or a good point to add in code. Should I be putting things at a higher level or a lower one? Will this capture all events or not? Is it all just trial and error?
One of the winners of the Google app contest was Jigsaw by Mikhail Ksenzov, an app to capture and process whiteboard data. The app isn't in the market, and I can't find anything via Google about it's status. Is it still beta, or what?
View 1 Replies View RelatedI overheard someone say there was an app that blanked or put a decoy screen on the screen while taking video, does anyone know what this app is called, if it exists?
View 1 Replies View RelatedHow can I determine if the phone my app is running on, supports video capture?
View 2 Replies View RelatedI am trying to implement Camera application in android,and i got some code from net to create a Live Camera through WebCam.Upto this no problem.Now i have to capture the images when click the button, and i displayed the captured images in the Dialog window.Without any exception the program is running but the captured image is not displayed,some default image is displayed.
My code is.
CODE:.........
I have no idea from where this default image is coming.
My android application is consists of 20+ activities. I want to perform some task when application is in background (not an specific activity) and want to perform some other task when application is resumed. How to do this? I couldn't find onPause() and onResume() methods in Application class.
View 1 Replies View RelatedI am writing an app to capture the camera preview frames and convert it to bitmap in Android.
Here is my code:...........
After I start preview, the callback got called with data, but the bitmap is null.
What did I do wrong when convert the byte array to BitMap?
I'm a college student, and there's daily specials at bars, salsa dance nights, special meetings, lectures, etc. And all these things happen around me. I don't want to just put them into my calendar and have them flooding it, but I would like some app to hold such things. Anyone know what I can use that isn't my default so I can retain my personal schedule and, if I want to do extra, can see this app's contents?
View 3 Replies View RelatedDoes the calendar application in Android maintain a cache of its database?
Whenever I edit and mark some events via the calendar app, it is stored in the database but if I edit the calendar.db from some outside source the changes made are not reflected in the calendar app. So my question is:
Does the calendar app maintain a cache or some other form of database? If yes then where and how?
How to detect application launch and shutdown events?
I have used BroadcastReceiver for detecting incoming message, outgoing call and so on. but now I want to use Application Launch and its Shut Down event from my application..
Kindly waiting for any suggestion/link/source code....
I want to use screenshot kind of application in my own application. So that I can take picture in any format and save it. There is one function getDrawingCache() which does that, but it only save picture what is available on the screen. It does not capture beyond screen if the picture is big.
View 2 Replies View Relatedi had an interview this morning for a job, and have an opportunity to earna great deal of brownie points with the business owners.They were thinking of purchasing some sort of electronic signature capture device (like fedex or UPS has when you sign for a package) for invoices.. BUT.I also mentioned my Droid Eris and how it can do so much. Turns out, both of the Owners have DROIDs lol.Anyways.. I want to know if anyone has seen some sort of application that can capture signatures, and either save an image to be emailed, or email directly from the app.OR does anyone know a DEV that could create something as simple as this, that I can talk to and relay updates on the APP to the owners of this company.They seemed really interested in it, and I'm pretty positive it will show a good bit of initiative in saving their company money from the get-go (on my part)
View 10 Replies View RelatedI would like to create a video recorder and so far haven't figured out how to set parameters in order to successfully go through MediaRecorder.prepare() method. Executing the following method
public void start() throws IOException{
String state = android.os.Environment.getExternalStorageState();
if(!state.equals(Environment.MEDIA_MOUNTED))
{
throw new IOException("SD card is not mounted. It is " + state + ".");
}
File directory = new File(path).getParentFile();
if(!directory.exists() && !directory.mkdirs())
{
throw new IOException("Path to file could not be created.");
}
recorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
recorder.setVideoEncoder(MediaRecorder.VideoEncoder.H263);
recorder.setVideoFrameRate(15);
recorder.setVideoSize(176, 144);
recorder.setOutputFile(path);
recorder.prepare();
recorder.start();
this.state = VideoRecorderState.STATE_RECORDING;
}
it throws an exception on line recorder.prepare(). Does anyone know how to set parameters in order to be able to capture video?
I'm having trouble getting a screenshot. I installed the SDk, Eclipse, the drivers, enable usb debugging, like the instructions say. I open DDMS and it recognizes my phone without any problems. When I try to do a screen capture, it says screen not available. In the command box it says "timeout" and "truncated reply from ADB fb data". Does anyone know what I'm doing wrong?My phone isn't rooted and is running RC33. I'm running windows vista on my computer.
View 3 Replies View Relatedi was wondering if any of you had suggestions for a screen capture app that didn't require the SDK. If it didn't require me to root my phone that would also be a plus but i'll take what I can get.
View 1 Replies View RelatedI want to capture when user press the EndCall key in simulator, but i think i'm doing something wrong cause nothing happens!
My code is:
CODE:......................
I am working on key capturing events in background. i used Service to send my application back. When the application is in forground i can capture the keys and logged in a file.But when i sent it to background i am not able to get. i am aware of onKey() and onKeyDown(). and also i feel these can only capture the keys when application is foreground.
can anyone please suggest how to capture the keys while application is in background. and also without DDMS how can we capture the screen .Is there any API's
I was wondering if there is a way to take a screenshot of the current screen inside the mobile phone using a service (I know how to do it through DDMS though)
View 2 Replies View RelatedI know using HOME and VOICE button can capture the screen without ROOT under 4.0 system, but now I need capture it using API in my code.
View 3 Replies View RelatedAs a first step toward a speech recognition project, we wrote a simple voice recording application based on the information in this thread:
http://groups.google.com/group/android-developers/browse_thread/threa...
It is working; however, the audio is extremely poor too static for our needs. As a comparison, we did a similar audio file captured with audacity on a PC and it was much better. Has anyone been able to record high quality audio with the android dev phone? According to the documentation of MediaRecorder, there is only one audio encoder "AMR (Narrowband) audio codec" and three output formats--3gpp, mpeg, and raw AMR:
http://developer.android.com/reference/android/media/MediaRecorder.html
According to wikipedia, AMR encoding is only 8hz. Is there a better option available perhaps a lower-level API compared to MediaRecorder? We are testing on Windows XP, with a Logitec USB microphone, eclipse ganymede, and we are using all the defaults for an android 1.5 app (no emulator command-line options. We defined the SD card in AVD manager).
Ive got a rooted Moment and Im trying to use one of the screen capture apps on the market but no matter which one I use all my screenshots come out blank (black to be exact). Ive tried taking a shot of both my GDE homescreens and the default homescreen and it doesnt change.
View 2 Replies View RelatedI would like to be able to capture the video from an android phone camera, and then process this video. Processing involves adding a layer of AR to the live stream. Is this possible on android? Pretty sure it should be. I have looked at the android site [http://developer.android.com/guide/topics/media/index.html] but this seems to be concerned with video capture and storage. I would like to be able to play with the video pre-storage.
View 1 Replies View Related