Kindly help me out with a method by which I can hide the code of a class file in Android Studio from other developers. The other developers can access the functions but they won't be able to see the code inside of that class.
This idea comes from iOS, using a compiled static library. iOS uses a pre-compiled static library with which the developers can only access the functions and get the return values.
Reference Link for NDK static library: Use of prebuild static Library compiled with Android Toolchain
I don't want to use Android NDK for doing this, I am sure Android SDK is capable of doing this on its own.
Using jar file can be a option, but jar can't hide the code. The class files can easily be decompiled and the code will be exposed to everyone.
There is a long list of obfuscation tools for android, beginning with ProGuard which is part of the SDK.
Still, none of these achieves the level of protection you get by using a native library with NDK. But even the latter can not be completely protected from disassembling and reverse engineering. It can not be a substitute to legal protection, like patents and copyrights.
The only way to really completely hide it is to host the code in a web service. And that would probably be easier than learning NDK coding, though it obviously has other drawbacks.
Related
I'm using Android Studio 2.3 to create a hardware interface library that we can distribute to partners. I would like the inner workings of the library to be closed-source, but provide documented 'stub' classes and methods that can be viewed in Android Studio.
I tried compiling my library and importing the AAR to another project, and Android Studio lets me use the classes correctly, but it doesn't show any java files or documentation in the new project.
Is there a standard practice for how to achieve this? I'm just moving into Android development from C, so I'm used to being able to provide header files with my libraries. It seems like there should be a way to achieve something similar without too much hacking.
Is there anywhere I can get the source code and all the required library files for a NATIVE android app? I need it for an experiment I am working on and I need to test a few apps for the same.
First you must know all dependence in android is write in Android.mk.
Second you can find some code in android source which is connect to you purpose, then looks up its Android.mk, and can find almost you need.
At last, recommand you try ndk, and is supported by Google.
I've been searching for info about it on the internet but I haven't found anything.
The point is that I want to transform my library for android, which I'm using for advertising, into an sdk to make it available for other developers.
My library is mainly an extension of the Application class and I don't know if this should be the way an sdk is made, mainly because it seems weird to me that a .jar extends the Application class.
So, I'm asking for some advices/tips/guidelines or whatever you could tell me in order to build an sdk.
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.
I've an android app that does dome image proceesing. i'd like to write certain parts of the app in C++ for performance reason, then call these methods through the NDK. do i need a specific C++ compiler eg for embedded systems or will any do? Has anyone a link to the correct download for the compiler? thanks matt
The Android NDK comes with a compiler included, which is a version of GCC. You should not need to install any other.
Switching from Visual Studio to Eclipse will make your Android development life much easier, though. All the convenient tools are Eclipse-based.