Android Native Extension to connect to USB device

I am working on an AIR Native Extension for Android that I want to connect to peripheral devices via USB.  However, my efforts at enumerating USB devices just hang at present.  (Using this library: kshoji/USB-MIDI-Driver · GitHub )
Before I get too far into debugging the code I wanted to check something more fundamental:
Can an Android Native Extension handle/bypass the dialog that Android throws for use of USB (or other) devices.  ("Allow the app <AppName> to access the USB device?")  I have seen a few articles for defining intents and remembering permissions in native Android apps and tried that but it seems that the dialog would still be shown at least once.  (See android - USB device access pop-up supression? - Stack Overflow.)
Is my understanding correct?  Is this what is hanging my app?  And if so is there any way to raise/handle that dialog in my AIR app or bypass it altogether?
Thanks for reading.

Read https://discussions.apple.com/thread/3828681?start=0&tstart=0
Allan

Similar Messages

  • Is it possible to connect 2 usb devices to an Airport Extreme?

    Is it possible to connect 2 usb devices to an Airport Extreme (either the newest, ac model or the previous model) using a usb hub?

    Apple does not provide a compatibility list for USB connected devices, so no one can tell you whether things will work until you try it out yourself.
    If both the Iomega drive and HP printer work when you connect them individually to the AirPort Extreme, then your chances using a powered hub are quite good....assuming that the USB hub is functioning correctly.
    In other words, make sure that both devices are working when you try them individually connected to the USB port on the AirPort Extreme. If they don't work that way, they won't work with a powered hub either.

  • Equium A100 shuts down or freezes when I connect a USB device

    I'm getting desperate now but everytime i connect a USB device which draws power from my laptop ie sat navi or mobile phone or ipod the thing just lock up or shuts down.
    Any ideas will be extremly welcome; I have checked the battery issues and made sure that my power supply is in order but am at a loss!!!!

    First of all you should reinstall the OS with the Toshiba recovery CD to ensure that this is not a hardware issue. Then you should update the OS to the latest state. All MS hotfixes and patches should be installed.
    If possible try to update the BIOS. Sometimes 3rd party devices are not fully supported and therefore a BSOD could appear.

  • Android Native Extension crashes if i use anything other than Activity class to extend my activity

    It seems my android native extension is crashing everythime i use anything like FragmentActivity etc. Looks liek android's supportv4 classes are also not supported with native extension coding. I even have my question posted here.
    http://stackoverflow.com/questions/16470791/adobe-air-native-extension-application-crashes -on-using-fragmentactivity
    If anyone has a answer please help out.

    Any progress on it? I have the same problem...
    Thanks

  • How can i connect a usb device (keyboard) into ipad 4

    How can i connect a usb device (keyboard) into ipad 4

    The only keyboards that will work are bluetooth ones and keyboards made specifically for iPad.

  • Android native extension packaging error

    Hi,
    I have been working on a native extension. It packages and runs fine on ios, but when I try to launch my app on an android device I get the following error,
    !MESSAGE Error occurred while packaging the application:
    null
    !STACK 0
    java.lang.NullPointerException
              at java.util.zip.ZipFile.getInputStream(ZipFile.java:194)
              at com.adobe.air.apk.APKPackager.processExtensions(APKPackager.java:228)
              at com.adobe.air.ApplicationPackager.createPackage(ApplicationPackager.java:65)
              at com.adobe.flexbuilder.multisdk.apollo.export.AIRAPKPackager.createUsingPackager(AIRAPKPac kager.java:245)
              at com.adobe.flexbuilder.multisdk.apollo.export.AIRAPKPackager.create(AIRAPKPackager.java:57 5)
              at com.adobe.flexbuilder.multisdk.apollo.export.AIRAPKPackager.create(AIRAPKPackager.java:13 8)
              at com.adobe.flexide.multiplatform.android.launching.ADBLaunchHandler.doPackage(ADBLaunchHan dler.java:423)
              at com.adobe.flexide.multiplatform.android.launching.ADBLaunchHandler.launch(ADBLaunchHandle r.java:350)
              at com.adobe.flexide.launching.multiplatform.MultiPlatformLaunchDelegate.launch(MultiPlatfor mLaunchDelegate.java:184)
              at com.adobe.flexide.launching.AbstractFlexLaunchDelegate.launch(AbstractFlexLaunchDelegate. java:244)
              at com.adobe.flexide.launching.AbstractFlexLaunchDelegate.launch(AbstractFlexLaunchDelegate. java:134)
              at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:854)
              at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:703)
              at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:928)
              at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1132)
              at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
    I am using Flash Builder 4.7, latest android SDK and Flex 4.12 with air 13 beta.
    Any ideas?

    Hi,
    Can you please share the contents for packaging ANE in the same folder structure with me so that I can give it a try at my end as well and look into this problem? My email id is [email protected]
    -Nimisha

  • Ipad4 connection MTP USB device error with Windows 7 64 bit

    I have recently bought iPad 4. When I connected to my computer through USB running Windows 7 Professional 64 bit  i got the following error message
    "MTP USB Device  failed to install"
    Please guige me

    Hello lwalbring and welcome to the Palm forums.
    Your Visor, as you suspect, does not have Bluetooth, so you must use the IR HotSync option.  Since you are using Windows 7 64-bit, I believe that you are going to have to upgrade to Palm Desktop 6.2.2 to make things work from an OS/Driver perspective.
    Since you are using such an old device, you are also going to have to download and install the PalmHotSyncSetup Utility from Pimlico.  This update turns on support for old Palm OS PDAs in Palm Desktop 6.2.2.  Without the update, you won't be able to sync your Visor with Palm Desktop 6.2.2.  The software is free and the link is all the way at the bottom of the screen.
    Lastly, if your PC doesn't have an IR port on it, you will need to purchase a USB to IR adapter.  Some laptops still have IR ports and most desktops don't.
    Once you have all the pieces, you'll want to go back to the Windows 7 and Vista HotSync thread again, and follow the directions for setting up and configuring IR HotSyncs.
    Alan G

  • Android Native Extension cannot find implementation for .so functions

    I can load some .so libraries but can never call any of their functions. All these .so files are known good and work when I publish/install an Android app via eclipse. But any time I try to call functions from an Air native extention I either get "cannot resolve" or "no implementation found" This occurs after I manually call System.loadLibrary() or use a static block as sampled below. Does the static block have to be on the main activity? I ask because all the LoadLibrary samples I find are always on the Activity. Not sure how to pull that off from my jar file, since Adobe creates the apk and owns the main activity.
    So, in trouble shooting I've back tracked to a known good .so file by using the hello_jni sample at http://developer.android.com/tools/sdk/ndk/overview.html#tools
    I can instantiate the my native jar extension and even call my FREFunction.
    I slowly step through a simple sequence that first instantiates my NativeHello.java class
    package com.example.hellojni;
    public class NativeHello
              public static String libName = "hello-jni";
              static
          System.loadLibrary(libName);
              public native String stringFromJNI();
    At instantiation, Logcat reports...
    Trying to load lib /data/data/air.air.Vuforia/lib/libhello-jni.so 0x406d9938
    Added shared lib /data/data/air.air.Vuforia/lib/libhello-jni.so 0x406d9938
    No JNI_OnLoad found in /data/data/air.air.Vuforia/lib/libhello-jni.so 0x406d9938, skipping init
    So looks like library loads correctly, I confirmed by purposely removing the .so file from the apk publishing and I get different "linkage" error. So I'm confident it is loaded.
    But once I call the native function stringFromJNI();
    I get...
    No implementation found for native Lcom/example/hellojni/NativeHello;.stringFromJNI ()Ljava/lang/String;
    I followed http://help.adobe.com/en_US/air/extensions/WSf268776665d7970d-2482335412ffea65006-8000.htm l
    but just cannot call any functions within any .so file
    Please help, my client's project is on hold because of this.

    Any progress on it? I have the same problem...
    Thanks

  • Connecting 2 USB Devices for recording in GarageBand blue yeti and M-Audio Mobil pre. will they both work together one track each?

    I Have set my Audio Midi Setup under Audio Devices to Aggregate Devices and selected M-Audio MobilPre USB and Blue Yeti Microphone.
    I plugged my MobilPre into one USB port on my MacBook and the Blue Yeti Mic into the other USB on my MacBook. So I have two inputs
    and I set each device for OUTPUT as the HeadPhones from the Blue Yeti Mic. I still cannot record the vocals on the blue yeti and the Guitar on the MobilPre
    At the same time even though both show the rec button is active on both. What do I need to do to get these to both work recording at the same time?

    I'm not sure what you mean by "mixed with audio in Alsamixer". Can you clarify?
    With that said, my problem did mysteriously fix itself after some update (presumably to alsa). Unfortunately, I noticed it in passing one day while I was changing the volume of something in pavucontrol, so I don't remember the exact update that caused it to work. But yes, my current setup does work now: I can listen to audio through my DAC and use the Yeti for recording. However, I have found that use of the Yeti crashes Google Hangouts, although it works perfectly in every other program I've tried.
    As documentation, here is my current working setup (it is very similar to the above): in PulseAudio, the DAC is set to be a Digital Stereo (IEC958) output. The Yeti (called an 'Integrated Rate Matching Hub' in pavucontrol) is set to be an Analog Stereo Input. In the input devices section, I have the Yeti's volume set to around 58% (-14.31 dB), which is past the base volume a fair ways but produces decent levels for recording. The DAC's volume is set to 100% (0dB gain, the DAC takes care of the level). In alsamixer, I have the mic level for the Yeti set to 40.
    Edit: This is a long-time-later edit, but let me say that when you have multiple USB audio devices, what USB hub and in what order they are connected seems to matter a great deal. If you can't get your Blue Yeti to work, try moving it to a different set of USB ports (controlled by a different controller) on your motherboard. This magically fixes the issue for me.
    Last edited by rwiggins (2014-12-14 00:26:39)

  • Connect any usb device to nokia 6303c

    I am also looking for the same solution, any one please help.

    I'm not sure what your asking. USB disk drives need power. Your phone has no support for power up the disk drive. Only USB sticks are supported. Go to your local PC warehouse and order a micro USB male to female A USB adapter.
    ‡Thank you for hitting the Blue/Green Star button‡
    N8-00 RM 596 V:111.030.0609; E71-1(05) RM 346 V: 500.21.009

  • Invalid SWC file using ADT to create an Android Native Extension

    I'm following a tutorial on youtube:
    https://www.youtube.com/watch?v=dfq9wiuLks4
    Using Flash Builder 4.6 and and when I get to the point where the project is supposed to be built using adt I run into the following error:
    "Invalid swc file:"
    Here is the command I'm using:
    adt -package -storetype PKCS12 -keystore newcert.p12 -storepass mypassword -tsa none -target ane notifications.ane build/ane/Notifications.swc -platform Android-ARM -C build/ane/Android-ARM
    Ive tried setting the Additional Compiler Arguments in the Flex Library Compiler to this: "-locale en_US -swf-version 19"
    Still the same result, If anyone can help me figure out how to trouble shoot this or isolate the problem I would greatly appreciate it.
    Thanks

    Any progress on it? I have the same problem...
    Thanks

  • Lose connection to USB device

    Hi All,
    I have developed an automated system which is used to calibarate lines scales. These scales are usually between 10mm and 150mm long and have divisions of 0.1mm and lower. I use a camera to determine the edge/position of the divisions. A translation stage (USB) from Physik Instrumente and a high resolution piezo motor to move from each division. A laser interferometer is used to measure the distance the motors have moved(i.e. the distance between divisions).
    In the program I have the option for the user to set a start time for the calibration, for example 02:00.
    My problem is that by 2 o'clock in the morning the computer has gone into Screen/Power Saver mode. This causes the translation stage from Physik Instrumente to disconnect and causes an error which pauses the program. In the morning when I come back in, the error is on screen and when I press continue the program continues as normal.
    So what I'm looking for is some way to deal with this situation. I have tried the following with no success:
    Turn off Screen/Power Saver mode - The IT Dept here wont let me since multiple users access this program they have to turn it off for each user.
    Turning off the power management in the usb port properties had no effect.
    I also tried a subVI that would move the mouse to a position on the screen in hopes that this would stop the computer from entering the power saver mode. Needless to say it didnt work.
    Any ideas would be appreciated,
    Many Thanks,
    Cain
    Solved!
    Go to Solution.

    Turning off the power management in the usb port properties had no effect
    Well, you are definately on to the root cause of the USB failures.  if this is a Windows machine you do need to set the PC Power management options to "never sleep."
    I was kind enough to keep the browser bar in the snip so, you can get here.
    IT must be made to understand the experiment must go on.  That's why you have a computer- to do work while you are away so you don't need 5 shifts of people to watch the program run.
    Jeff

  • MBP will not boot up with USB devices connected

    I have a late 2010 MBP 15 10.7.2 that will no longer boot up if any USB devices are attached. A dongle, a hub, anything. It goes to the gray screen and stays there. Disconnecting all USB devices the MBP will boot up. Then connecting the USB devices they work. It just will not boot up with anything connected to the USB ports. I have reset PRAM, SMC and fixed disk permissions. Made sure login items are ok, and start up disk is correct. I cant really say when the problem started as it worked fine before, maybe on 10.7.1? Not sure.
    Any suggestions for a fix?

    I re-installed the 10.7.2 combo. It booted up with a non powered usb 4 port hub but it disabled it. Plugging it out then in again and it works. Looks like the USB firmware has changed somehow in 10.7.2, The hub works on PC's at work no problem, and it worked on the MBP without issue previously. Its not just the non powered hub its a powered hub, and other devices.
    Any solutions?

  • USB device connected with keyboard gets disconnected due to an overcurrent condition

    Hi,
    bought a new 13,3" Retina Macbook Pro.
    When I have my wired Apple Keyboard connected to the Macbook and connect an usb-device with the keyboard, from time to time the keyboard and the usb-device gets diconnected and mac osx tolds me, that there is not enough power for the devices. After a few seconds the keyboard and the device gets mounted again.
    In the console I could see the following log:
    kernel: USB Notification:  The hub "Keyboard Hub" has reported an overcurrent condition.  Port 3 has been disabled.
    Is my Macbook broken?

    You can try SMC and NVRAM resets:
    http://support.apple.com/en-us/HT201295
    http://support.apple.com/en-us/HT204063
    It will do no hard to do this but a genius bar appointment may be your best option.  I suspect this is a hardware problem.
    Ciao.

  • N95 8GB connect to a USB Device

    As the title says, is it possible to connect the N95 8GB to a external USB Device like a USB Hard Drive so that files from the hard drive can be viewed on the N95.
    I would suppose you would need to use additional software for this task.
    Any comments.

    Power (+5V) is not the problem as long as the usb device has an external power supply. Most (if not all) nokia phones use 3.6 - 3.7 V battery, but, despite that, nokia phones could produce 5V from 3.7V battery with special hardware. Else, there could be a limitation of simultaneously using the phone charger (that provides 5V to the phone) when connecting a usb device to nokia phone. So, power is not the problem.
    Lets look to signals (D+ and D-). According to http://en.wikipedia.org/wiki/Usb , Transmitted signal levels are 0.0 – 0.3 V for low and 2.8 – 3.6 V for high in full speed (FS) and low speed (LS) modes, and −10 – 10 mV for low and 360 – 440 mV for high in hi-speed (HS) mode. So 3.7V battery is capable of USB signaling, too.
    Additionally, most (if not all) ARM processors that are inside Nokia phones, have one USB client port and at least one USB Host port (USB 1.1 or USB 2.0). For examble, old Nokia 7610 is equiped with ARM processor OMAP 1510, that has one client USB port and one USB 1.1 HOST port. (Mention that 7610 does not have usb port. It has pop-port that includes required 4 USB signals: VBUS, Ground, D+ and D-). See http://en.wikipedia.org/wiki/Pop-port .
    What is the problem: It's just, Nokia manufacturer does not make use of ARM processor's USB Host port contacts. Also there is not an addtional micro USB port (more space required), and of course there is not software supporting USB Host capability.
    Consider, also, that adding USB Host capability to small sized Nokia super phones, that have not big enough battery capacity, then, the battery would be exhausted soon. That's not good for marketing.
    So, if you want to add USB Host port to Nokia phone, then:
    1) Locate processor and USB Host port contacts ( if you are able to do it, because of FBGA processor type)
    2) Provide 5V to USB device.
    3) Write some code and install it in Nokia phone.
    ---  It doesn't worth it. Too much trouble !!!  ----
    One other method, would be a SDIO to USB Host Controller Card, connected to micro SD port of some Nokia phones. But, only CF Card to USB Host exists in the market for over 130$. SDIO to USB Host Hardware Development kit costs a lot and are big enough.
    Can anyone build something using Maxim ICs MAX3420 or MAX3421E (USB Peripheral Controller with SPI Interface), and connect it to SD card slot supporting SDIO (SD uses SPI interface!!!) ????????????

Maybe you are looking for