ANT+ SDK - requestAccess faild (Other failure) - android

I'm trying to develop own Android application using ANT+ sensors.
My app is based on (developer's Sampler code and SDK).
However I found the strange thing during tests. I mean when I start to searching devices I immediately receive a message:
W/AntPluginPcc: BBD30600: RequestAccess failed: OTHER_FAILURE
At first I suppose that a reason of this problem is that I have a phone with Marshmallow OS (instead my wife's phone is based on Lollipop OS and all works fine). I tried to find anything in documentation related this but didn't find anything interesting. I add to Manifest some permissions (I mean com.dsi.ant.permission.ANT, android.permission.BLUETOOTH etc.) and set the permissions in code, but it doesn't help to me to solve my issue.
May be anybody received this problem and may be somebody solve it. Could you please share your solution to me?
P.S. I install the ANT+ Plugin services, ANT Radio Service. in App I use the ANT+ SDK from github. May be I should use also the ANT SDK? (I want to connect to HRM and cycle devices which use ANT+ protocol)

If you have the same problem as I you need to realize the AntRadioServiceConnection class.
I found it here.
And you should be sure that you have all services and plugins installed on your phone.

Related

Android Cordova 5.0+ Camera crash

We are using Cordova 5.0.0 and its cordova-camera-plugin
When we are testing it on Android, the app crashes when the user takes a photo.
Looking at the links below, it seems that our app is being killed while the camera app it on front.
PhoneGap camera restarts the application
https://github.com/shaithana/cordova-plugin-wezka-nativecamera
While there are some answers but it seems to be outdated: The foreground camera plugin is not suitable to newer devices or Cordova and other solutions didn't work for us
Does anyone have an up-to-date solution?
Try to use this forked cordova-android and cordova-plugin-camera.
The docs, sample and discussion on the approach used can be found in the cordova-android PR.
BTW, the PRs are going to be merged soon.
First question that comes to my mind is: Why using this camera plugin: https://github.com/shaithana/cordova-plugin-wezka-nativecamera
It's obviously a fork. You might have a good reason for that. It's also outdated. Last contribution was one year ago.
Maybe you want to give the "official" plugin a shot:
https://github.com/apache/cordova-plugin-camera
Going deeper into detail without knowing more about your testing environment (which device(s) with which Android version) and without having possibility to review entire related code, is not possible and answers may not give any reliable advice for change.
Have you ensured, that the call to the camera plugin cannot happen before "deviceready" was triggered? Is cordova.js loaded?
Update:
You may also want to switch from raw alerts to console output. I recognized several times that alerts in callbacks triggered from plugins could cause some trouble.
As a general rule of thumb: Use console.log() instead of alert() and connect with Chrome (chrome://inspect) to the emulator or device to see what happens. You can additionally use adb logcat to have a look into the device log.

USB Midi driver for Android crashes

I am trying to use this USB-MIDI-Driver https://github.com/kshoji/USB-MIDI-Driver in my project. I added the driver using gradle,
maven {url 'https://github.com/kshoji/USB-MIDI-Driver/raw/master/MIDIDriver/snapshots'}
...
compile 'jp.kshoji:midi-driver:0.1.1:#aar'
copied the sample (https://github.com/kshoji/USB-MIDI-Driver/blob/master/MIDIDriverSample/src/jp/kshoji/driver/midi/sample/UsbMidiDriverSampleActivity.java), removed the "play audio" part and started the activity from my MainActivity.
My problem is, that with time it gets slower and slower, it misses events, I skip frames, the ui becomes unresponsive, the device is detatched and my app crashes more or less... The pre-compiled project from Google Play Market works fine though.
The only thing I can think of is that I use the wrong version of the driver or sample... Is there anyone who had a similar problem and can help me?
I did not really find an answer but followed kshojis comment in Send MIDI messages over USB on Android and tried the alternative driver he suggests (http://www.humatic.de/htools/nmj/).
nmj seems to use much less resources but requires you to interpret midi-events. http://www.petesqbsite.com/sections/express/issue18/midifilespart1.html is a nice resource on how to read midi.

How to run 'spacebrew' in "android mode" from processing?

I am making an andriod app using 'andriod for processing lib" of processing (ie. running android mode in processing 2.0.3 and lauching it on my device).
Spacebrew (http://docs.spacebrew.cc) is a easy to use web socket library for processing , also availabel as javascript.
if i run the spacebrew example codes in andriod mode, the app gets launched in my device but doesnt show up in my spacebrew admin. whereas if i run the same thing in my mac, it shows up correctly. guess the websocket communication is not happening while using "andriod for processing". But this is the easiest way to use web sockets. So can anyone help me figure out on how to make spacebrew work in processing (android mode)
this is for my college project. any suggestions on how to get this running please? thankyou in advance
Thanks for pointing me to Spacebrew, didn't know about that!
I've just tested it from Android Mode and it does work, but there is a tiny quirk you might be missing out: permissions!
Normally, if your app uses extra permissions, the application's manifest allows you to use these. In Processing, that's also possible via Android > Sketch Permissions and in the case of Spacebrew, INTERNET is the permission you need enabled, as you can see below:
I just a did a test myself and it seems to work just fine with the amazon hosted demo:
Note that the Spacebrew Processing library uses the java websocket library, but only sets up a WsClient client. You can if you want use this jar in an Android SDK eclipse project and have your Android app act as a websockets server as well, not just a client (just in case this will become handy to you at some point in the future)

pcsc-lite and ccid on Android

Does anyone have experience porting pcsc-lite/ccid to Android? I don't need to access smart cards/readers from the application layer, just from the shell. So, as long as I can get the pcscd daemon to run, that's fine.
Do I have to also port libusb/libhal to Android since pcsc-lite requires either?
Thanks.
It has been done and it works, however not sure what Android version the current patch supports. Check the SEEK site and their mailing list for more information: https://seek-for-android.github.io/.

How to implement/debug a sensor driver in ANDROID

Does anyone know of a walk-through or any examples of any code to setup sensors in android.
I have the drivers available to me.
Also i have implemented the sensors library as instructed
in the Android-Reference along the sensors.h template.
I am still unable to get any response at the apps level.
How do i trace this issue? what might be the problem?
Thanks in advance
UPDATE:
Jorgesys's link below points to a great APP to test if the sensor drivers are functioning properly or not.
Now that i know they are not functioning, Any ideas of on where to dig??...
This is a cool example.
You can check out this project too!
Sensor Simulator
And the simulation of this project here.
Found everything needed to get started developing Android sensor apps.

Categories

Resources