Terence Chow
Terence Chow

Reputation: 11163

can bluetooth hardware send java commands to android?

I'm researching making some bluetooth hardware for my android phone because I'd like to use my phone hand's free.

What I'd like to do is send a command to my android phone. Specifically, I'd like to programmically change my phone from portrait to landscape mode. The app that will be open at that time is not written by me so I can't change any manifest files.

Similar to the way bluetooth headsets can affect the volume controls regardless of what app is open, I'd like to be able to write bluetooth hardware that can change the orientation of my phone (once connected through bluetooth).

Is this possible?

Upvotes: 1

Views: 334

Answers (1)

Robert
Robert

Reputation: 7053

What you need to do is to write a service app that acts on Bluetooth intents. (Bluetooth hardware does not need to be modified, as you imply in your question.)

First of all, you should read the Android Bluetooth guide: http://developer.android.com/guide/topics/connectivity/bluetooth.html

This guide will explain how Bluetooth works.

The BluetoothDevice class contain a few intents that you might be interested in: http://developer.android.com/reference/android/bluetooth/BluetoothDevice.html

Upvotes: 2

Related Questions