Setting OpenNFC on AVD? - android

I have a very simple question. I am trying to enable NFC on Open NFC AVD (emulator). If I go to Settings-Wireless- NFC it does not seem to allow me to check the box. and subsequently the android beam option is disabled. How can I enable NFC on emulator?
I have seen someone was mentioning a separate application on emulator "Setting OpenNFC". Where can I find it? is it not supposed to show up on emulator application list?
I am running android-4.2.1_r1 Open NFC 4.5.2, Android SDK API level 17.
thanks in advance for answering my question.

Use OpenNFC 4.4.1 instead of 4.5.2. It has a dedicated app pre-installed in emulated device called "Setting OpenNFC" for starting NFC funcionality. The only disadvantage is the lower API Level:/

Or the virtualbox appliance can also be a good solution. Check it here http://open-nfc.org/wp/2013/04/25/new-virtualbox-appliance-embedding-open-nfc-for-android/

Related

Is there ANY android emulator that supports microphone input?

So far I haven't been able to find any solution that would allow me to test voice input via microphone on the android emulator.
I have been able to get away during development by limiting my testing to cheap Android phones (sorry, I don't have much money) but now some users complain that my app doesn't work on Android 3 and 4.
So, I am desperately looking for an Android emulator (that can run on Windows 7) to help me test my microphone-based app on various Android versions (did I say fragmentation?)
Is there any android emulator that supports microphone input?
Other suggestions that can utilize the standard Android "emulator"?
As you noted, the live-android (with this HowTo) is outdated, so as far as I can tell, you have only one (free) option that goes up to Android 4: Android x-86 on a USB thumb drive plugged into another netbook or laptop you have.
The only problem I see is that a standard Android USB cable for connecting your debugger will not work because netbooks or laptops don't have a micro USB connector like real Android devices have.
This is an old question so the answers here need updating.
All of the emulators included in the AVD manager (Eclipse/Android Studio) support microphone input now, although the ARM versions don't really have a sample rate that matches reality. The microphone inputs x86 based emulators work really well, but only at 8kHz.
There is a new kid on the block called Buildroid for VirtualBox (formerly VirtualBox-AOSP). This may be what you are looking for.
Thanks to Babu for this solution. Emulator can supports virtual input and record sound same like laptop

How to emulate a nfc-tag on an android phone

I have an android phone (nexus s, sdk v15) which shall send a string to a development board running in nfc-reader/writer-mode by using tag-emulation. I know this is not officially supported by android, so I could do it natively by accessing the driver directly(?).
Is there any example out there where anyone has done this before or an app which does this (and preferably is open source?)
I found some stuff on google where it is generally advised not to do this, or where people talk about how it would be possible or how they've (very generally) done it, but I couldn't find any code or precise advice.
I don't want to access the secure element or do any smartcard stuff that needs to be approved by the vendor/provider. I just want to transfer the string. I also know this could be done by the android api methods via p2p, but this doesn't work well with the board, so I give this approach a try.
For a device running stock KitKat 4.4
With Android KitKat 4.4 the ability to have the phone act as an NFC card is built into the operating system so you no longer have to rely on Cyanogenmod or a custom ROM. It won't let the phone act as a Mifare Classic tag per se but I've had great results in getting my phone to communicate with an ACR122 reader so I'd definitely recommend this option if you can get 4.4 on your device.
If you're wanting to run below 4.4 and are willing to use Cyanogenmod
It is possible to load applications onto your device and have them communicate with a reader via NFC quite easily however you must be running Cyanogenmod, this feature is present from CM 9.1.
Wanting to run on Gingerbread (the old answer)
Yes it is possible and there's been a patch put out there for 2.3.4 to enable it, I'll post a few links for you to have a read of.
They do require flashing a 2.3.4 Gingerbread ROM to your device along with some other patches to enable the card emulation features so if you're not willing to do that then they won't be of much use but as far as I'm aware it's the only way to get it working. I haven't actually tested this myself but user comments suggest it works.
Here is a link to a blog describing the whole process: http://techshek4u.blogspot.co.uk/2012/01/applying-card-emulation-patch-to_03.html
Here is a link to the original forum post with the patch for 2.3.4 to enable it:
http://forum.xda-developers.com/showthread.php?t=1281946
And a link to the original discussion where various developers are trying to get it working, depending on your technical knowledge of Android and NFC this could be more or less interesting: https://groups.google.com/forum/#!msg/android-developers/1fw1qfFqpGc/6dlzvTqExN4J
Caution: According to NFCGuy from his answer "Don't bother with downgrading your phone to GB if it is running ICS. You cannot downgrade the NFC firmware to be compatible again with GB, so NFC will simply not work if you flash your device with GB."
If you root your device, it is possible to create an app that turns on the card emulation mode. It is not too difficult, see e.g. https://stackoverflow.com/a/10506299/1202968.
However, card emulation is completely handled by the Secure Element. Your app has no access to the data that is being transferred. The only way to get control over that would be to create and install a Java Card applet on the Secure Element. However, to be able to do that you need acces to secret authentication keys that are only known to Google.
PS: Don't bother with downgrading your phone to GB if it is running ICS. You cannot downgrade the NFC firmware to be compatible again with GB, so NFC will simply not work if you flash your device with GB.
Host card emulation is now officially supported by Android, according to http://developer.android.com/guide/topics/connectivity/nfc/hce.html

Sensors in android emulator?

I wanna create an app by using acceleration sensor.But I don't know how can I test it in emulator?
I don't think the Android emulators support the acceleration sensor nicely by default.
However, you can download SensorSimulator from Google, which lets you give the Android emulator simulated sensor data with the mouse. Just follow the instructions on the website and you should be good to go.
Update (4/5/2016):
As Maks kindly pointed out, OpenIntents SensorSimulator has moved here: http://github.com/openintents/sensorsimulator
Additionally, some hardware emulation is now supported: http://tools.android.com/tips/hardware-emulation

Android Honeycomb and USB Devices

According to Android Honeycomb it supports USB peripherals. I am interested in connecting a credit card reader with usb and another device. My questions are the following:
Will the Android device support a USB Hub?
How can I program to the credit card device? What would i need to ask for the development of lets say a Magtek Credit Card Reader?
If anyone can help me I would greatly appreciate it.
Thanks!
MagTek provides an Android development kit for SCRA card readers on their support site. It includes guidance, sample code and their custom library. You should use this as a starting point. You will need a usb capable Android device to test the sample code. However, to begin with, you may want to use the Android emulator for running the software until you get your build working. If you try to use the sample code with the emulator, you will have to remove calls to the library or you will see application errors. If you need help using the emulator, I have a post on my blog which explains it here: http://www.veriserver.net/cgi/tech/?p=39
The following is what the MagTek demo program will look like on the Android 4.0 emulator if you get that far:
Once you get this far, you will be ready to load the sample program on an Android device and try it with a MagTek card reader.
Android 3.0 + supports Android USB Host and Accessory APIs.
Question is too generic to answer in this post.
Please refer to the documentation here

Can I use any Android Phone for application development?

Can I use any Android Phone for app development? Here in the Philippines, there are many available mobile phones with Android installed. But I want to buy the cheapest phone available (which I think is Samsung i5500 Galaxy 5). Thanks in advance!
You can use any android powered device for development, just make sure it has Development menu option. To check go to Menu -> Settings -> Applications -> Development. If there is somewhat like USB Debugging option you can use device for the development.
Why not use the actual dev kit? There is a complete setup with virtual phone included that you can run as an eclipse plugin.
http://developer.android.com/sdk/index.html
I think any Android platform based phone will be OK.
Yes you can, and I would definitely recommend using a real phone. The emulator is excellent, but somewhat slow for a number of applications that require hardware (OpenGL comes to mind). Even a G1 tends to be faster than the emulator for certain things. If you're creating an app that uses Bluetooth, there's no way to do so on the emulator currently. Konstantin's directions are good for actually setting up the phone.
You need to understand one thing before you buy the phone. What version of Android SDK you will be using for to develop the app. If say, you are developing the app for cupcake and above, you better have a phone with cupcake version. But if you have Froyo phone, you will not be still able to run the app, but some depreciated functions might not be available and your app may crash.
If you want to develop in Windows there is a list of devices available for which the USB drivers work: USB Driver for Windows
If you don't need the GSM part you could also think about using the Archos 5 Internet Tablet, which is a Android powered media player and supports ADB (Android debug bridge) as well

Categories

Resources