[DEV][AADK] Google's Arduino based "ADK" Working on Nexus One - Android Software Development

I managed to snag an Android Accessory Development Kit from Google IO.
After wrangling all the necessary code bits together I got the demo code running on the Arduino board and my Nexus One.
The first picture you can see the phone reading the sensors of the demo shield, button states, the temperature, a light sensor and the joystick position.
In the second picture the phone is controlling the led colors and has one relay turned on.
In the last picture you can see that the phone detects the board being plugged in, Android knows there is no app installed for the board and it cannot be found in market.
The Nexus One is running a rooted 2.3.4 ROM from this thread
P.S. Mod's can we get a forum section for Android Accessory Development?
Now for Pics.

Now that is bad a**!!! I was waiting for something like this!!

Hey, I've been attempting to hack in the support into CM7 (nightly, 2.3.4) on my EVO without much success. I've rebuilt the kernel with the necessary flag enabled and ripped the JAR/XML files from the Nexus S update.
I've monitored logcat and seen that it does find the framework JAR (the application wouldn't install otherwise since it's a needed feature) and a dmesg scan shows that the kernel driver is being initialized.
What's happening now is I plug in the ADK and the output from the Arduino board spams that it couldn't get a protocol version from the phone. The phone slows down to a crawl as its probably being spammed with requests from the ADK for a protocol version and doesn't know what to do.
I'm at a loss here as to what I could possibly be missing. If you have any insight through your own endeavors it would be much appreciated.

Great stuff! I was also at Google I/O and picked up an ADK. Can you post the apk file of your app? I'd love to try it out.
And if you're feeling generous...the code?

badass. good ****

Well done mate...
Have tried it out with arduino UNO?...

uh uh, why i wasn't at the Google I/O
Google is doing really good s**t nowadays. I suppose that Arduino will guest in my house in some time as I am fascinated

I am Actually using the ADK with my Nexus One on an Arduino UNO and an USB-Host Shield from Sparkfun, it works equal but only take a fraction to buy it
My first project is an interface for my Audi, at the moment i only use it to start the Motor, but in future i want to try to build a CAN-BUS interface...

Sure here is the compiled ADK.
-Nik

bharathp666 said:
Well done mate...
Have tried it out with arduino UNO?...
Click to expand...
Click to collapse
The Arduino UNO doesn't have native USB Host support onboard like the megas.
You will need a USB Host shield and will have to modify the Arduino code.

SoyoBro said:
Great stuff! I was also at Google I/O and picked up an ADK. Can you post the apk file of your app? I'd love to try it out.
And if you're feeling generous...the code?
Click to expand...
Click to collapse
You can find all the ADK instructions and code here.
Note: When you select your build target you must choose
Target Name - Vendor - Platform - API Level
"Google APIs" - "Google Inc." - "2.3.3" - "10"
Otherwise you will get errors trying to build on the new libs. The instructions on the ADK page wern't very clear about this. Took me awhile to figure that one out.
You will need to update your Android SDK if you don't see those options.
-Nik

As for the point of using an arduino uno, Oleg is providing an newer version of his USB lib, it now works with his shield and the ADK.
My car is almost starting with the ADK, i am only missing a few relays and stuff to get it completed but i posted a proof of concept on youtube. Text an explanation is all german, sorry for that
http://www.youtube.com/watch?v=FlvpMwSxgMg
if there are any questions Ill be here for you

Great stuff. I am really looking forward to this.
But what I don't get is which hard- and software is required:
- is 2.3.4 sufficient?
Answer: YES
- do other devices (running 2.3.4) than the Nexus 1/S work?
Answer: Pending
- will an Arduino Duemilanove board work?
Answer: NO
Thanks for your help, guys
Besides those questions I have one more:
- assuming I have a board that is connected to a power supply. will i be able to charge an Android device when connecting the board to the handset via USB?
Answer: depends on the boards and its power consumption/outlet. Basically, it should

Nikropht said:
P.S. Mod's can we get a forum section for Android Accessory Development?
Click to expand...
Click to collapse
+1 for a dedicated section.
I reckon it's gonna take off as soon as more USB host boards become available

My Arduino Duemilanove works perfectly

Related

Someone to write a program

