/*
* Copyright (C) 2009 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.example.hellojni;
import android.app.Activity;
import android.widget.TextView;
import android.os.Bundle;
public class HelloJni extends Activity
{
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
/* Create a TextView and set its content.
* the text is retrieved by calling a native
* function.
*/
TextView tv = new TextView(this);
tv.setText( stringFromJNI() );
setContentView(tv);
}
/* A native method that is implemented by the
* 'hello-jni' native library, which is packaged
* with this application.
*/
public native String stringFromJNI();
/* This is another native method declaration that is *not*
* implemented by 'hello-jni'. This is simply to show that
* you can declare as many native methods in your Java code
* as you want, their implementation is searched in the
* currently loaded native libraries only the first time
* you call them.
*21
* Trying to call this function will result in a
* java.lang.UnsatisfiedLinkError exception !
*/
public native String unimplementedStringFromJNI();
/* this is used to load the 'hello-jni' library on application
* startup. The library has already been unpacked into
* /data/data/com.example.hellojni/lib/libhello-jni.so at
* installation time by the package manager.
*/
static {
System.loadLibrary("hello-jni");
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
hello-jni.7z (64个子文件)
hello-jni
.project 1KB
.externalToolBuilders
NDK_Builder.launch 1KB
project.properties 562B
src
com
example
hellojni
HelloJni.java 2KB
AndroidManifest.xml 695B
res
drawable-ldpi
drawable-hdpi
drawable-mdpi
layout
drawable-xhdpi
values
strings.xml 110B
.settings
org.eclipse.jdt.core.prefs 177B
assets
jni
Application.mk 14B
hello-jni.c 1KB
Android.mk 1KB
nick
hello-jni.c 1KB
Android.mk 472B
libs
armeabi-v7a
gdb.setup 180B
libhello-jni.so 13KB
gdbserver 259KB
libhello-jni-mine.so 13KB
mips
gdb.setup 174B
libhello-jni.so 5KB
gdbserver 433KB
libhello-jni-mine.so 5KB
x86
gdb.setup 172B
libhello-jni.so 5KB
gdbserver 609KB
libhello-jni-mine.so 5KB
armeabi
gdb.setup 176B
libhello-jni.so 13KB
gdbserver 259KB
libhello-jni-mine.so 13KB
tests
.project 841B
project.properties 562B
src
com
example
hellojni
HelloJniTest.java 655B
AndroidManifest.xml 1KB
res
drawable-ldpi
drawable-hdpi
drawable-mdpi
layout
drawable-xhdpi
values
.settings
org.eclipse.jdt.core.prefs 177B
assets
gen
com
example
hellojni
tests
BuildConfig.java 168B
.classpath 475B
bin
classes
com
example
hellojni
tests
BuildConfig.class 361B
HelloJniTest.class 672B
AndroidManifest.xml 1KB
jarlist.cache 120B
res
obj
local
armeabi-v7a
objs-debug
hello-jni
hello-jni.o.d 1KB
hello-jni.o 24KB
hello-jni-mine
nick
hello-jni.o.d 1KB
hello-jni.o 24KB
libhello-jni.so 56KB
libhello-jni-mine.so 56KB
mips
objs-debug
hello-jni
hello-jni.o.d 1KB
hello-jni.o 24KB
hello-jni-mine
nick
hello-jni.o.d 1KB
hello-jni.o 24KB
libhello-jni.so 25KB
libhello-jni-mine.so 25KB
x86
objs-debug
hello-jni
hello-jni.o.d 1KB
hello-jni.o 23KB
hello-jni-mine
nick
hello-jni.o.d 1KB
hello-jni.o 23KB
libhello-jni.so 25KB
libhello-jni-mine.so 25KB
armeabi
objs-debug
hello-jni
hello-jni.o.d 1KB
hello-jni.o 24KB
hello-jni-mine
nick
hello-jni.o.d 1KB
hello-jni.o 24KB
libhello-jni.so 56KB
libhello-jni-mine.so 56KB
.classpath 475B
共 64 条
- 1
hello_wangbin
- 粉丝: 83
- 资源: 14
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页