I'm searching for using Android JNI on C++ Builder, and I saw this code:
private void doPhotoPrint() {
PrintHelper photoPrinter = new PrintHelper(getActivity());
photoPrinter.setScaleMode(PrintHelper.SCALE_MODE_FIT);
Bitmap bitmap = BitmapFactory.decodeResource(getResources(),
R.drawable.droids);
photoPrinter.printBitmap("droids.jpg - test print", bitmap);
}
That's a Java code to print (in a thermal printer) a bitmap and I need to use it in C++ Builder, but I don't have idea how to convert it. I saw doing other things by intents or even JNI. I don't want recommendations or something, neither a done code (saying this to avoid judgments that my question is for recommendations), but I want something like this code to help create a function.
PS: I didn't found any documentation about Android JNI.
It would look something like this:
I don’t know if Embarcadero has already imported the
TJPrintHelperandTJBitmapFactoryclasses (do a grep of Embarcadero’sAndroidapi...header files). If not, you can simply use Java2OP to import them manually.I don’t know how to translate
R.drawable.droidsto Embarcadero’s JNI framework.decodeResource()wants the integer resource ID of thedroidsimage. You will have to track that one down yourself.