如何在Android下使用JNI
1个回答
展开全部
第一步:
使用Java编写HelloWorld 的Android应用程序:
复制代码
package com.lucyfyr;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
public class HelloWorld extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Log.v("dufresne", printJNI("I am HelloWorld Activity"));
}
static
{
使用Java编写HelloWorld 的Android应用程序:
复制代码
package com.lucyfyr;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
public class HelloWorld extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Log.v("dufresne", printJNI("I am HelloWorld Activity"));
}
static
{
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询