I know this is for programmers only but since I am looking for a programmer I figured it would be okay for me to post this here.
MODS - If it belongs someone else then please feel free to move it...
I own a HTC Universal (Cingular 8125) and I am also a diver. For a few years I looked at various Palm based dive logging software (when I had a Palm) but never bought one because I like to write longish descriptions of the dive and didn't want to do that in Graffiti or bring both a Palm and a portable keyboard on a dive trip. The desire to minimize electronic gadgets (and weight) is also why I never bring a laptop along with me. However, with the 8125 I have one device that I can bring with that lets me watch movies on the plane, listen to music on the beach, check my e-mail if I find find a wifi hotspot, and has the full keyboard and can use as a phone since it is GSM!
That being said, most dive comptures have the capacity to download information about the dive (depth, temperature, etc) to a computer. This information is very useful when you combine it with a log since it allows you to see what is called your dive profile and if you have the right logging software you can then combie this profile with your comments and create a really neat electronic log book.
However, the logging software for my computer, and I believe most computers, will not download to my device to any device running WM5. I had pretty much given up and figured I would have to wait awhile until these silly companies ralized there was a demand for WM5 and hopfully created software so you could download your computer information directly into your phone. However I recently found this device http://reefnet.ca/products/sensus/ which is very different. It is more of a logger than a dive comuter in that you do not interact with it during the dive and it does not give you any guidance about dive limits. One of the biggest things that makes it different is that they, "realizes the benefits of publishing the technical details of its data recording devices. If you're a software developer, dive organization, or just curious, you may download our free Developer's Guides. In them we carefully detail everything you need to know to be able to download data from Sensus recorders. The Sensus Ultra Developer's Guide is AVAILABLE NOW!"
So what I was thinking is that someone might be able to create software for WM5 so that we could download the information directly into a Pocket PC. This could then perhaps be combined with a program like this
http://blackwave.com/products/DiveAssistantPocketPC/index.aspx or this http://www.dreamdives.org/en/products/products1.htm to create the full package.
I think this would be a killer app that could make someone a few bucks. All I would ask for would be a free copy. I will even do the testing for free. the only big hurdle that I know of, and why they currently do not support download to WM5 is that the downloader uses serial ports.
Here is the link to their developers guide
https://secure.reefnet.ca/downloads/public/doc/sensus_devguide_ultra.pdf
If any one has any questions please feel free to PM or e-mail directly at bigcatdiving at gmail dot com
dcdivenut: why do they sell Palm software? What does the Palm software do? Presumably it doesn't link directly to the logger? Although, IIRC, the Palm does have a kind of serial port built in.
Your biggest hurdle here clearly is the physical lack of a serial port.
Basically you've got a logger, and want to connect it to the phone? Converting the data into a universal format should be straight forward, most logging is done in clear and easy to manipulate text.
So, how do you get around the hardware limitation? You could wire together a serial to IRDA converter and blast the logs directly into the infra red port. But is that the kind of thing you want or need?
V
Or you could use a bluetooth to serial converter. It may actually be more stable and easier to use than IrDA.
J-Man5
vijay555 said:
dcdivenut: why do they sell Palm software? What does the Palm software do? Presumably it doesn't link directly to the logger? Although, IIRC, the Palm does have a kind of serial port built in.
Your biggest hurdle here clearly is the physical lack of a serial port.
Basically you've got a logger, and want to connect it to the phone? Converting the data into a universal format should be straight forward, most logging is done in clear and easy to manipulate text.
So, how do you get around the hardware limitation? You could wire together a serial to IRDA converter and blast the logs directly into the infra red port. But is that the kind of thing you want or need?
V
Click to expand...
Click to collapse
I !think! the palm software allows you to download directly to the Palm via the serial port.
As far as an infrared port to get the data into the PC that is more or less exactly what I am looking for. Here is a long discussion on a scuba forum that involves a programmer from the company that might gove some additional information.
http://scubaboard.com/showthread.php?t=140213&highlight=sensus+ultra
I guess there are two challenges
1. Getting the data from the logger to the device either via some sort of serial/USB converter or serial/IRDA converter. I found this out there which would "seem" to work http://www.usbgear.com/IR-210S.html
2. Then having a program to take that data and with a decent GUI turn it into something displayable a la the palm and windows software on their website. Then possibly taking it a step further and integrating that into "dive log" software so that in addition to the profile information gathered from the logger you can record where you were, who you were with, what you saw, what equipment you had, etc. a la the blackwave or sharkpoint software.
Why not try styletap to run the palm software on the pocketpc windows mobile?
J-Man5

PS3 Control on Android Devices?

