Simulate keyboard press from background service - Java for Android App Development

a simple question: Is it possible to simulate a press on the virtual keyboard on android smartphones programatically so that the currently open app receives it?
Here is what i want to do: I want to write a background app / service that checks for gesture data send from a accelerometer via bluetooth. According to those gestures it then converts this data into different letters (A, B and so on) and "prints" them out to the current app (like WhatsApp, or simple SMS).
Is this possible?
Thanks!

Related

Control your car by XDA

Problem:
there is a GSM Module in my car. It has three functions:
1) Send alarm warnings (when someone is trying to steal the car or CD player) to my phone (XDA2) as a SMS.
2) Retermine car's location, when it is stolen
3) Remote control of Webasto heater (when standard radio remote control can't reach the car - max. distance is 800m)
Each of these function has a small problem:
ad1) XDA just once silently beeps when SMS is received. It is fine for regular messages, but not for that message saying "Someone si trying to steal your car!". So I need a different sound for received messages, depending on sender - the sound for SMS sent by my car must be louder and longer, than SMS sent by my wife! How to do that?
ad2) I'm using T-Mobile Locator service for that. I don't know if TMO offers it in all countries, but here, if you know LocatorPIN of some mobile phone, you'll immediately receive a SMS containing location of that phone. I also have a great navigation software and maps (2CDs) from TMO - so when your phone is connected to the PC, you can track location of your car (or even of your wife). But without the PC, you'll only receive a text message with approximate location (calculated from one BTS). On PC you'll get more precise position calculated from more BTSes. So I need to use my XDA as the PC - I want to see accurate position on the map. But I'm not sure if some PocketPC navigation map software (such as TomTom) is able to read the coordinates automatically from SMS in inbox. On PC you can use any GPS software with "T-Mobile Locator", because TMO provides a driver, which simulates GPS, but in fact it sends SMS location requests, reads the SMS responses and sends coordinates from them to the navigation software.
ad3) To start or stop or control other heaters functions, you need to send a SMS to your car in special format (syntax). There must be a 7-digits password for the car's GSM gate and SMS also must contain commands for the heater in proper syntax. So I'd love some application simillar to those applications for infrared remote controls - the fullscreen panel with buttons such as "Start heating", "Stop heating", "Turn winter mode on", "Turn summer mode on", "Auto switch-off after XXX minutes", etc... (all commands accepted by heater and/or climatronic). I'd define SMSes in proper format under these buttons (just once) and then I would be just pressing these buttons and XDA will automatically send the SMS. Is there such a piece of software (remote control software sending SMS mesages instead of infrared beams)?
In a worst case I would create that software by myslef. I just received a DVD with latest VisualStudio.NET from M$, I also have the devkit for WM2003. But I don't know, how to send SMS, how to read it from inbox, atc...
1 you need a 3th party program written by yourself or somebody else which pass all your emails looking for a code or frace which makes the xda react diffrently then when it gets other sms's
so you got alot of work ahead if you are doing it yourself or you may have to pay somebody money to make it or if you are really lucky there already is a program free or otherwise which you can use
2 i would look in the gsm api for any function you may also need to keep a list of locations to match what the gsm provider give you with something you can use for anything
not to mention using that list to make some map program know where you are at
3
well here all you have to do is make a today plugin which auto send predefines sms msg when you press them
i would think that all these wishes would require some programming some of them some serious programming
of cause i could be wrong and there already is a super tool which does all these things and make toast
good luck
I can't believe there's no such app!
Have you tried doing a search ?
I am pretty sure that exactly the same question came up a little while back.
Rgds,
Rob.
What is the GSM Module? Also does it have a GPS module as well and can you connect it to the XDA II to give a GPS feed for Sat Nav purposes?
I am after a device similar to the one you've described but I want it to also feed GPS data.

How can I use a custom phone app instead of default WM6 phone app?

Hi,
I am working on a custom phone dialer app. Here is what we expect:
When opening the contacts or the call history and clicking one call phone number, the default WM6 phone app would not be invoked and popped up, instead our phone app would be shown. And the selected phone number would be caught;
1). When clicking a number in Contacts list or CallLog, how do I stop the default behavior---starting the default WM6 phone dialer app--- and launch the custom phone dialer app we provide?
2). Since the number clicked is not a hard key, how can I catch the event and pass it to the custom phone app?
Really appreciate any helps,
Mike J.
you can't override windows and replace files in it, the best you can hope for (ask HTC and Samsung) is to either skin or create with windows. In your case you're trying to create a dialer that will basically hide most functions already build into windows (contacts, missed calls, etc) I think what you want to do is build the entire program yourself from scratch...link it how you want then tag it with green button so that instead of the default dialer opening your program (dialer with your own customizable setup) will open. I believe that is the easiest solution. Out of curiousity, what exactly are the current dialers lacking that makes you want to create your own dialer? Eitherwaygood luck with your project

SIP app triggering - battery saving plan

