Arduino Bluetooth IR Remote Controller Project

Android Development



  Android App Introduction


This second part of the project is meant to give the user a better experience and simplify the use of Arduino as a remote controller/decoder even for an hypothetical daily use. Since this is my first “real” application in Android, it’s highly probably that there are some bugs and certainly it’s not a refined app: no refined design solutions, not optimized nor tested on a wide range of devices or android os versions. It’s just stable enough and good-looking for a demonstrative purpose. You can find the apk in Sources page along with all other Arduino files. This app is partially inspired by applications you can find on smartphones with ir-blaster (mine one in primis).


  Android App Development


App Bluetooth Activity

The app is based on two activities: the first one deals with management of Bluetooth connection - including devices discovery and visibility of this device - and pairing with Arduino. It’s launched on app opening but can be recalled in any moment from the main activity menu. As soon as the connection is established, this first activity launches the second one, which is the main one and it's based on a fragment view with three fragments for different interactions and information.

App Fragments

The first one is a remote controller interface and almost everything related to this project could be performed within this fragment. You can add, remove and rename remote controllers, add or remove buttons and set or change their commands - tap and hold the button for menu - writing them directly or decoding them with Arduino. Note that there isn’t a database of predefined commands, so you have to set them for each button.

The second fragment is meant to be used as a console for manually interact with Arduino. Its scrollable text view keeps the last 200 received and sent strings and can be cleared in any moment. Currently this number is fixed and not user configurable to prevent an excessive memory usage. Inside this fragment you can send everything to Arduino, so it’s totally independent from the project and can be used with any sketch which involves some forms of communication.

Eventually, the last fragment is used as a web view, connected to an Italian TV guide so you can look at the description of the tv program you are currently watching. The current channel is written in the top bar. This feature uses the last pressed button name to identify if it is a channel – i.e. a number – or something else. The channel is detected only if it recognizes a number. Of course it’s a little limited and can be improved in the future. This fragment is not fundamental for this project but represents an interesting and useful extension.

Add New Key

Add new key for this remote controller. Max 5 chars accepted.

New Remote

Add a new remote controller. Need to specify some features.

Rename Remote

Rename this remote controller.


That’s all. I’m not going further about this app development, I intentionally didn’t mention all the difficulties arose because, as I said at the beginning, this is my first app and so a lot of things have been difficult - something more, something less - since this is all new for me.


Notes:

I've tested this app on Android 4.4 and Android 6. Should run well on these versions, not guaranteed for others.