list of methods for use with android NativeActivity - android

Does anyone know where I can find a list of all the native c/c++ methods and functions for use with the android NativeActivity. I cant seem to find a list anywhere on the google/android site and Ive been googling it for the past two days.

The documentation for NativeActivity can be found here. That is the Java side of the API, but the native side's documentation is a bit harder to find. This is a link to a doc about the native activity, which can be found in the 'docs' folder of the NDK as well. Additionally, the native_activity.h contains all of the C Android framework callbacks you'd expect, with their documentation and, naturally, method signatures. It can be found in the NDK in, e.g., \android-ndk-r6b\platforms\android-9\arch-x86\usr\include\android.Hope this helps you a little more than my original answer!
EDIT: Added more documentation info.

Related

How to use Dokka to generate Docs like Kotlinlang.org

AFAIK Kotlin's Documentation was made using Dokka. But the Examples stated in Dokka's Readme is only generating ultra basic webpages/markdown files with no elegance whatsoever.
It just looks like this
Here's another one by Atrium, docs link.
I'm wondering if I'm doing anything wrong.
I've also looked at the issues page and been browsing through other open source github projects that has used Dokka and the result is always the same.
Now a good example of how a tool that generates beautiful documentation would be Jazzy by Realm for Swift/Obj-C. Using it can be as easy as running one command on the terminal.
Here's an example documentation created using Jazzy
Further research with suggests that I may have to use third party tools like Gitbook or Jekyll to generate the kind of documentation I'm looking, is that really the only way?
Kotlinlang uses some custom styles for one of the dokka's output formats. Development on some better looking docs is underway

Is JNI_OnLoad normally used for Android NDK?

I'm new to Android NDK, and I was reading these tips on the Android Developer site. It recommends using JNI_OnLoad to register your native methods, but doesn't give much detail on how to do that.
Searching Google's NDK sample repo on GitHub only turned up one usage of JNI_OnLoad, and it doesn't call RegisterNatives. Searching the web didn't turn up much on how to do this either.
I feel like I'm missing something. This is supposed to be the correct way to do it, according to Google, but their own examples use the "discovery" method naming approach instead.
Is this perhaps an old way of doing it, that's not really done anymore?
RegisterNatives is fully supported on Android, and the proper way to do it is from JNI_OnLoad, which also works well and is shown prominently in NDK documentation. There are few reasons to use RegisterNatives vs. the usual automatic resolution of native methods through name matching (always use javah to get correct names).
When you have many of native methods, you may not want to have a huge exported function table in your shared library.
Using automatic matching makes reverse engineering and hacking your shared library easier.
You can build custom logic to match native methods at runtime.
#CriticalNative methods must be registered with RegisterNatives instead of relying on dynamic JNI linking.
None of these reasons apply to how-to samples and introductory tutorials.

Interacting with Android API Library?

I'm quite the beginner to programming in general (and esp. Java!), so I'm having trouble figuring out how to interact with the unofficial Android API library, shown here:
http://code.google.com/p/android-market-api/
One of the snippets of example code say "see AppsResponse class definition for more info". However, how am I supposed to do this? There are two .jars provided, one of which corresponds to the Android Market API. Upon extraction with WinRAR (I'm on Windows, by the way), I go in a few folders deep and find a bunch of .class files. How do I open this to read, and figure out how to interact with the API? Thanks!
You can just look at it from the source?
http://code.google.com/p/android-market-api/source/browse/trunk/AndroidMarketApi/src/com/gc/android/market/api/model/Market.java

How to add java.awt.image package in Android

I have an external library that relies on the java.awt.Image package. However, the Android library does not contain it. Does anybody know how to add it to Android?
Thanks!
The Java AWT classes contain native code, so unless someone ports that native code to Android, you are out of luck. And, they won't port it, because as it was pointed out above, Android has its own graphics libraries (android.graphics).
Use JavaCV. http://code.google.com/p/javacv/
Its allready precompiled for Android 2.2 : http://code.google.com/p/javacv/downloads/list
This answer is to justify Hitesh answer after seeing up votes (which misleads). If am wrong, please correct me.
Well, I have also been enthusiast in using few core concepts of Java like Swings and AWT libraries in Android.
Recently I wanted to use java.awt.Color class because it is much better than android.graphics.Color. So done a small research by reading few threads and concluded as 'No we cannot import'. By seeing Hitesh answer I thought I failed my research and found very easiest solution for my problem. Followed the steps for a sample and run my code. Alas!!!
NoClassDefFoundError exception has thrown.
Once again made a small research for concluding Jeffrey (accepted) answer. I found conclusion here. The comment above the method loadLibraries() explains everything. This method has been called in Color class (line 279).
https://stackoverflow.com/a/33210293/5418475
The AWT package is not supported in Android, you need to change your implementation to use the Android classes.
See these similar questions:
Porting AWT graphics code to Android
How to add java AWT image package in Android
Using AWT with Android

How to manipulate Android classes

New to Android. Trying to find docs that show what Android classes expect to elicit changes. For example, to make a keyboard always visible, I could find some info searching Google, but not directly in the docs of the SDK. Is there a source for more comprehensive docs on how Android works not just from the individual class level, but how it boots up and what to do to make small tweaks for an app.
I don't know if this would be what you're looking for, but here's some information on packages and classes
http://developer.android.com/reference/android/inputmethodservice/package-summary.html
I've been teaching myself Android for about a month now and the best reference I've found so far is the Android Developer site, especially under the References and Resources pages.
Hopefully that helps a little bit. Sorry I couldn't be of more help.

Categories

Resources