Copy platforms and samples from ndk/ source tree.
The idea is to allow developing the NDK in the open, while having the platforms and samples under a private branch until the corresponding release are open-sourced. Change-Id: Iee995fb6c4d3ee1387dea7486e599e079c9e4c6d
This commit is contained in:
37
ndk/samples/hello-neon/src/com/example/neon/HelloNeon.java
Normal file
37
ndk/samples/hello-neon/src/com/example/neon/HelloNeon.java
Normal file
@@ -0,0 +1,37 @@
|
||||
package com.example.neon;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
import android.widget.TextView;
|
||||
|
||||
public class HelloNeon 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
|
||||
* 'helloneon' native library, which is packaged
|
||||
* with this application.
|
||||
*/
|
||||
public native String stringFromJNI();
|
||||
|
||||
/* this is used to load the 'helloneon' library on application
|
||||
* startup. The library has already been unpacked into
|
||||
* /data/data/com.example.neon/lib/libhelloneon.so at
|
||||
* installation time by the package manager.
|
||||
*/
|
||||
static {
|
||||
System.loadLibrary("helloneon");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user