|
How can i listen to keyboard events in android mobile application. Like, when keypad is popped up my app has to know that the keyboard is visible to user and if user types android i have to capture that text.
|
|
|
|
|
When the keyboard is opened by your application or for any application?
For the latter case you would not get an answer here because that would be a sniffing operation.
|
|
|
|
|
I'm trying to get the coordinates of X and Y of the pattern lock component. The code that i'm using to create the Pattern Lock component is from aritraroy/PatternLockView which can be found on Github. Firstly, i set the root view on a view variable like this:
view=getWindow().getDecorView().getRootView();
and then setting the listener
view.setOnTouchListener(new View.OnTouchListener() {
}
Finally i create the the PatterLockViewListener:
final PatternLockViewListener mPatternLockViewListener = new PatternLockViewListener() {
}
What i want is by clicking the PatternLock component to get the coordinates(X,Y) in correlation to the root view. Instead i get the coordinates in all other components except from the PatternLock (by clicking the PatternLock component the OnTouchListener doesnt trigger and as a result, the code is not working/running)
|
|
|
|
|
Have you tried something like:
PatternLockView mPatternLockView = (PatternLockView) findViewById(R.id.pattern_lock_view);
mPatternLockView.addPatternLockListener(mPatternLockViewListener);
...
private PatternLockViewListener mPatternLockViewListener = new PatternLockViewListener()
{
...
};
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
yes i did, but with this listener i cant get the coordinates only the progression of the pattern.
|
|
|
|
|
I'm guessing the control itself is concerned with coordinates and such, whereas users of the control are more interested in whether it succeeded or not.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
i want to know sms appapplicaton source code
|
|
|
|
|
Then ask the person who wrote it to show it to you.
Or were you expecting someone here to write a complete application for you to present as your own work?
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I want source code for audio data fetch using JSON URL from live website in android, can anyone have ?
|
|
|
|
|
This site does not provide code to order. You can search Google for sample code.
|
|
|
|
|
I wan't to add channels into my android app using a webview . But i wan't to listen if a user did susbsribed to a certain channel or not.
|
|
|
|
|
hello,
how i can change IP address on my android device?
thank you.
|
|
|
|
|
Use the settings menu, and check network and wifi settings.
|
|
|
|
|
Is your device connecting statically or dynamically?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
There are many VPN applications in the store that allow you to change the IP on your device.
|
|
|
|
|
Is it possible to respond to the volume and power buttons while the app is not in the foreground? Much like the screen capture capability when holding volume down and the power button. What api calls are necessary to do that? How do I get my app to listen to hardware key events of the entire system regardless of the current app in the foreground?
|
|
|
|
|
onKeyDown() may solve part of your problem, but I'm not sure about the "while the app is not in the foreground" part.
Maybe try here or here.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
David Crow wrote: onKeyDown() may solve part of your problem
It wont.
David Crow wrote: but I'm not sure about the "while the app is not in the foreground" part.
This is the part where I need surety.
|
|
|
|
|
|
Richard MacCutchan wrote: See KeyEvent | Android Developers[^]
I would never ask a question so doltish to get this answer.
The app needs to be a background service.
|
|
|
|
|
Have you actually looked at that page to see how you can capture these keystrokes? I can only assume not.
|
|
|
|
|
Richard MacCutchan wrote: Have you actually looked at that page to see how you can capture these keystrokes?
I have and it's not correct. You can't get key events as a service.
This is the correct answer. BroadcastReceiver[^]
|
|
|
|
|
droiddev wrote: You can't get key events as a service. What service? You said you were trying to capture key events in an Android app.
|
|
|
|
|
Hello all. How can I disable "Clear Cache/Data" feature for my android app? Is that even possible? Thanks for any pointer.
|
|
|
|
|
You can't remove that option from the system settings interface.
However, if you don't want cached data (files) to be deleted, don't store them in the cache. I'm assuming that you're working on an app of your own so that you have control over where your app data is being stored. Use of the cache doesn't happen arbitrarily... it's something that the app developer must implement.
When all else fails reading the docs is worth a try. It's no harder than reading anything somebody may post on this forum!
|
|
|
|