From Arduino to Android

So many of you have been EXTREMELY helpful during the two years I spend developing my product; always within a day, often within a few minutes. And I've been so happy and appreciative of such excellent answers.

But now I'm working on a second version for the Android tablet, so this forum can't stay my home any longer. Does anyone know of an Android forum that approaches the quality of support I've always found here?

Ditto. I'm currently trying to write my first android app - I want to send the value of a slider to an arduino over bluetooth. Basically, I'd like to replace switches, knobs, and LCD panels (which are always in limited supply) with having an arbitrarily complex UI that I can make do anything by coding it up.

I hear ya, PaulMurrayCbr,

I too am going to be using BlueTooth with an Arduino remotely contacting the Android. But I haven't even begun studying about using BlueTooth yet.

Interestingly, myfirst BlueTooth transiever (for the Arduino side) came in the mail today, about the same time as your message arrived.

Check out this forum this was mentioned in Android Developer website, might be the official forum.

On the arduino sde, it's pretty straightforward.

I wrote a sketch to create a SoftwareSerial on a couple of pins and which simply echoed the incoming charactrs to Serial. I plugged the bluetooth module in and sparked up an Andriod app named "Ardudroid". It paired with the bluetooth with password 1234, and it had a terminal app. I typed in some characters on the tablet, and they appeared on my serial monitor.

Winning.

So the two things to do are a) work out a communication protocol that can survive dropouts. A bluetooth packet is 20 bytes, which is pretty tight; and b) writing an android app.

I wonder if someone on the playground has already done this? I cant see anything obvious. Android apps are horrible big things, unfortunately.

So far, I have gotten as far as creating a UI with a slider, and successfully building a signed .apk and installing it on a cheap tablet. To make bluetooth happen, I think I will need to create a thread to do the transfer.

sarouje:
Check out this forum this was mentioned in Android Developer website, might be the official forum.

It must be their official forum like you said, but it seems so "dead". I posted on their forum before I posted here. On their forum, I got six reads and NO responses, while here I've gotten 60 reads and TWO responses in less time. It seems as though no other technical forum feels the depth of community and mutual support as is shared by Arduino people.

PaulMurrayCbr:
I wonder if someone on the playground has already done this? I cant see anything obvious.

I entered the word "Android" in the "Search the Arduino Forum" box above, and 495 articles came up about combining Arduino with Android. Some of them were about connecting the two with BlueTooth.

PaulMurrayCbr:
So far, I have ... successfully [built] a signed .apk and [installed] it on a cheap tablet

I believe "a cheap tablet" is the only way to go, if you want to include one with each product you sell and still make a profit. I use Android 5.0 (which has the system API level 21) because I can get them for less than $50. The biggest drawback I've found is that the standard Date/Time functions weren't added until API level 23! Gasp.

It took me two solid days of concentrated effort -- Google searches for bits and peices, and lots of experimentation -- to find ways to get Date and Time info into a string where my program can manipulate it. So I'll share that information here:

(1) Drag a "TextClock" widget into the preview pane. (2) In it's properties, set "Visibility" to "Gone" (unless you really want to see it). (3) In it's XML listing, add the two lines
android:format12Hour="MMMM dd ',' yyyy"
android:id="@+id/dateClock"
with whatever time/date codes you want; a list of codes can be found here. (4) Then in the .java file, the three lines you'll need to add -- each in it's appropriate location -- are:
(1) TextClock dateDate;
(2) dateClock = (TextClock) findViewById(R.id.dateClock);
(3) dateText.setText(dateClock.getText());
"dateText" being a TextView widget I added to my screen separately. It recieves the date/time info as a string. You could, of course define something else to recieve and hold the data, such as a string. Just now, I added this code, testing to be sure it works.
CharSequence dateStr;
dateStr = dateClock.getText();
dateText.setText(dateStr);
Here, dateStr gets the data from the clock, holds it, then passes it on to dateText.

PaulMurrayCbr:
Android apps are horrible big things, unfortunately.

True. In fact, I felt discouraged when I first saw what all was involved. But there are really good ways to learn to "master the beast". I started with the free Youtube lessons Android App Development for Beginners, duplicating what he demonstrates -- line by line -- on my laptop/tablet, until I was ready to leave the lessons behind and take off on my own.