I want to use nfc_extras in my android project to use card emulation capability of my phone. I know there are two ways to do that; either by creating a jar file in Android source or using reflection. I'd prefer to go through the second one though. How to do that through reflection? How I can use reflection to take advantage of nfc_extras in my project?
See Nikolay Elenkov's blog at http://nelenkov.blogspot.nl/2012/08/accessing-embedded-secure-element-in.html for an in-depth tutorial on how to do exactly what you want.
Related
I'm wrote java console app with smartcardio.Everything worked perfect.Now I want to use this library in Android. As I know smartcardio does not supported in Android. I searched about in Google.If anyone knows how I can use this library in Android,or what's a alternative ?
Thanks
Try to use this alternative. Code looks pretty the same.
You will need clone project. Compile jar. And put into Android project lib directory.
You cannot use smartcardio library in Android as you have already figured out. If your intention is to communicate to a Smart Card in contactless interface i would suggest you to take a look at the following library https://developer.android.com/reference/android/nfc/package-summary.html
https://developer.android.com/guide/topics/connectivity/nfc/advanced-nfc.html
If your intention is to communicate to a SE you can take a look at
https://github.com/seek-for-android/pool/wiki/UsingSmartCardAPI
if you want use ccid smartcard reader you have to find ccid library for android. some company like acs has published library for android.
for contactless support you have to use specific package which is defined in android (android.nfc).
Maybe this link can help you.
http://www.codexpedia.com/android/android-nfc-read-and-write-example/
good luck.
Not all Java Packages are part of Android but is there a way to gain access to them through some work around? Purely as an example javax.sound is one such class. Yes Android has classes to do the same thing but if we already had the working Java written, rewriting it all using Android APIs is not ideal.
Is there any way to use the Java API or do we have to use the Android API?
No, not all Java libraries have been ported to Android. You will need to use the Android-specific implementation, especially for things that deal with the hardware layer or require a specific technology stack, such as audio libraries.
Yep totally you can but it depending on which libs that you want to use for example you cant use databases drivers in your android apps, neither UI libs , but you can use gson for example
I am a new developer for android programming. I understand android SDK does not contain all classes from android source code. For example, AtCommandResult.class is missing (hiding) from android.bluetooth package in the SDK.
Sometimes, however, I want to use the hidden code in my app and I wonder what would be the best way to do that. One approach I can think of would be to include its corresponding source code in my project with different package name to avoid conflict with existing core. But problem with this approach would be I have to maintain the code by myself from that point. One or two classes are OK but you know where I am going.
Is there any better way other than bothering google to include the code in the SDK? Thanks in advance.
You may want to use a .AIDL file:
http://developer.android.com/guide/developing/tools/aidl.html
Those can already be used to access for example in Telephony functions.
Code example here:
http://code.google.com/p/auto-answer/source/browse/trunk/src/com/android/internal/telephony/ITelephony.aidl?r=13
Is there a handy-dandy equivalent to org.apache.commons.beanutils.PropertyUtils on Android?
I can't seem to use bean utils in my android app due to some dependencies on PropertyDescriptor,and IndexedPropertyDescriptor. So I'm wondering if there are any alternatives?
Basically all I want to do is use a method name as a string "someMethod" and feed that into setMethod(anObject, "someMethod", value), much like PropertyUtils does; but without having to resort to the nasties of reflection...
Or are my hands tied and I need to use Reflection?
There is bridge library which works on Android: android-java-air-bridge.jar. Just include into project path and use all apache beanutils features in your Android project as you could use in ordinary java application. Moreover, there are lot of other classes which moved to this Android supporting library. Look at the list.
There is a possibilty to use libraries or write own code depending on the PropertyUtils. But it sure isn't dandy. You can get the general idea about what has to be done in this thread.
There are apparently some projects who have successfully solved the issue, so you can study thier solution. Take a look at Drawingpad-base and libgdx. You can find PropertyUtils in the package com.madrobot.beans in the first project and com.badlogic.gdx.beans in the second.
I have a practical seminar this semester, and I want to use ontology on Android application.
I choose Protege owl ontology as a ontology API and this tool worked in normal Java project. But when I tried to import this jar files which for the owl ontology API in Android project.It will fail and I haven't found any solutions in the Internet.Can you help me?
If you want to have a programmatic access to OWL ontologies using Java, you could use the OWL-API directly, on the top of which Protege is built in the first place.
If your ontology follows a OWL 2EL profile you have also the possibility to use Brain.
I have tried this some time ago and it worked well.
Android Java is not standard Java, so you may need to port OWL-API (or whatever the library you choose, it can be Jena as well) java source code to android platform. This may require some changes in source code as all the standard java classes are not available in android Java. This effort includes the library source jars if there are any.
Few ported libraries are available on android already. please refer this link
Please note that performance wouldn't be good on device with the bigger ontologies.