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
Related
I need to create an API library for Android and iOS. I have experience working with Android projects, but zero experties in iOS. I was wondering if I could create a Project library in Xamarin that compiles as a JAR for Android and as an... I-don't-know-which-type for iOS.
No, that isn't possible. Depending on what you are trying to accomplish there may be alternatives. If you are trying to make a library that can be used by others you could make it a Xamarin component - there is a component store you could put it on if you want it to be generally available, otherwise you can use any normal means of source or object distribution.
If you need to interact with a native app/library then you could make the C# code the "owner" of it and have it call into the native code. This works for both IOs and Android (and is used to work with e.g the play services from google).
No, it is unfortunately not possible to do that.
It seems to me that what you need is a Portable Class Library also known as PCL. It allows you to create a project which can be referenced by all Xamarin supported platforms (such as iOs and Android). There are obviously limitations to the approach like not being able to reference platform specific libraries but in your case (of writing an API) it should suffice.
You can read more in this link
Good Luck!
I am creating an app showing local events for android. I was hoping to use the Eventful API, since that came with its own java-based client library. However, I'm not sure if it's fit for Android, since I know a lot of these java based client libraries use stuff Android doesn't support.
So, does anybody know if it works?
My entire project is available # github if you want to check it out for yourself.
The API is found here.
Android does not have have issues with Java client libraries. It is build on top of standard Java, and can use all of the framework features.
Furthermore, it looks like this API offers a RESTful interface, which is for sure supported by Android.
Bottom line, I do think you can use this API in Android without issue.
I'd say the easiest way is to compile and run an application that embeds the library and tests a few methods.
Typically, you may have issues with the way the networking is handled. There are 2 main ways in android to do HTTP, the Java and the Apache way, I think the Java URL API is fully supported and very close to the actual Java version, but the Apache has some hidden differences.
The main risks you'll have are A/ that it uses classes or packages that are not present on Android. B/ that a class does not behave as expected, which does happen from time to time, as the Android implementation is entirely specific.
Apparently you have already tried to run an android app with the library included? Did you encounter a specific error? If you, can you post the stacktrace?
Both Android and Blackberry apps are made in Java. Does it mean that I can code some logic interdependent to Android SDK and use it when porting the app to Blackberry?
Does anyone has experience in this field?
Sure you can do it. The logic would not be different but the implementation of the logic depend upon the Platform you are choosing. In Blackberry it uses java-me but there are some limitation you can not use in Blackberry like there is no ArrayList or HashMap in Blackberry but its available in Android so you have to use some alternative of ArrayList or HashMap while porting for the Blackberry you can use Vector instead of that. There is also some limitation of using java.lang.utils package in Blackberry. May be this would be helpful for you.
I'm working on an application that runs on both Android and Blackberry.
I work only on the Android client but I know that only few things can be shared. Of course only the classes that do not have to do with the framework. Another problem is that, Blackberry uses only J2ME that means that for example you can't even use semaphore or other things like that.
In my application all the protocol level is shared though.
Sure you can. Create a plain Java project and make sure you only use classes available in Android and Blackberry. Add the project dependency to your Android and Blackberry project. Alternatively, you can export a jar file and link your projects to it.
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 am a beginner on android platform, and I want to build a tracerouting app. So these are my queries:
Is it possible to make such an application in Android? if possible then guide me the way that I follow.
Does Android support low-level programming to capture ICMP packets? or do I need to add some kind of JAR (in java) or some other libraries to support this application?
In Java, there are JPCAP and docjar etc kind of libraries that we can import in our IDE or Eclipse so that Java support for making such kind of API's?
I need valuable suggestions.
It's quite late - but someone might see it.
i found this one and it worked for me:
https://github.com/olivierg13/TraceroutePing
The simplest way I can think of is to just check for the traceroute Linux application, execute it, and parse its output.
Android has full networking support, however, Java doesn't expose an interface to alter the IP header. Hence, manually crafting ICMP packages is out of the question (JPCAP is no help here, since it relies on libpcap, which I suppose you won't find on any vanilla installation).
Another possible solution is to use the NDK and create a small library that handles the low-level number crunching. However, I'm not sure if the NDK would allow you to use setsockopt.
This is working pretty well for me, you may have to filter out the string results.
To add this library, you have to download or clone the git repository and implement the folder "library" just as he does in the other module "app" for it to work properly.