Android :: Target Running Application With KeyEvent?
Nov 12, 2010
my goal is to target with a keyevent a specific application running either in foreground or background from a background service. I tried many solutions, but have not yet managed to do it. The few solutions tried (all from a background running service): With a broadcast, I tried to target the first application (for example the phone app) that would manage the key event
KeyEvent lKey1Up = new KeyEvent(KeyEvent.ACTION_UP,KeyEvent.KEYCODE_ENDCALL);
KeyEvent lKey1Dwn = new KeyEvent(KeyEvent.ACTION_DOWN,KeyEvent.KEYCODE_ENDCALL);
Intent lKey1UpIntent = new Intent(Intent.ACTION_MEDIA_BUTTON);
Intent lKey1DwnIntent = new Intent(Intent.ACTION_MEDIA_BUTTON);
lKey1UpIntent.putExtra(Intent.EXTRA_KEY_EVENT, lKey1Up);
lKey1DwnIntent.putExtra(Intent.EXTRA_KEY_EVENT, lKey1Dwn );
sendOrderedBroadcast(lKey1UpIntent, null);
sendOrderedBroadcast(lKey1DwnIntent, null);
=> Nothing happens with my foreground phone app when the broadcast is performed while I am in a phone call state (OFFHOOK). Indeed, I was nearly sure this would not work since I have no way to specificely target the phone app.............
View 1 Replies
Feb 16, 2010
My Motorola Droid shows up just fine in this configuration and appears as a deployment target. Works like a snap. How do I get the HTC Eris Droid to show up as a deployment target? Is there some special driver needed for the Eris?
View 1 Replies
View Related
Feb 23, 2010
I installed newst Android, JDK, Jer and eclipse. Than I tryed to build android project. But "build target" show "no target available". I looked at internet, they said I should run "Android SDK and AVD manager", I runed it but get follow message: Failed to fetch URL https://dl-ssl.google.com/android/repository/repository.xml, reason: No route to host: connect
I read this group's conversation that suggest to use http not https, I tried it but still can not run Available Packages.
View 2 Replies
View Related
Oct 7, 2009
What are the differences between building for target 2 (no gmaps add on) and target 3 (with gmaps addon).
Could any one has the ant scripts to bulids for these targets.
I see 1.5 SDK does these though custom ant tasks rather than 1.1 ant scripts (this was more clear and apperant on how it does the build)
View 4 Replies
View Related
May 1, 2009
I have an application that I developed using the Android 1.1 SDK that I am trying to port to Android 1.5. In my application, I record a sound through the microphone and then do various things with it, including playing it back using a MediaPlayer object. My code works fine when I use the 1.1 target, but when I use a 1.5 target I get this error when setting up the player:
Command PLAYER_SET_DATA_SOURCE completed with an error or info PVMFErrNotSupported error (1, -4) Couldn't setup MediaPlayer java.io.IOException: Prepare failed.: status=0x1 at android.media.MediaPlayer.prepare(Native Method) at org.byu.chum.AudioUtils.AudioRecording.stopRecording (AudioRecording.java:92) at org.byu.chum.SoundRecorder.Recorder$StopListener.onClick (Recorder.java:198)...
It seems like Android isn't liking the format of my media, but I don't know why, since I just recorded that very format on the Android device. Here's the code that is throwing the error:
player = new MediaPlayer();
try { player.setDataSource(recordFile.toString());
player.prepare(); } catch (IOException e) { Log.e("playRecording", "Couldn't setup MediaPlayer", e); }
View 13 Replies
View Related
Jun 28, 2010
I have a project that builds against Android v2.1 . I can run it fine on a phone running 1.5 but when I try to launch it with an emulator running 1.5, the emulator doesn't show up on the list of available AVDs. I have the <uses-sdk android:minSdkVersion="3"/> tag in my manifest but it doesn't make a difference.
View 2 Replies
View Related
Jun 2, 2010
Can someone point me to documentation with the definitions / meanings (i.e., what action is expected to be performed) for the KeyEvents? Aside from the obviouse KEYCODE_A to KEYCODE_Z, etc. there are some that I don't understand and I cannot find any mention anywhere on the web ?! Specifically the following, but generally all of them: KEYCODE_EXPLORER KEYCODE_ENVELOPE. Also, is there a meta-key to dismiss the keyboard via an injected KeyEvent?
View 2 Replies
View Related
Sep 1, 2010
1. what is the getKeyDownTime() method? What does its return value mean logically? 2. what is the getKeyEventTime() method? What does its return value mean logiccaly? 3. I want to measure the time a key was depressed for. Eg: Key A was pressed for 60 ms. which of the above methods would be useful?
View 7 Replies
View Related
Apr 26, 2009
When I Override onKeyDown in a MapActivity I have a problem with KeyEvent.KEYCODE_PLUS. When running my app "+" just don't work. The same code works for any key but KeyEvent.KEYCODE_PLUS. In log I get W/KeyCharacterMap( 725): No keyboard fo id 0 W/KeyCharacterMap( 725): Using default keymap: /system/usr/keychars/qwerty.kcm.bin. I am working with a Hp Laptop with US qwerty keyboard and Kubuntu 8.04.
View 4 Replies
View Related
Jan 28, 2009
how to reject an incoming call. At first, i wanna find some method already exists that can directly reject a phone call, but unluckily i failed. now i come up with an idea ,to simulate a ENDCALL KeyEvent. here is one solution to achieve it
IWindowManager.injectKeyEvent(...);
It may work in earlier version sdk... I didn't find any method like that in latest version sdk~ is there any method exists to simulate a KeyEvent ? or how could i reject an incoming phone call?
View 2 Replies
View Related
May 29, 2009
I've got something simple where I want to raise an AlertDialog after catching this keypress:
CODE:............................
The interesting thing here is that when you hit the back button, you *do* see the AlertDialog for a split second, but then you're back at the previous screen you were at. Almost as if the system is hellbent on sending the user back to the previous screen, regardless of what the developer has constructed around this event. I'm using 1.5r2 here.
View 6 Replies
View Related
Sep 21, 2009
Does anyone has an idea of how to split the screen into two? Is it possible for me to run an application in one screen and another app in other screen?
View 11 Replies
View Related
Apr 20, 2010
My application is a trial version apk. Once the period is completed, can I initiate another application to be installed/downloaded from the android market ( purchasing process) which is a paid application using the current running trail application.
View 1 Replies
View Related
Nov 10, 2011
I have a project (that compiles and runs in the emulator.) I have a test project that tests part of this project. This test project also compiles with no problems, but when I try to run (test) it in the emulator, I get a NoClassDefFoundError exception on one of the classes my test class tests (I hope that made sense!) when it starts to run in the emulator. This is coming out of the adb log. I looked in the bin directory (of the test project) for the missing class, but could not find it... Should it be there? I found no reference (apk, etc) of the project I am trying to test either in the test projects bin directory. How does the test project get the classes it needs to test against (in the classpath, I assume.) How do the tested classes get moved to the emulator? I did try running the app before testing, so I know it is installed and runs correctly. BTW, I am using netbeans with the nbandroid plugin.
View 1 Replies
View Related
Jan 3, 2010
I'm running into some issues with input events and garbage collection, or more precisely object allocation. I am creating a game and have pretty much got my head around the OpenGL environment. I've digested all the relevant material I could find regarding performance, memory allocation etc (and watched the excellent presentation by Chris Pruett - http://code.google.com/events/io/2009/sessions/WritingRealTimeGamesAn...). I've pretty much eliminated any object allocations after initial setup from my game (which is still in its infancy), but I'm still getting a bunch of GC calls, like this:...........................
View 6 Replies
View Related
May 30, 2010
I want my app to kill a running app but i got the problem that since AP I 8 the method is deprecated and i need to use another function. So i want that if AP I level of the device is smaller than 8 it runs this
Activity Manager a M = (Activity Manager) this.get System Service(ACTIVITY_SERVICE); a M.restart Package(package); And from 8 this But how do i accomplish this because using something like an if will make the compiler complain.
View 2 Replies
View Related
Aug 12, 2010
This is my target:
I need an Android application which should be able to fetch data from the web (maybe an .apk or a .jar) and launch "something" from it.
If it's a "trivial" class there's no problem at all. This is my Loader
CODE:.............
The problem is that the code I want to execute looks very like an application, which should have a "simple" view and some interaction on it.
I'm not able to invoke the "onCreate" method of my downloaded class.
I guess I've three streets:
I look for a method which silently install the application and then runs it (is it possible?) I understand how to initialize a second "application" inside my own one (with its own R and all stuff) I write my master program to fetch data from the web and construct pages dinamically.
View 2 Replies
View Related
Sep 2, 2010
I create new Project.
In that I move to res -> layout -> create one xml file.!
I gave name Login.xml but it show error (only [a-z] and [0-9] allowed).
Then I remove the file and create new file as login.xml.!
But It show the new Error "your project contain error(s) please fix them before running your application"
How to I fix the error..!
View 3 Replies
View Related
Aug 31, 2010
I develop[e a small program to play the video from localhost ... but that is not working its show like ... ActivityManager: Warning: Activity not started, its current task has been brought to the front this is the error message ....
View 2 Replies
View Related
Oct 11, 2010
I have made an app which have target sdk a 2.2 and min sdk version as 3. And i have 2 services which start at boot time. when i run the app on 1.6 than it is running fine but as i try to run the app on 2.2 my services get start but got Crash after some time. why this is happening? when i look at log cat it is giving me something like this which i not coming in 1.6
CODE:..............
View 1 Replies
View Related
Aug 18, 2010
I developed an "heavy" application (700 Mb !). With an "apk installer" application, i can install it on the Nexus One SD card (Froyo "installLocation" option). My application is heavy because of the videos it contains (located in /raw directory). The problem I have, is that it crashes when launched, with this error :
CODE:.................
View 3 Replies
View Related
Oct 17, 2010
I notice that my application continues to run in the background after I hit the home or back button. I tried calling the finish() method and it still says its running. On another note, how do I setup the keyListener to respond to the user hitting the back or home button. I tried implementing OnKeyListener and using findViewById(R.Layout.main).setOnKeyListener(this) to call finish().
View 1 Replies
View Related
Jun 18, 2009
I have successfully booted android on to the omap 3530 evm(mistral) using the prebuilt binaries available in the mistral site.. now i would like to run a simple application like hello world on it.. can somebody please guide me as to how to go about running it and if some tools have to installed..?
View 2 Replies
View Related
Sep 9, 2009
I want the application to run in background. This application should run continuously and should never get killed. Will running application as Service solve this issue? The application should get started automatically on start up. I don't need any GUI for this application. The main issue is Service getting Killed. Does service get killed ? and in what conditions will that happen?
View 4 Replies
View Related
Mar 26, 2009
I'm wanting to run a script called toggle.sh on Android. Should I be able to run this code?
CODE:.............
At the moment I can run the command from the terminal and it works but when I try to run it from the application it fails (and I don't know why - there is no USB on my Android phone to plug in the debugger).
CODE:..............
The Emulators don't have this command to run - and they are running on Windows anyway. I can't think of anything else to add to this.
View 4 Replies
View Related
Feb 28, 2009
I was wondering if its possible to have an application run on startup of the phone and then run permanently in the background. Also I would then like it to monitor the call log, and detect any changes and run about 15, 20 lines of code each time there is a change.
View 3 Replies
View Related
Jul 24, 2010
This is sort of about task managers, and yet, not. I have an application I need to stay open (meebo) but Androids's task manager closes it sometimes. I have tried using task managers to keep enough memory free that Android won't kill Meebo, but it usually gets killed eventually anyway. Does anyone have an idea on how to keep it open? I am running 2.2.
View 2 Replies
View Related
Jan 5, 2010
I have an application that uses a Service to fetch data in the background both while the application is running and when it's not. When it is not running i would like to show a notification when there is new data, but not when the app is running. How do i determine in my service whether the app is running or not?
View 6 Replies
View Related
Apr 5, 2010
For example my application contain 3 pages and run that application when the middle of that application means at 2 page i got a phone call after that phone call again i start that application using menu in home screen .At that time i want a page where we stop in previous(that means 2 page).
View 1 Replies
View Related
Oct 11, 2010
How do I determine how long an application has been running? Is there a broadcast each time an app is launched and shutdown? I am trying to log the time spent using an application.
View 1 Replies
View Related