Android NDK LoadLibrary("KERNEL32.DLL") - android

Is there a way to Load the kernel32.dll library in the Android NDK?
I'm trying to extract the GetTickCount and GetTickCount64 functions out of it, and I get this error when trying to run the LoadLibrary("KERNEL32.DLL"):
Function 'LoadLibrary' could not be resolved
Any suggestions to get the GetTickCount and GetTickCount64?

Android is Linux, not Windows. You need to use Linux APIs. Use clock_gettime instead of GetTickCount (example).

Related

Can not use Vulkan Subgroup operations in Android Studio

I'm writing a Vulkan compute shader in Android studio and launching it on Android phone. The problem I'm experiencing is next - I can not use any subgroup operations like subgroupAdd and subgroupElect. When I'm trying to use these functions I have an error like this:
reduce_vec.comp:35: error: 'subgroup op' : requires SPIR-V 1.3
I have checked - my Android phone supports subgroups, and my shader accepts such extensions:
#extension GL_KHR_shader_subgroup_arithmetic: enable
#extension GL_KHR_shader_subgroup_basic: enable
The problem is pretty much straightforward, I need to update my SPIR-V. But according to my findings, SPIR-V that comes automatically with Android studio is not something I can update easily.
Did someone experience a similar issue before? What was your solution? Thanks in advance!
Android solution
You can pass arguments to the Android shaderc compiler in your Gradle DSL:
https://developer.android.com/ndk/guides/graphics/shader-compilers
You need glslcArgs to contain --target-env=vulkan1.1
Flexible solution
Build your own compilation pipeline to compile from source into SPIR-V, and then include the SPIR-V binary files directly into your Android project.
There are multiple language front-ends that can generate SPIR-V, for GLSL the Khronos tools are here:
https://github.com/KhronosGroup/glslang

Unable to build GStreamer pipeline; no element x265enc in Android

I am trying to implement H265 using the x265enc encoder in an android application using GStreamer. I have constructed the pipeline which works when using the terminal and gst-launch-1.0 and videotestsrc. However, when trying to execute the pipeline in android it doesn't work and gives the error gst_error_factory_make: no such element factory "x265enc"! and is unable to build the pipeline due to the element x265enc missing.
I have installed plugins-bad (contains x265enc) on the computer and it is in the android.mk file. When I look in the plugins.mk file I don't see x265 mentioned anywhere (x264 is mentioned and x264enc works). Is this an issue? Is there another way to install x265enc so that android can recognize it?
try to install gst-plugins-ugly-1.0 and it will solve your issue

Is there a way to run helgrind/drd in android?

I try to figure out some problem caused by thread sync in mips android, I installed valgrind in my mips machine, It is ok when using memcheck, but when I changed the option to --tool=helgrind, logcat says this:
I/start_valgrind.sh( 9328): link_image[2207]: 9329 could not load needed library '/data/local/Inst/lib/valgrind/vgpreload_drd-mips32-linux.so' for '/system/bin/app_process' (mips_relocate_got[1749]: 9329 cannot locate 'sched_yield'...
I located sched_yield in /system/lib/libc.so, but I can't find a way to add it to the link path; I using valgrind-3.10.0 and my android system version is 4.1.
So is it possible to run helgrind/drd in android? Thanks!

How do I stop the IDE from referencing Windows-specific XML units in my non-Windows project?

I want to create a Android program in Delphi XE5 to work with XML files. I use TXMLDocument.
I can't compile and run it, though, because Delphi repeatedly adds Xml.Win.msxmldom in the uses section. The following error occurs:
[DCC Fatal Error] Unit1.pas(11): F1026 File not found:
'C:\Users\HamiD\Documents\RAD Studio\Projects\Xml.Win.msxmldom.dcu'
(unit scope "Xml.Win" indicates Win32, Win64 only)
How do I avoid using that unit in my project?
In the TXMLDocument, change the DOM vendor from MSXML to ADOMXML v4, to stop the need to use the MSXML unit.
This is covered in the documentation for TXMLDocument.DOMVendor. Although it mentions specifically Mac, the same applies to other FireMonkey applications on iOS and Android.
Tip: If you are designing a FireMonkey application that is intended to run on Mac OS X, then you should perform the following steps to ensure that the compilation succeeds:
Change DOMVendor from MSXML to ADOM XML v4.
If the Xml.Win.msxmldom unit is in the uses clause then remove it.
Compile your application for Mac OS X.
The documentation was modified in the XE5 version to read instead:
Tip: To use TXMLDocument in Mac OS X or Mobile applications, in the Object Inspector, set the DOMVendor property to ADOM XML v4 right after dropping this component onto the Form Designer. Otherwise, the TXMLDocument component is no longer usable for iOS/Android/OSX applications.

How can BlueCove be used in Android?

I'm trying to implement BlueCove in Android; i've read here: http://code.google.com/p/bluecove/source/browse/trunk/bluecove-android2/src/site/apt/index.apt?r=3062 "usage: include bluecove.jar and bluecove-android2.jar in classpath of the android application and call JSR-82 APIs normally" .
The problem is that if i include bluecove.jar and bluecove-android2.jar i get a "The library 'bluecove-2.1.0.jar' contains native libraries that will not run on the device." error about libbluecove.jnilib.
How can i solve it?
BlueCove uses native calls through JNI, you will need implement those calls with android equivalents.
This might help: http://groups.google.com/group/bluecove-developers/browse_thread/thread/6e32131d7c5b672

Categories

Resources