Android Tutorial Arduino ADk Consummation

FrancescoS

Member
Licensed User
Longtime User
Great Job agraham !!
I'm new, my goal is to create a standalone alarm system with arduino ADK and my old samsung i9000 android 4.0.3.

First I try to autostart the agraham "Arduino ADK Example" while plug the usb cable from android ADK to i9000.
I followed the instructuions by agraham in this post:

- I have created the readonly "accessory_filter.xml" with this code:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<usb-accessory manufacturer="Arduino ADK Example" model="Arduino ADK Example" version="1.0" />
</resources>

- I have inserted the following code in the manifest editor:
?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="b4a.example"
android:versionCode="1"
android:versionName="1"
android:installLocation="internalOnly">

<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="10"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>
<application
android:icon="@drawable/icon"
android:label="Arduino ADK Example">
<activity
android:windowSoftInputMode="stateHidden"
android:launchMode="singleTop"
android:name=".main"
android:label="Arduino ADK Example"
android:screenOrientation="unspecified">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>

<intent-filter>
<action android:name="android.hardware.usb.action.USB_ACCESSORY_ATTACHED" />
</intent-filter>
<meta-data android:name="android.hardware.usb.action.USB_ACCESSORY_ATTACHED"
android:resource="@xml/accessory_filter" />
</activity>
</application>
</manifest>

Compile ok
Transfer to i9000 ok
app works fine starting in manual mode

But if I plug the usb cable I receive the following message:


then...

Theese messages each time i plug the usb cable.
May You help me ?
Thanks
Francesco
 

Attachments

  • Foto-16-09-13-22-56-50.jpg
    47.2 KB · Views: 538
  • Foto-16-09-13-22-57-25.jpg
    41.2 KB · Views: 542

FrancescoS

Member
Licensed User
Longtime User
Hi Erel, no. It seems that it doesn't remember the association of USB accesory with the agraham app.
For Your info, before using Basic4Android, I have tested it with an example compiled in eclipse that i have founded in tha ADK tutorial in android, and it works.
Same so 4.0.3
Same i9000
Same ADK board

Thanks
Francesco
 

agraham

Expert
Licensed User
Longtime User
If you have not changed the Arduino program code this looks wrong.
<resources>
<usb-accessory manufacturer="Arduino ADK Example" model="Arduino ADK Example" version="1.0" />
< /resources>
For the accessory details specified in the demo sketch
B4X:
AndroidAccessory acc = AndroidAccessory("Anywhere Software",
"ADKDemo",
"Arduino ADK Board demo.",
"1.0",
"http://www.b4x.com",
"1");
I would expect to use
<resources>
<usb-accessory manufacturer="Anywhere Software" model=ADKDemo" version="1.0" />
< /resources>
 

FrancescoS

Member
Licensed User
Longtime User
Hi agraham,
now I need to receive data from arduino ADK board.
In Your example you send data to arduino, I need to implement a two-way data transfer.
ie: if i close an arduino pin, I need to know it in Basic4android.
Also what is Your advice to poll data from arduino in Basic4android ? (timer, interrupt, event ?)
Thanks
Francesco
 

akosije

Member
Licensed User
Longtime User
How's the connection of this ?

Android tablet to Arduino Mega ? Then whats next sir ? I cant open port COM 7 on Arduino IDE on my laptop coz i connect my arduino to my android tablet.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…