Using a DLL with C interface in Java (for Android) - android

I was looking into writing an app for Android platform that would (hopefully) use a DLL with a C interface. The only way to grab information from the server is through this API. Is this even possible? If so, could anyone give me a point in the right direction?
Thanks

I was looking into writing an app for Android platform that would (hopefully) use a DLL with a C interface.
"DLL" is a Windows term. You cannot use a Windows DLL on Android. You will need C code that can work on Linux, as Android is a Linux-based operating system.
The only way to grab information from the server is through this API. Is this even possible?
Is it possible to create a C library for use on Android? Yes. See the Native Development Kit (NDK).
Is it possible to create a server that can only be accessed by some C library? Probably not without a lot of work, if that server is accessible from the Internet. Anybody can try hitting that server, or can reverse-engineer your library, or can perform packet inspection on your library-to-server communications.

Did you try Mono?
Disclaimer: I have used in on Linux and (it works) but not on android.

Related

AR.Drone development for Android

I knows that the AR.Drone is controllable for Android phone.
However I can't found any open java source code for me to develop!!
All I have found is the code with the type .h which I knows only for
C++ (iPhone user)!
Can any body give me some idea to develop AR.Drone with java code on eclipse?
thx
:)
there is javadrone ( http://code.google.com/p/javadrone/ )
Note: this lib has issues with the AR.Drone 2.0 - fixed ( for at least flying ) here: https://github.com/xperimental/moder.AR.drone/blob/master/library_projects/javadrone-api/src/com/codeminders/ardrone/ARDrone.java
The AR Drone application programing interface API can be found here:
https://projects.ardrone.org/
The API is in c++, if you intend to develop for iphone you will have to write an application from the ground up because the application that exists on the iphon currently is commercial. (Closed source).
As is the android one because they are developed by parrot.
I developed for the ar drone using the computer which was much easier, depending on what you are trying to do i would develop on the computer. If you need more help i would suggest asking here:
http://www.ardrone-flyers.com/
Good luck
We used yaDrone for an autonomous drone project - the library was very reliable.
Furthermore there is an eclipse tutorial for yaDrone.
If you need to build an IOS app you can use openFramework and ofxARDRone from Memo Akten to control and get the video. This framework is written in C++. You can use this framework in XCode and build for IOS, too.

Converting a project from C to Java

I am currently messing around with Android beginning to make an app. The application connects with a bluetooth device, then sends it signals, then the other device sends back the data that was requested.
I was given documentation for the other devices API written in C, which basically stores all the specific signals needed to send the device. How can I change these from C files to java files. I have downloaded the Android NDK but don't know what to do with it. Any help would be appreciated.
You can call the C library from your Android Java code, (if i understood you correctly this is what you wanted to do).
You will need NDK and will need to use JNI to allow the java code to talk to the c library.
There are plenty of good tutorials on these just search.
For example
Marakana has a good tutorial/video on Android internals. Take a look at the part where he talks about building applications with JNI support. He uses example of a library in C that calculates fibonacci sequence but he calls that library from Java.

Cross-platform development for Android & iOS

I have an iOS app in the Apple App Store. For the next big update I'm thinking about also creating an Android version of my app. In order to save development time, I got the idea to do the business logic and database access in C++ in order to use this layer on both platforms and only do the UI stuff using the API of the corresponding platform ( i.e. Objective-C/Cocoa touch for iOS and Java/Android SDK for Android).
What do you think of this approach from the Android point of view? Is it possible to access SQLite databases using C++ under Android?
Thanks & Regards,
Thomas
Keep in mind that you will need to use the NDK to run C++ code. Also, it is possible to compile SQLite with the NDK but that will take some work and possibly even some porting.
You will also have to write the wrappers in Java which is some additional work as well, albeit Android provides helpers for that.
And Marshalling between the native code and the app is not the most efficient process.
There are no SQLLite APIs (at least list time I looked) exposed in NDK but you should be able to take SQLLite as source package and include it into your application. If all your DB logic going to be in C++, you do not have to worry about interop with Java APIs.

controling network communication

I need to develop an Android application that sets up connection via WiFi with computer and then sends packets with data. Jowever, I need to control send packets, not only theirs data but also headers, there should be possible to modify any field in their header as well. In windows in it is possible with use of winpcap and jpcap, and I wonder if sth similar I may find on Android. Is there any ready API that will help with my problem?
There's no API available to a Java/Dalvik app on Android which would allow you to do that.
Android is a Linux system, though. So you could try to find/write one or two Linux applications to support your effort - or use JNI.
Bottomline: Native code will definitely be necessary to achieve what you want, no way to do this in Java alone.

Communication between an android c native application and an android application

I want to ask if someone know how to make communicate a native c android application and an classic java android application, the native c android application running in background.
Thanks.
First thing you need to do is download the android-ndk available here. It comes with it's own documentation which will be available here: [android-ndk path]/documentation.html, You can also find information in the android-ndk link above.
If you're anything like me you'll need as much help as you can get developing a JNI bridge. I had to find these resource myself but they were invaluable to me. See below for JNI information:
Table Of Contents
Methods (older resource)
Methods (newer resource)
Types
Reference
You can integrate your NDK/C++ code and debug it from Eclipse using Sequoyah and CDT (C/C++ Development Tooling)
More specifically to answer your question - You can use a service as a wrapper around your native code if you require the native code to run in the background. This will enable you to push information to the native code using the OS's intent mechanism in a fifo structure.

Categories

Resources