So I was running through the source code for the Behold 2 Kernel.
I found: kernel\drivers\ps3
with files inside to control/manage the PS3 system. (Turn on, off, etc)
Is there a way to activate those drivers and actually connect your phone through bluetooth to the PS3 and control it? On, Off and move around in the menu?
That would be pretty interesting... specially if you can get Remote Play to work on an android device!
Wow, if this is true then i'll definitely get an android phone to play with!
I guess not many people with ps3's around here. I'd love to have some sort of interaction with my ps3.
I'd really like this functionality too.
mrandroid said:
So I was running through the source code for the Behold 2 Kernel.
I found: kernel\drivers\ps3
with files inside to control/manage the PS3 system. (Turn on, off, etc)
Is there a way to activate those drivers and actually connect your phone through bluetooth to the PS3 and control it? On, Off and move around in the menu?
That would be pretty interesting... specially if you can get Remote Play to work on an android device!
Click to expand...
Click to collapse
I think that the catch with android and bluetooth keyboard/mouse support was the lack of the HID profile. If the behold actually has that built in custom it would unlock a lot more than just ps3 support, but I'd love that too.
They have managed to port the Remote Play features to MS Windows so it must be possible to port it to a Linux based OS (i.e.. Android)
Tawm said:
They have managed to port the Remote Play features to MS Windows so it must be possible to port it to a Linux based OS (i.e.. Android)
Click to expand...
Click to collapse
There has to be a way. The Kernel source codes come with PS3 Modules built by sony. The PS3 itself runs on linux (original ps3s even support installing linux operating systems)
I believe someone would need to activate those modules and rebuild a kernel, then someone needs to build an APP to take advantage of those features.
For sure we can connect through bluetooth and turn on/off the system and navigate the menu... That much the modules tell you. But again we need an APP for it too.
Thats cool if you can controller the ps3 i would buy an app for that
me too!
mistake. please delete
I'm eagerly waiting for this functionality to reach the Android platform too. Perhaps, now when SonyEricsson is focusing on the Android platform we'll see this kind of functionality implemented into a Android based device soon, and perhaps then ported to other devices.
Best case scenario would in my eyes of course be that the Android platform itself would support necessary HID profiles. I know that Android 2.X supports more Bluetooth stacks than previous versions, but that doesn't help I suppose..?
This company is making an app to use external bluetooth keyboards as an input device for Android. Maybe we can see if they could also make one for Android to control other devices such as the PS3. I just posted on their forum to ask if they could do this (if even possible):
http://www.teksoftco.com/forum/viewtopic.php?p=5247#5247
I for one can't wait for the day that I can use my Android phone to input text on my PS3.
EDIT: they already replied. that was fast! ...so it's do-able but need "community interest" before investing. [hint, hint]
jasnmb said:
..so it's do-able but need "community interest" before investing.
Click to expand...
Click to collapse
*shows interest*
xPatriicK said:
*shows interest*
Click to expand...
Click to collapse
we all should post to that forum to show as much interest as possible.
yeah, this would be great, if not by blutooth, even if we had to plug it in usb I would be fine with that.
*shows interest*
bluemaemo should work as the N900 is running on linux too:
http://www.valeriovalerio.org/?page_id=174
Turn your android mobile device into a bluetooth keyboard huh... *shows money*
maybe we should start a poll and link them to it... id pay to use my G1 as a bluetooth keyboard & touchpad on my ps3
Is there a way to do the contrary? I mean, control your phone with a PS3 controller, for games?
mrandroid said:
So I was running through the source code for the Behold 2 Kernel.
I found: kernel\drivers\ps3
with files inside to control/manage the PS3 system. (Turn on, off, etc)
Is there a way to activate those drivers and actually connect your phone through bluetooth to the PS3 and control it? On, Off and move around in the menu?
That would be pretty interesting... specially if you can get Remote Play to work on an android device!
Click to expand...
Click to collapse
I do/did some research and worked on a Linux OS based on some code from the PS3-Linux project, a collaboration between Sony and the open-source community to help port Linux to the Cell Broadband Engine architecture and the Playstation 3. If you look, on the XrossMediaBar of old "fat" PS3's, under Settings > System Settings, there's an option for "Install Other OS" and "Select Default System". It was dropped/suspended indefinitely on development of the slim PS3's, to save time and money (since the slim PS3 re-does some central things in the I/O architecture, requiring a new hypervisor to be programmed.)
I'm actually considering porting the Android OS to the Playstation 3 sometime in the future, as a media-center, games and apps environment alternative to the PS3's OS. It will likely be based on my experience with the Electricsheep android firmware, another one of my projects.
Android, though built with touch in mind, works fine with a directional control and menu keys, not unlike the PS3 controller. A virtual mouse built on the right analog stick won't hurt either. Sixaxis provides the accelerometer, too. Not sure how it'll fare at 1080p resolution, but I'll wait 'till I get it ported to test that.
What I'm guessing, is that either someone else was considering the same thing, and pushed the drivers for the PS3's hypervisor and I/O from the mainline kernel into Android, or just left that in there and forgot to remove it.
But no, I don't believe said drivers are actually for remote-controlling the PS3 either by Bluetooth or Remote Play. They're likely not even compiled on builds for mobile phones (unless someone makes a Cell-phone.. hehe... eh.. *ahem*)
Anyway, if someone else already said this, I'm sorry, but I didn't read the entire thread. It's kinda long.
Also:
blackplatypus said:
bluemaemo should work as the N900 is running on linux too:
http://www.valeriovalerio.org/?page_id=174
Click to expand...
Click to collapse
Maemo could and probably would run on the G1: the basis for my Utopia Pocket Linux project.

