If i created a apk library with monodroid. Can i u use this just in Eclispe(Java) and do my rest code in Java ?
In short: no. A DLL compiled from a Mono for Android class library relies on the Mono runtime in order to run it, which wouldn't be present in a normal Java Android application. It is possible to go in the other direction though, and use Java libraries within a Mono for Android app. Xamarin has documentation of how their architecture available here.
That said, in some cases it is possible to access C# code from Java code when you're in the scope of a Mono for Android application. This question/answer has some good details about that.
Related
I have found some ways to using python to build android app.But all of them need to install sl4a and pythonforandroid.
It is so complicated,so is there any way to package sl4a to my android app project,and once I install the apk,I needn't install sl4a any more.
You can use Kivy at following link :
Python for Android
It will can help u have a look to the following topic :
How can I integrate a Python code in the Android Java app?
hope this help you.
You can do this. What it comes down to is packaging the Python interpreter (compiled by the NDK) in your app, and starting it via the standard NDK mechanisms. This is the same thing that e.g. Kivy does, but you'd be adding the code to your own app rather than (like Kivy) using a java bootstrap then letting the Python manage everything else.
One option, which has seen a little discussion/development recently, is to use python-for-android to build all the python components, then copy them into your java project (and add the code to handle it). This is possible, but not currently as easy as it could be, you'd need to look into how it works internally to get the outputs you need.
Another option that is probably easier right now if you don't need compiled code beyond python itself is to directly use the precompiled python binaries of the CrystaX NDK, in which case including the python binaries comes down to only adding them to your Android.mk. You'd still need some C and NDK code to interact with the interpreter, but the process is quite straightforward.
(SL4A has some Android build tools of its own, which you could also use for this, but I don't know what you'd need to do to integrate it as I think SL4A does extra things on top of just having the python interpreter present).
Could someone explain how the Java JNI and the Android NDK differ, how they are the same and how they fit together? I haven't found anything that gives a good explanation of the differences between the two and I'm a little confused.
Thanks!
JNI is just the way that Java handles calling into native/C++ code, and calling back into Java from there. It has nothing to say about Android - it is a Java language feature.
The Android NDK is a way to write Android applications using code called by JNI. It's specific to Android and gives native code access to Android APIs at that level.
Android NDK(Native Development Kit) is basically a toolchain to reuse code written in C/C++(native code). It compiles the native code into native library. NDK is similar to a Android SDK, with primary difference of using SDK only for java codes. NDK is used in application developed for multiple platforms like iOS, Windows. Apps like Whatsapp, Instagram were developed using NDK.
Java code use JNI(Java Native Interface)to call functions from native library, like accessing the objects, methods, etc. Also the native code can access the java environment.
I need to call a relatively simple piece of python code (no dependencies) from my java-project for android. I have heard that it is possible to use python via Kivy. Would that be possible?
Kivy cannot be easily integrated in an existing Java app, Kivy (the android part) have already a integrated Java application. Python is the main part, and you can execute Java code from Python using Pyjnius. Or write direct Java code.
You want the inverse, which is not something we are targeting.
I suggest you to check android-python27 project instead.
I have an iphone app. I made my source code as boost library. Is there any possibility to embed my library to my android app? I am using eclipse. Can any one send any link about this.
At least a simple C or C++ library embedding to android and using those functions in my android app?
You need to use Android NDK tool chain for cross compiling the library. This link shows how to use it -
"http://www.cmumobileapps.com/2011/08/31/compiling-open-source-libraries-with-android-ndk-part-1/"
If you need support of STL, RTTI, C++ exception, then there's a patched up NDK available at http://www.crystax.net/android/ndk-r4.php
Is it possible to make a console Android app using the Android API? This application must be hidden in the package manager. Can you give me examples? In C++/Java.
Do you mean you want a console in Android so that you can type in java commands? If so, then no is the answer. Android does not have the option to use reflection. And reflection is needed to create a virtual machine where you can execute commands.
The NDK is a toolset that allows you to implement parts of your app
using native-code languages such as C and C++. For certain types of
apps, this can be helpful so you can reuse existing code libraries
written in these languages, but most apps do not need the Android NDK.
http://developer.android.com/tools/sdk/ndk/index.html
I think this is what you're looking for, but as the description says, make sure it's what you really need.