Can i run C code on dalvik VM on android ?
VM runs byte codes, but I need run c-code on dalvik-VM for myApps. is it possible??
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
First of all, the Dalvik VM can only run (his own format of) java bytecode.
If you need to run C code on Android, you’ll have to use the Android NDK, write your C code, cross-compile it, and then you will be able to run it on your android platform.
If you need to use this code from a Android application, you will need to create a JNI interface to bind your C code to java (as described in the examples of the NDK), then your java application running on the dalvik vm will call some java libraries that will call your C code (as a standard library).