I need to show that my vehicle is being charged. Charging starts when start button is clicked and stops when stop button is clicked on GUI.
i have a GUI for this work where i have to have some kind of image representation to show the status. (Something like our cell phone battery)
I am using SWT.
Any Suggestion, regarding, how to go about it, will be appreciated.
Related
There's a way to handle headphones button clicks in computer (not smartphone) with Java?
The usage is very similar to Android, which by pressing the button some event is fired.
There's not much info about this, then I thought a way to perform this could be interpret the bytes of the moment of the click, and based this, do something. This "could works" but I don't know if something changes by the button click in a computer, as happens in smartphones.
So is possible handle headphones clicks in computer?
I have an activity that shows up when the phone screen goes to sleep/turns off ie turns black.
For some reason, the phone turns on when the volume buttons or the camera buttons are pressed. By turns on, I mean the screen wakes up or comes back from the black screen state.
I've tried using dispatchKeyEvent(KeyEvent event) and the buttons are disabled on the activity, but they still wake up the phone.
You could try overriding the onKeyDown(KeyEvent) method and change what happens for those keys. However, I'm not too optimistic as if you're running an activity, it will be in an inactive state when the display is off, and also it could be that the phone is hard wired to wake up on those buttons. It could be device specific. Hard to say. Try that out and let me know how it goes, I'm currious
Please, I guess how it is called: an on-screen floating message with small arrow, they used to show to user what button to push when he sees the program for first time. They are usually with text "press this button to..." or "here you can get this.."
How to implement it in android application?
edit: I implemented some buttons on screen, and they say that it is not clear what they are for. I want to show user, when he (she) run the program after update, that this is a button and it is for...
maybe u could make a a whole new UI over ride for floating display or make a
activity fully transparent with a limited window size
and over lap it over ur previous activity
I need to fake the speed of the movement of the phone in the vehicle - (no accelerometer).
I need to be able to press the button on the phone "Start Engine" , "Stop Engine" and then "Speed up", "Speed down" somewhere in between.
I'm new to Android so any help will be much appreciated.
Cheers
EDIT:
I mean UI Buttons.
I need to tell phone it is moving even though it is not.
So something like maybe send fake GPS coordinates in a loop or something??? But then how do I change speed.
If you're talking about physical buttons that you could actually press, then you could use a BroadcastReceiver which has a filter of android.media.VOLUME_CHANGED_ACTION to do whatever you want when pressing keys. However, I don't think you could manage that much actions with just volume up and down. If you're talking about buttons on UI, then just put the button on UI and use OnClickListener of each button to do what you want.
I have a program that makes a phone call when a user clicks on a button. The user will need to provide some information very fast to the person who answers the call(ie GPS coordinates). The problem that I am having is that, once the user clicks on the call button, they cant go back to my application.
I want to know if it possible to bring my application to the front (without hanging up the call) or to display a message until the user clicks the ok button... or something like that. I tried toast notification but they disappear and I want them to stay until the user decides to close it.
look up startActivityForResult() and see if you can hook into the calling code.