When you want to be reached on the SIP number, you need to be logged in. But keeping the session up uses data and a lot of battery power. For that reason I chose not to leave the SIP app running, and only use it for outbound calls.
Android phones however have a function called "Google Cloud Messaging for Android", CGM for short. This is the successor to C2DM. It receives a message through the permanent control connection that the phone has with Google. CGM allows 'something connected to the internet' to send something to a phone, without needing an extra connection or using extra power or data.
Now my idea is:
- a home SIP gateway is registered with the Google CGM service
- the phone has a small app that can receive a message and start/login the SIP app
When a call is incoming, the home SIP gateway (or SIP switch, carrier..) sends the CGM message out. Google relays this to the phone, where the SIP app is made to login. It notices the phone is ringing and allows taking the call.
The sending function can be in a home SIP gateway, or in a carrier SIP switch. Features similar to CGM are on other phones. The SIP app can listen by itself to these CGM messages, or there can be an extra app that logs in the desired SIP app. And the SIP app need not be SIP even, you could run Skype at home, send the message when it goes off, and start Skype on the phone: you are reachable on Skype without being logged in all the time.
Basically, a new component in the network that sends the trigger, and a small app that start SIP when needed.

Companion app for smartwatches (and more)

So app dev @cyrilp has released a companion app that so far has worked on the Gear, all the x201s, and EC-309, a couple tablets and my Nexus 7 CarPC. I'm actually running out of devices to test it on. It's still a beta but has amazing promise.
With BT, it acts like a local full companion app, if both devices have an internet connection or SIM, it acts as a long distance companion app.
From the OP from the main thread
cyrilp said:
Available on Google Play Store
https://play.google.com/store/apps/details?id=com.preiss.swapps.link
!!!! This is a Beta Version, some Features are not yet available !!!!
The app can use 3 different Types of communication:
* Bluetooth
* Push Notification between devices (need internet connection on the watch, can use Wifi or BT Tether from your phone or any other internet connection)
* SMS (for smartwatches with a sim card)
The user will be able to choose what type of communication to use. (When BT connection is down, another one is automatically used)
If more then one is enabled, the app will try to use any of them in this priority order: BT, Push then SMS.
What it does:
• Forward any notification from one device to the other (user choose the apps to listen to) (need Android 4.3 on the device that forward the notifications)
• When getting a Call Notification, allow to reject call, take call or make the linked device reply with an SMS
• When getting a SMS Notification, allow to make the linked device reply with an SMS
• Remote Call: Make the linked device place a phone call (get phone number from either contact list, favorite list, history or direct dial)
• Remote SMS: Compose an SMS to be sent by linked device (with a button to use Google Speech to Text) (get phone number from either contact list, favorite list, history or direct dial)
• Make Linked device play a ringtone to be able to find it or flash light in silent mode (silent mode not yet)
• Get linked device status (Battery level, Memory…) (Only battery lever so far)
• Be notified in case of low battery on linked device
• Remotely Activate Phone lock with password (for example if you forget your phone and don’t use a password)
• Activate “Lost Mode”: Lock linked device and display a message (for example: “I have been lost. I belong to Pierre Martin. Please call me on +…..”) (not yet)
• Remotely Take a Photo and get it (not yet)
• Use linked device as a webcam (not yet)
• Get Remote device GPS Location and show it on google map
• Remotely control music playing
• Synchronize Audio mode on both devices (for example: you enter a meeting, if you set your watch on Silent mode, your phone will be set to Silent too) (not yet)
• Night Mode (dark screens) (not yet)
A lot more to come...
Features for smartwatches with a Sim Card:
•Remotely or Locally enable Call Forwarding between devices, Call Notification (get notified when other device receive a call), SMS Forwarding.
(For example if you forget your phone home, you can remotely set your phone to forward all incoming call on the smartwatch)
•Interphone: Establish a phone call between devices and put remote on loud speaker. Will allow to communicate with people near the phone
•Microphone : Establish a call to hear sounds around remote device
(For both it’s the linked device that initiate the call: the linked device doesn’t ring)
Click to expand...
Click to collapse
Lokifish Marz said:
So app dev @cyrilp has released a companion app that so far has worked on the Gear, all the x201s, and EC-309, a couple tablets and my Nexus 7 CarPC. I'm actually running out of devices to test it on. It's still a beta but has amazing promise.
With BT, it acts like a local full companion app, if both devices have an internet connection or SIM, it acts as a long distance companion app.
From the OP from the main thread
Click to expand...
Click to collapse
Thanks for sharing !!
*SWApp Link dev update 0.934e*
*Auto Lock*
In virtual leash feature, you can now enable "Auto Lock" feature which will set a password on your phone if the link is broken.
It's a low level action on the phone, so you'll be asked to enable Admin rights to the app.
You will be able to enable or not the broken virtual leash notification.
*BT Virtual Leash*
You watch will help you not to loose or forget your phone !!
New feature will allow to get notified if the bluetooth link is broken.
User selected delay to trigger the alert.
*Bluetooth connection*
Bluetooth connection is now working.

[Q] Messaging based GPS app

Hello XDA,
Well I am just a Beginner in android development, basically I am a student and a task is given to me to make an simple application don't need to have great UI etc, but it should perform functionality as directed below or give and explain your reason weather it could be implemented or not.
Well i think it could be implemented but i need guidance about how to do that,
1) Built an app which can triggered by text message (could be any type of)
2) application need to have some code for gps which can be triggered by sending a simple message from my other android phone(how and on which activity)
3) than that phone have to return its location by sending coordinate or map link with its location to me (Email or just a simple text message or other messaging services like whatsapp viber etc)
4) that message should not be received by any other messaging app (how can i Limitize the broadcast receiver etc)
5) if GPS is off text message should turn it on first

Categories

Resources