[Q] android IDE under Android OS

Hi there.
I don't know if I have to post it here or in the Apps section...
Is there an IDE for android that would run under Android, so I could develop when no computer is available?
Thanks
Nico
There is no IDE per-se, but you could just use a text editor to write some code and then sync it back when your development computer is available. I can't see anyone expecting to do serious full blown app development, like project management and debugging, from a tablet. But, I am an android newbie, so I may be wrong.
willyampz said:
I can't see anyone expecting to do serious full blown app development, like project management and debugging, from a tablet. But, I am an android newbie, so I may be wrong.
Click to expand...
Click to collapse
Actually the fact is that my tablet is quite as powerful as my desktop computer... or even more. Then, as I can plug in a mouse and connect a keyboard by bluetooth, I do not see any reason because of what it would not be possible
Nico
You should have posted this in Q&A, no problem i'm moving it.
To acutally complie and build you need a full up linux environment, which android is not. You can edit code as text and such, but you cannot complie, link and build on android

[DEV] AndroidLib - .NET Android Device Communication and Management Library 01.20.13

Description:
AndroidLib is a .NET assembly written in C# (C-Sharp) that easily handles communication between a connected Android device and your program. Currently, there is a large amount of automated controls, eliminating thousands of lines of code the programmer has to write themselves. The class AndroidController is a semi-wrapper of the ADB (Android Debug Bridge) binary. The other class you will be working with the most is the Device class. This class contains useful information about the device (for example: software/hardware info, memory info, battery stats, mount points for partitions, root status, busybox information, and much more), as well as exposes many instance methods to control your phone such as Rebooting, Mounting Filesystems, Push/Pull/Install Files, and much more to come. AndroidLib contains all of the Android binaries necessary to work properly. AndroidLib also assumes that the phone's USB drivers are already installed correctly on the target machine, or that your program will take care of it on it's own.
This is perfect for any developer who would like to create, for example, an auto-rooter or any other application that needs to connect with Android devices through a .NET application. AndroidLib provides all the methods needed to communicate with the Android device. This will cut back on the code you have to come up with and write yourself by a HUGE amount!
What it does:
Provides easy-to-use code for communicating with Android devices in .NET
Provides easy access to information about the connected Android devices
Has a large list (and growing...!) of methods that control connected Android devices
Please credit the work here by me in your own projects; not only to give thanks to me and the many hours I am putting in to this project, but so others know where to find it if they need to!
Usage:
Add a reference to AndroidLib.dll in your .NET project and begin using this great API. Please refer to the "Getting Started.txt" guide and full documentation included in the zip.
Requirements:
.NET 3.5 or Higher
Changelog (Only most recent version displayed, full Changelog in download)
Version 1.5.1.0 | 01.21.13
Fixed Device.InstallApk() bug
Download Latest Release
GitHub
Online Documentation
Sample Solutions Using AndroidLib:
C# (C Sharp)
Visual Basic (VB)
AndroidLib Featured Projects by XDA Users:
RegawMOD Evo 4G LTE Rooter - XDA
RegawMOD CDMA Hero Rooter - XDA
RegawMOD Rebooter - XDA
Droid Manager by DeepUnknown - XDA - Google
Android SMS - XDA - Home Page
Quick ADB Pusher by Goatshocker - XDA
reserved just in case
It's very useful, thank you very much, im planning to code a Filemanager like qtadb, because qtadb is sucking too often
In the process of completely redesigning the library (due to coding stupidity), basically from the base class up. I should have a beta1 out by this weekend for testing. All that are interested in beta testing this library for their Android .NET projects, post here and I'll add you to the list of testers!
It would be great!
Can you add something like adb forward? So we can connect to an android service without using ADB, that as we all know sucks!
Mrc527 said:
It would be great!
Can you add something like adb forward? So we can connect to an android service without using ADB, that as we all know sucks!
Click to expand...
Click to collapse
Yeah, I'll throw in a method to create a port forward. What I have now uses the bridge, which is included in the assembly, but handles all of it silently and very well. I should have a build out soon (most likely this weekend). As long as you don't dispose the AndroidController object, that port forward will be good, so you can use your own Socket code
regaw_leinad said:
Yeah, I'll throw in a method to create a port forward. What I have now uses the bridge, which is included in the assembly, but handles all of it silently and very well. I should have a build out soon (most likely this weekend). As long as you don't dispose the AndroidController object, that port forward will be good, so you can use your own Socket code
Click to expand...
Click to collapse
Great work! really, great idea!
You can change the .NET to 3.5? I too code in .NET, and I try to keep the .NEt version as low as possible!
SimranSingh said:
You can change the .NET to 3.5? I too code in .NET, and I try to keep the .NEt version as low as possible!
Click to expand...
Click to collapse
Yeah, I actually did that a few days ago, forgot to update the OP.
Where is it possible to download?
Mrc527 said:
Where is it possible to download?
Click to expand...
Click to collapse
I'm just writing the documentation for this. I'm pretty sure I'll have it done today.
Yeah! Just a joke. When finished I'm sure will be a success!
Inviato dal mio Galaxy Nexus usando Tapatalk
Making some last minute changes to the Device class, then I'm going to finish the documentation and release it. Just keeping you updated.
Ok everyone, the new documentation is up (Online) (Offline). For the beginning of this product, I would like developers to pm me, or reply here in the thread if they would like to try the library out for their project, and I'll send it to them. It's still under development, and there will be updates coming out regularly. Shoot me a pm or post here and I'll send you a link right away.
regaw_leinad said:
Ok everyone, the new documentation is up (Online) (Offline). For the beginning of this product, I would like developers to pm me, or reply here in the thread if they would like to try the library out for their project, and I'll send it to them. It's still under development, and there will be updates coming out regularly. Shoot me a pm or post here and I'll send you a link right away.
Click to expand...
Click to collapse
Meeeeeeeeeeeeeeeeeeeeee!!
Hi,
I'm C# developer and i would like to try your lib, can you send it please?
Thanks in advance, and great work.
Hey guys, check the first post to download the library. It is in a zip which includes the dll, "Getting Started.txt" and the documentation. Please read the getting started guide before diving into it! And please give me feedback on it. That would be much appreciated in order for me to deliver a better product.
Dan
Great work!
It works without any problem to me!
Next update will have these features internally implemented:
Package Manager (inside the phone's shell)
Ability to install/uninstall apks
Ability to freeze/unfreeze apks
Ability to backup/restore apks
A class that will handle signing of update zips
More internal information about connected device (cpu, environment, etc)
Possible wrapper of AAPT
That seems like a good amount for the next update. Please post anything you wish to share about the library after using it for these few days.

Using an Arduino via Bluetooth to Windows Phone

Hi Everyone,
I haven't been very active for awhile but only because I am trying to do big things for Windows Phone and Hardware Hackers alike. I've been making Hardware to interact with my Arduino/ATTiny/ATMega Projects.
Why use Arduino? They're very popular and one of most open Microcontrollers as well as VERY cheap. Besides that, my Robot Club here in Vegas uses it as the primary MC "base".
You can see it in action at (YouTube Tags didn't work...):
http://www.youtube.com/watch?v=JOMnmA0EwJo
If you'd like to see the Arduino Code, check out:
https://github.com/lanceseidman/Arduino-Bluetooth-WinPhone8/tree/master/Arduino
The Windows Phone Code (Coming shortly, also a NuGet Project + IR, TEMP., ETC):
https://github.com/lanceseidman/Arduino-Bluetooth-WinPhone8/tree/master/Windows Phone 8
I'll be talking about making Robots, RC Cars/Planes, TV Controllers, and more soon.
Nice.
I've been thinking about this these past few days, and figured several ways of doing it.
By the way, is this possible on 7.8 as well?
mcosmin222 said:
Nice.
I've been thinking about this these past few days, and figured several ways of doing it.
By the way, is this possible on 7.8 as well?
Click to expand...
Click to collapse
7.8 is not compatible with most Bluetooth functionality, it's extremely basic. Only 8 has actual decent functionality.
If you had 7.8, I would recommend using WiFi+Web Server and have a page with all the commands you want and would obviously be accepted/used via Web Browser.
FULL PROJECT ONLINE: https://github.com/lanceseidman/Arduino-Bluetooth-WinPhone8

Categories

Resources