I am trying to provision the Nymi band from my android app. I am using the sample code from the Nymi Android SDK 2.0 (Can be downloaded from here:). I removed all the code related to the Nymulator(Nymi band emulator). I want to test the provisioning with the real Nymi band. However,when I click the provision button, the app get crashed. I tried to debug it with the exception breakpoints and I got the "getsockopt errno 88" error in my debugger:
I am attaching the screenshot too.
I did some research on google , and found that the errno 88 is
#define ENOTSOCK 88 /* Socket operation on non-socket */
During the app launch, I see the following message in the Debug Console:
Connected to the target VM, address: 'localhost:8604', transport: 'socket'
which I think,the connection to socket is fine. I am not sure,what makes the socket connection go wrong later.
This is what I see in my LOgCat after I click the provision button:(I am posting only some part of the error message,because the error message in Logcat is way too long)
Edit: I added some breakpoints,and I found where the app is crashing. I found this code:
try {
System.loadLibrary("_nymi_sdk_net");
_loaded = true;
} catch (UnsatisfiedLinkError var6) {
return false;
}
At system.load library, I am getting the error.
Edit 2: I changed the libraries from net to native ,as net is for emulators and native is for device. This time new error occurs at the same line:System.loadLibrary("_nymi_sdk");
Screenshot:
(Disclaimer: I know nothing of this SDK or the band, and this answer is just a speculation. And I've deleted my earlier answer as it was a missed shot in the dark.)
There is a minor hint in the SDK's README.md:
Prerequisites:
Android Development:
[...]
To use the BasicExample app with a Nymi Band, the NCL library in Examples\BasicExample\libs must be replaces with the native library in
NCL\native\libs
You must remove all files and folders from BasicExample\libs and copy all files from NCL\native\libs there instead.
(I wonder why they didn't emphasize this much harder...)
So the libs folder should contain the following folders and files:
Related
I have built a custom ROM that I'm testing on Android Cuttlefish, but when I go to boot the device on the command line using the launch_cvd command, I get the following errors:
[assemble_cvd ... fetcher_config.cpp:212] Could not find file ending in kernel
[assemble_cvd ... fetcher_config.cpp 212] Could not find file ending in initramfs.img
run_cvd returned 23
Subprocess 39641 exited with error code: 23
The main issue seems to lie in the 'error 23' that is returned by run_cvd.
I have tried Google searching and browsing popular forums where Android is built and debugged (XDA Forums, Reddit, StackOverflow, the Android Building Google Group, YouTube, and the web in general). I have also posted on Reddit and will post on the Android Building Google Group. Additionally, I have looked through the source code for Cuttlefish on Google's Git repo to find why the program is outputting the error to no avail.
Lastly, I read through the logfiles of Cuttlefish to see the errors outputted by Cuttlefish. The kernel.log file seems to show the kernel booted successfully (despite the command line saying that it couldn't find the kernel file), I would imagine the same is true of initramfs.img, but I have no way of confirming that initramfs.img was successfully found by launch_cvd. The logcat file is empty (likely because the Cuttlefish failed to boot) and launcher.log simply reproduces the output on the command line (which contain the four errors I listed above).
Could anyone help me troubleshoot this issue? Your help would be greatly appreciated!
Do ps -A | grep crosvm to see if crosvm is running already.
If it is do stop_cvd || true or kill crosvm process with process PID.
My Android app is using 3rd party library that uses native libraries.
It is built with targetSdkVersion 21.
When running my app on Android 7 phones (in my example, LG G20), users start getting a visible error message upon process initialization.
The error message screenshot is attached.
When running the same app on Android 5.x and 6.x, there is no error shown to the user, although there is still a matching warning message in the log. Log message looks like:
library "/data/app/org.iotivity.base.examples.simpleclient-1/lib/arm/libocstack-jni.so" has invalid DT_NEEDED entry "./obj/local/armeabi/libocprovision.so"
ךibrary "/data/app/org.iotivity.base.examples.simpleclient-1/lib/arm/libocstack-jni.so" has invalid DT_NEEDED entry "./obj/local/armeabi/libocpmapi.so"
So it looks likes Android 7 "decides" to show to the end user a warning which is kept for the log only in previous versions.
I would appreciate:
1. Ideas on how the error message can be suppressed
2. Hints on what is the right solution for the issue (this is a 3rd party code, but I may try to tweak the build process)
Thanks in advance
Max
On my Windows 7 platform, I have the latest version of adt bundle (20140321) and ndk (r9d) installed. The installation is as clean as it gets. The environment variables NDK_ROOT, PATH, etc. are all defined properly.
The application that I am working on has some native code that gets built with armeabi-v7a ABI. The app platform is andorid-19. Project settings define build as "ndk-build NDK_DEBUG=1."
From Eclipe, when I debug my application on my samsung tablet as "Android Java Application," everything works as expected. However, when I try to debug the app as "Android Native Application," I get the following error:
Attempting to connect debugger to 'com.mycomp.myapp' on port 8604
gdbserver output:
Cannot attach to lwp 28275: Operation not permitted (1)
Exiting
Verify if the application was built with NDK_DEBUG=1
The application runs fine on the device though.
I have looked at various messages on stackoverflow. However, I could not find any concrete step to fix this problem. Would appreciate if you can guide me in the right direction. Regards.
I have same problem. After wasting some time I found that when I return my simple function without any operation problem does not occurs.
void dmpBuffer(char* msg, unsigned char* buffer, int buffLen)
{
//return;
char szDumpBuffer[128];
for(int i=0; i<buffLen; i++)
sscanf(&szDumpBuffer[i*2], "%02X", buffer[i]);
LOGE("%s:%s", msg, szDumpBuffer);
}
maybe it is because of memory problems.
Update:
As I had Guessed it was memory problem.
My BIG mistake was using sscanf instead of sprintf!!!
My problem solved.
So a few days ago I got my hands on an Arduino Mega ADK board, and the last couple of nights I have been setting up my development environment, getting to grips with the tools etc. The tools and libraries all work fine, for example I can get a program written in the Processing IDE to compile and run on an Asus Eee Pad Transformer TF101 running Android 4.03. But when I get it to try to compile and run one of the pre-written examples, it gives me a compiler error:
Android SDK Tools Revision 20
Installed at C:\NVPACK\android-sdk-windows
Project Type: Application
Project Target: Android 2.3.3
API level: 10
Library dependencies:
No Libraries
API<=15: Adding annotations.jar to the classpath.
Merging AndroidManifest files into one.
Manifest merger disabled. Using project manifest only.
No AIDL files to compile.
No RenderScript files to compile.
Generating resource IDs...
Generating BuildConfig class.
BUILD FAILED
C:\NVPACK\android-sdk-windows\tools\ant\build.xml:680: The following error occurred while executing this line:
C:\NVPACK\android-sdk-windows\tools\ant\build.xml:693: Compile failed; see the compiler error output for details.
Total time: 7 seconds
And that's all the console seems to output as well, which is rather frustrating! As far as I'm aware all of my SDK versions, tools and plugins are all up to date. I've tried this using a Linux partition I have on my hard drive and it produces the same error message, although it mentions a problem with the package com.Android.future.UsbAccessory. Given what I've seen, it seems that the problem is with the tools, either my directory structure doesn't match up to what the correct setup is, or something else is wrong :S. If anyone has had similar problems, some help would be smashing! (For the record, my setup was done using the instructions on the Arduino website, although I already had the Android SDK tools installed).
Will Scott-Jackson
It sounds like your haven't added in the support library to your project and/or you haven't downloaded it into your Android SDK.
The ADK1 demokit app targets API Level 10 (Android 2.3.3); That means you need to use the support libraries in your project and that's why the compiler is complaining about level 10 library dependencies not being available. The support libraries are a separate download in the SDK Manager, so you might not have them in your development environment.
In Android API Level 12 and higher, the USB Accessory protocol was added to the framework API, so there are two different ways to use the accessory protocol. So, you don't have to use the support libraries if you are targeting Honeycomb and higher versions, but you'll have to update the demokit app code to make this work.
Hope this helps.
So I've double checked my setup and started working on a project I had in mind, it seems to import the libraries appropriately. So far so good, but when I input:
ArduinoAdkUsb arduino;
void setup() {
arduino = new ArduinoAdkUsb(this);
//Other UI initialisation etc.
}
I get this error:
##name## ##version## by ##author##
FATAL EXCEPTION: Animation Thread
java.lang.NoClassDefFoundError: com.android.future.usb.UsbManager
at cc.arduino.ADKCommunication.<init>(Unknown Source)
at cc.arduino.ArduinoAdkUsb.<init>(Unknown Source)
at
processing.android.test.sketch_120730a.
sketch_120730a.setup(sketch_120730a.java:48)
at processing.core.PApplet.handleDraw(Unknown Source)
at processing.core.PGraphicsAndroid2D.requestDraw(Unknown Source)
at processing.core.PApplet.run(Unknown Source)
at java.lang.Thread.run(Thread.java:856)
After the app has been built and installed onto the Android tablet I am using. Any thoughts how I can over come this? From what I can tell, this has no problem finding com.android.future.usb.manager to compile and install the program, but once it tries to run it can find it.
Based on this tutorial from http://stream.tellart.com/controlling-arduino-with-android/
In the examples RGB_Arduino the name, version and author variables are set at the top of the sketch.
Try adding in this section of code at the top of your arduino sketch just underneath the library imports
// accessory descriptor. It's how Arduino identifies itself to Android
char applicationName[] = "Mega_ADK"; // the app on your phone
char accessoryName[] = "Mega_ADK"; // your Arduino board
char companyName[] = "Freeware";
// make up anything you want for these
char versionNumber[] = "1.0";
char serialNumber[] = "1";
char url[] = "http://labs.arduino.cc/adk/"; // the URL of your app online
//initialize the accessory:
AndroidAccessory usb(companyName, applicationName,
accessoryName,versionNumber,url,serialNumber);
I'm trying to make a project using the arduino ADK board http://arduino.cc/en/Main/ArduinoBoardADK and a Sony Ericsson Xperia Play running android 2.3.4. For starters all I want to do is blink a led from my android device, using the nice tutorial found here http://allaboutee.com/2011/12/31/arduino-adk-board-blink-an-led-with-your-phone-code-and-explanation/ .I managed to compile the android app but I'm having big difficulties on the arduino sketch, I can't resolve the imports and it won't compile on Windows7. I understand there are some arduino IDE version issues. I tried compiling both on 0022, 0023 and on 1.0. The furthest I could go with the code I was getting these compile errors after editing the AndroidAccessory.h:
D:\arduino-0023\libraries\AndroidAccessory/AndroidAccessory.h:37: error: 'EP_RECORD' does not name a type
D:\arduino-0023\libraries\AndroidAccessory/AndroidAccessory.h:50: error: 'EP_RECORD' has not been declared
D:\arduino-0023\libraries\AndroidAccessory/AndroidAccessory.h:50: error: 'EP_RECORD' has not been declared
D:\arduino-0023\libraries\AndroidAccessory/AndroidAccessory.h:64: error: 'USB_NAK_LIMIT' was not declared in this scope
I think I read the whole documentation and I can't find a solution to my problem. Setting this up is such a pain... I really need to make this work. Thank you in advance! :)
---------------------------------------------------------------------------------------------------------------------------
EDIT1: The solution which worked for me was to compile the sketch on Linux (Ubuntu)
---------------------------------------------------------------------------------------------------------------------------
EDIT2: Once again using the newest USB library from arduino website the code DOESN'T compile. I tried compiling on IDE v22 and v1.0.2 running both Windows 8 and Ubuntu 12.10 with the following errrors:
E:\Development\arduino-1.0.2\libraries\UsbHost/AndroidAccessory.h: In function 'void setup()':
E:\Development\arduino-1.0.2\libraries\UsbHost/AndroidAccessory.h:68: error: 'void AndroidAccessory::powerOn()' is private
sketch_jan10a:16: error: within this context
E:\Development\arduino-1.0.2\libraries\UsbHost/AndroidAccessory.h: In function 'void loop()':
E:\Development\arduino-1.0.2\libraries\UsbHost/AndroidAccessory.h:66: error: 'int AndroidAccessory::read(void*, int, unsigned int)' is private
sketch_jan10a:23: error: within this context
The library was written and tested in:
Arduino Alpha 0022
Have you tried adding this to ArduinoAccessory.h?
#if defined(ARDUINO) && ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
Also I would recommend reading through this as well:
http://developer.android.com/guide/topics/usb/adk.html#installing
It specifically mentions you need the CapSense library as well for the Android shield on an Arduino:
http://www.arduino.cc/playground/Main/CapSense
It also mentions that you need to install avr-libc as well:
sudo apt-get install avr-libc
MAC OS X:
fink install avr-libc avr-gcc avr-binutils avrdude
EP_RECORD is defined as part of the USB Host Shield 1.0. However, it is being removed in USB Host Shield 2.0 library.
See the announcement here: http://www.circuitsathome.com/mcu/usb-host-shield-library-version-2-0-released
So the error messages you have with EP_RECORD will surface again if you ever upgrade to 2.0. Also check out the adk.h and adk.cpp from version 2.0 on GitHub. The updated DemoKit 2.0 example no longer use the AndroidAccessory.h/.cpp.
Sounds to me like you're just missing the USB_Host_Shield/Usb.h header, which defines those constants.
Place this code where other defines are in Usb.h
#define USB_NAK_LIMIT 32000 //NAK limit for a transfer. 0 means NAKs are not counted
Place this just after SETUP_PKT's typedef in Usb.h
/* Endpoint information structure */
/* bToggle of endpoint 0 initialized to 0xff */
/* during enumeration bToggle is set to 00 */
typedef struct {
byte epAddr; //copy from endpoint descriptor. Bit 7 indicates direction ( ignored for control endpoints )
byte Attr; // Endpoint transfer type.
unsigned int MaxPktSize; // Maximum packet size.
byte Interval; // Polling interval in frames.
byte sndToggle; //last toggle value, bitmask for HCTL toggle bits
byte rcvToggle; //last toggle value, bitmask for HCTL toggle bits
/* not sure if both are necessary */
} EP_RECORD;
I think if we really know what this EP_Record epRecord[8]; is all about that might help. EP_Record has not been declared in this file. Therefore, it does not have a type. When I gave USB_NAK_LIMIT a type of int that error went away. I have no idea what type to give to EP_Record? The only thing I can think of is that it might be an array epRecord[8]; looks like an array.
While the Android Developer's site is useful it does lack in many ways. One would be some online help for developers. This seems the be the only source for answers to questions and most of them do not really solve the problems.
This sounds kind of like a issue I had a while ago.
(so I used microbridge not the ADK with a USBDroid) I had to
go into 3 libraries, The error message pointed me to them
//(Note:Which were copied into the the general arduino sketch folder not the arduino normal libraries location) That may be your issue?)
I then replace wiring.h with Arduino.h in each.(Note Make a backup of all to save some stuffing around if this is not your issue) Copy then into a folder named the same but with a number before the name that way when you restart the arduino software you will get a error ignore this and compile.
The result was working USBdroid as seen at
http://www.youtube.com/watch?v=h7aa_6PNdRI
Still a Work in progress but made me happy. I still have a few buggs to work out.
Cheers,
Al
Install ArduinoADK BETA 001 which is the latest ADK available till date.
Unzip it and in the arduino folder you will find libraries and libraries-V2.
If you copy USB host in libraries you will get androidaccessory.h read private error
Copy USB host from libraries V 2 you should be able to compile successfully. I was.