码迷,mamicode.com
首页 > 其他好文 > 详细

MyJni撒旦

时间:2016-04-27 18:50:05      阅读:148      评论:0      收藏:0      [点我收藏+]

标签:

package com.baidu.jnitest;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.widget.TextView;

public class JNIActivity extends Activity {
    static{
        System.loadLibrary("JNITest");     
    }
        public native String stringFromJNI();

        public native double add(double a, double b);

        public native double sub(double a, double b);

        public native double multi(double a, double b);

        public native double div(double a, double b);

    
    TextView textview1;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        textview1 = (TextView) this.findViewById(R.id.textview1);
        textview1.setText("加法结果"+stringFromJNI()+add(1.2,2.3));
    }
    
}

 

MyJni撒旦

标签:

原文地址:http://www.cnblogs.com/1995yu/p/5439584.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!