I am trying to run the Arduino ADK + Android examples (analogRead, digitalWrite, etc.) But I am getting the following compile error:
-compile:
[javac] Compiling 3 source files to C:\Users\???\AppData\Local\Temp\android7678598093798196219sketch\bin\classes
[javac] C:\Users\???\AppData\Local\Temp\android7678598093798196219sketch\src\processing\android\test\adk_analogRead.java:28: cannot access com.android.future.usb.UsbAccessory
[javac] class file for com.android.future.usb.UsbAccessory not found
[javac] arduino.connect( arduino.list()[0] );
[javac] ^
[javac] 1 error
I did some research and found this 9 months old post - http://forum.processing.org/topic/how-can-you-specify-the-target-api-level - where it talks about recompile Processing from source. However, I'm using version 2.0a5 and the team has already changed the source to use API level 10. (I also verified the generated code when I look inside the manifest xml file in temp folder.) Any idea how to fix this?
Just in case, I've successfully compiled and ran regular Processing app and deployed to Android (Nexus One.)
I think you need to use Google Android Api 3.1+
To use ADK, you can use API Level 10, but it needs to have the Google APIs attached (same thing you need to use Maps in your application).
If you're having trouble enabling the Google APIs, try switching to API level 12, where you no longer need the addon. However you'll now be using the android.hardware.usb library instead of com.android.future.usb.
Here's what I did to get the ArduinoAdkUsb examples to compile:
In Processing, switch to Android Mode
In Processing, go to Android -> SDK Manager
In SDK Manager, install Android 2.3.3 (API 10) -> Google APIs if not installed
Copy sdk/add-ons/addon-google_apis-google-10/libs/usb.jar to Processing/libraries/ArduinoAdkUsb/library/
Restart Processing
Related
My goal is to be able to make my Android TV Mi Box S (Oreo 8.1) transcode properly Dolby Digital+ (EAC3) sounds to Dolby Digital (AC3) and output it to, my AVR through SPDIF.
This transcodindg is possible with Kodi 18.1 applicition but is not proposed by other application or Android 8.1 settings. As Kodi is able to do it I reverse engineered Android stack. My conclusion are : - Android Oreo embeds any necessary codecs ans other stuff to do this transcoding but does not propose the settings to configure this - Android Pie proposes the wanted surround sound setting (output Dolby Digital on SPDIF)
So my goal is to backport Android TvSettings application from Pie to Oreo
I first tryed to generate TvSettings with Android Studio. I hacked the application resources but stopped when I understood that I would have to generate platfom dependacies (for instance SettingsLib.jar)
My second trial is to generate the entire Android platform. The build is complete and I can deploy TvSettings application on a x86 TV simulation BUT when I launched the TvSettings appplication I get this error :
--------- beginning of crash
2019-04-01 12:21:04.976 3987-3987/com.android.tv.settings
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.android.tv.settings, PID: 3987
java.lang.RuntimeException: Unable to get provider android.support.v4.content.FileProvider:
java.lang.ClassNotFoundException: Didn't find class
"android.support.v4.content.FileProvider" on path: DexPathList[[zip
file
"/data/app/com.android.tv.settings-2DkaCncwGQ874WP-kx3G4Q==/base.apk"],nativeLibraryDirectories=[/data/app/com.android.tv.settings-2DkaCncwGQ874WP-kx3G4Q==/lib/x86,
/system/lib, /vendor/lib]]
I searched this error on internet and it seems that it deals with multidex feature. This multidex feature is well documented for clean developped Android appliacation but nor reaally for applications extracted from Android platform and deployed with adb.
This problem is related to java libraries loading.
I found threads referring Android multidex feature but only for applications buils with Android Studio/Gradle and my app was build with Android platform
What can I do?
have you included fileProvider in your manifest?
Well there seems to be a root error during deployment of my TvSettings application. Here is its log :
E/dex2oat: Invalid version number in dex file header. File: base.apk
I read several pages and found this one very interesting : https://source.android.com/devices/tech/dalvik/configure
So, due to different optimizations, platform apps are not generated with the same file format that apps generated above platform API
My idea is to generate the whole platform including TvSettings app and to deploy TvSettings with adb. So the apk format may be wrong.
My next step is to add in TvSettings/Settings/Android.mk the flag below :
LOCAL_DEX_PREOPT := false
The upshot is I want to run code on the Hexagon DSP.
I've tried building Android-MSM for msm8994-eng (for a Nexus 6P) and msm8998-eng (for Intrinsyc APQ8098) but I get build errors with both.
I'm building on Ubuntu 14.04 with openjdk-8.
Not finding a lot of help in either the project or filing tickets for the board so as a last ditch effort thought I'd ask here.
Anyone with experience building Android-MSM for either msm8994 or msm8998?
The specific build error for msm8998-eng (for Intrinsyc APQ8098) is:
In file included from /media/openq835/OpenQ-835_Android-N_v1.0/OpenQ-835-v1.0/Source_Package/APQ8098_LA.UM.5.8.r1-01900-8x98.0_OpenQ835-v1.0/kernel/msm-4.4/include/linux/seqlock.h:35:0,
from /media/openq835/OpenQ-835_Android-N_v1.0/OpenQ-835-v1.0/Source_Package/APQ8098_LA.UM.5.8.r1-01900-8x98.0_OpenQ835-v1.0/kernel/msm-4.4/include/linux/time.h:5,
from /media/openq835/OpenQ-835_Android-N_v1.0/OpenQ-835-v1.0/Source_Package/APQ8098_LA.UM.5.8.r1-01900-8x98.0_OpenQ835-v1.0/kernel/msm-4.4/include/uapi/linux/timex.h:56,
from /media/openq835/OpenQ-835_Android-N_v1.0/OpenQ-835-v1.0/Source_Package/APQ8098_LA.UM.5.8.r1-01900-8x98.0_OpenQ835-v1.0/kernel/msm-4.4/include/linux/timex.h:56,
from /media/openq835/OpenQ-835_Android-N_v1.0/OpenQ-835-v1.0/Source_Package/APQ8098_LA.UM.5.8.r1-01900-8x98.0_OpenQ835-v1.0/kernel/msm-4.4/include/linux/sched.h:19,
from /media/openq835/OpenQ-835_Android-N_v1.0/OpenQ-835-v1.0/Source_Package/APQ8098_LA.UM.5.8.r1-01900-8x98.0_OpenQ835-v1.0/kernel/msm-4.4/arch/arm64/include/asm/compat.h:25,
from /media/openq835/OpenQ-835_Android-N_v1.0/OpenQ-835-v1.0/Source_Package/APQ8098_LA.UM.5.8.r1-01900-8x98.0_OpenQ835-v1.0/kernel/msm-4.4/arch/arm64/include/asm/stat.h:23,
from /media/openq835/OpenQ-835_Android-N_v1.0/OpenQ-835-v1.0/Source_Package/APQ8098_LA.UM.5.8.r1-01900-8x98.0_OpenQ835-v1.0/kernel/msm-4.4/include/linux/stat.h:5,
from /media/openq835/OpenQ-835_Android-N_v1.0/OpenQ-835-v1.0/Source_Package/APQ8098_LA.UM.5.8.r1-01900-8x98.0_OpenQ835-v1.0/kernel/msm-4.4/include/linux/module.h:10,
from /media/openq835/OpenQ-835_Android-N_v1.0/OpenQ-835-v1.0/Source_Package/APQ8098_LA.UM.5.8.r1-01900-8x98.0_OpenQ835-v1.0/kernel/msm-4.4/drivers/soc/qcom/qdsp6v2/apr_tal.c:15:
/media/openq835/OpenQ-835_Android-N_v1.0/OpenQ-835-v1.0/Source_Package/APQ8098_LA.UM.5.8.r1-01900-8x98.0_OpenQ835-v1.0/kernel/msm-4.4/drivers/soc/qcom/qdsp6v2/apr_tal.c:290:40: error: 'struct apr_svc_ch_dev' has no member named 'lock'
spin_lock_init(&apr_svc_ch[i][j][k].lock);
^
/media/openq835/OpenQ-835_Android-N_v1.0/OpenQ-835-v1.0/Source_Package/APQ8098_LA.UM.5.8.r1-01900-8x98.0_OpenQ835-v1.0/kernel/msm-4.4/include/linux/spinlock.h:99:24: note: in definition of macro 'raw_spin_lock_init'
__raw_spin_lock_init((lock), #lock, &__key); \
^
/media/openq835/OpenQ-835_Android-N_v1.0/OpenQ-835-v1.0/Source_Package/APQ8098_LA.UM.5.8.r1-01900-8x98.0_OpenQ835-v1.0/kernel/msm-4.4/drivers/soc/qcom/qdsp6v2/apr_tal.c:290:5: note: in expansion of macro 'spin_lock_init'
spin_lock_init(&apr_svc_ch[i][j][k].lock);
^
You need to backport functions from older kernel or update those drivers.
Cheers
This is a Marmalade based question
I am building my android extension which is using symbols added in API level 16 and above.
When building it I get the "cannot find Symbol" error for those new classes.
How do i tell the MKB to take the set the new API level as the target sdk when building an extension
running following command
mkb AndroidNotification_android_java.mkb --rebuild
and i get
if (currentapiVersion >= android.os.Build.VERSION_CODES.JELLY_BEAN){
^
../source/android/C2DMReceiver.java:216: cannot find symbol
You'll have to change target API level from Android Manifest.xml file Make the target at highest API level available (currently 19)
While using the Phonegap platform I've ran in to a problem. When trying to access any of the device strings, e.g. device.name or device.platform, I get as value undefined. This occurs on both iOS and Android. I've set the permissions for Android in both the ApplicationManifest and the config.
While doing research into the problem i found that the problem could be the the device functionality will only be available after about 1 to 3 seconds. I've ran some test, set a timeout at 10 seconds or even perform the action manually via onClick at different times (up to several minutes), but i keep getting the undefined value.
I've tried window.device.name instead of device.name, same result.
Does anyone have a clue why this is happening?
Running Phonegap 2.3.0 on iOS 6.0.2 and Android 4.1.2
Code:
$('#deviceName').html('Name: ' + device.name);
$('#devicePlatform').html('Platform: ' + device.platform);
$('#devicePlatformVersion').html('Version: ' + device.version);
Full Code here
Your help is mush appreciated!
"WARNING: device.name is deprecated as of version 2.3.0. Use device.model instead."
Refer to the following: http://docs.phonegap.com/en/edge/cordova_device_device.md.html#device.name
Accessing the Feature
As of version 3.0, Cordova implements device-level APIs as plugins. Use the CLI's plugin command, described in The Command-Line Interface, to add or remove this feature for a project:
cordova plugin add org.apache.cordova.device
As found in the documentations here:
http://docs.phonegap.com/en/edge/cordova_device_device.md.html
or
https://github.com/apache/cordova-plugin-device/blob/master/doc/index.md
device.model might be what you want.
http://docs.phonegap.com/en/2.3.0/cordova_device_device.model.md.html
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);