Changeset 14109
- Timestamp:
- 12/07/12 18:44:09 (12 years ago)
- Location:
- issm/trunk-jpl/src/android/ISSM
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/android/ISSM/AndroidManifest.xml
r14046 r14109 2 2 package="com.example.issm" 3 3 android:versionCode="1" 4 android:versionName="1.0" >5 4 android:versionName="1.0" 5 android:installLocation="preferExternal" > 6 6 <uses-sdk 7 7 android:minSdkVersion="10" -
issm/trunk-jpl/src/android/ISSM/gen/com/example/issm/R.java
r14058 r14109 21 21 } 22 22 public static final class id { 23 public static final int button1=0x7f080001; 24 public static final int button2=0x7f080003; 25 public static final int input=0x7f080000; 26 public static final int menu_settings=0x7f080004; 27 public static final int output=0x7f080002; 23 public static final int button1=0x7f080004; 24 public static final int button2=0x7f080005; 25 public static final int frame=0x7f080003; 26 public static final int menu_settings=0x7f080006; 27 public static final int relativeLay=0x7f080000; 28 public static final int seekBar=0x7f080001; 29 public static final int value=0x7f080002; 28 30 } 29 31 public static final class layout { -
issm/trunk-jpl/src/android/ISSM/jni/Main.cpp
r14089 r14109 79 79 __android_log_print(ANDROID_LOG_INFO, "Native","Solving "); 80 80 81 /*fill out the first two slots, extract the same way in java using get(int position)*/82 81 jdouble *dBuf = (jdouble *)env->GetDirectBufferAddress(buf); 83 82 … … 139 138 } 140 139 141 /*for(i=0;i<148;i++){140 for(i=0;i<148;i++){ 142 141 __android_log_print(ANDROID_LOG_INFO, "Native","%g %g %g | %g %g %g | %g %g %g | %g %g %g\n", 143 142 dBuf[12*i+0],dBuf[12*i+1],dBuf[12*i+2], … … 145 144 dBuf[12*i+6],dBuf[12*i+7],dBuf[12*i+8], 146 145 dBuf[12*i+9],dBuf[12*i+10],dBuf[12*i+11]); 147 } */146 } 148 147 149 148 /*delete temporary data:*/ -
issm/trunk-jpl/src/android/ISSM/project.properties
r14081 r14109 12 12 13 13 # Project target. 14 target=android-1 414 target=android-15 -
issm/trunk-jpl/src/android/ISSM/res/layout/activity_issm.xml
r13890 r14109 1 1 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 2 2 xmlns:tools="http://schemas.android.com/tools" 3 android:id="@+id/relativeLay" 3 4 android:layout_width="match_parent" 4 android:layout_height="match_parent" > 5 android:layout_height="match_parent" 6 android:orientation="horizontal" > 5 7 6 <EditText 7 android:id="@+id/input" 8 <SeekBar 9 android:id="@+id/seekBar" 10 android:layout_width="match_parent" 11 android:layout_height="wrap_content" 12 android:layout_alignParentBottom="true" 13 android:layout_alignParentLeft="true" 14 android:layout_marginBottom="41dp" /> 15 16 <TextView 17 android:id="@+id/value" 8 18 android:layout_width="wrap_content" 9 19 android:layout_height="wrap_content" 10 android:layout_alignParentLeft="true" 11 android:ems="10" 12 android:inputType="number" /> 20 android:layout_above="@+id/seekBar" 21 android:layout_centerHorizontal="true" 22 android:layout_marginBottom="15dp" 23 android:text="alpha value = 0" /> 24 25 <FrameLayout 26 xmlns:android="http://schemas.android.com/apk/res/android" 27 xmlns:tools="http://schemas.android.com/tools" 28 android:id="@+id/frame" 29 android:layout_width="wrap_content" 30 android:layout_height="wrap_content" 31 android:layout_above="@+id/value" 32 android:layout_centerHorizontal="true" 33 android:layout_marginBottom="12dp" > 34 </FrameLayout> 13 35 14 36 <Button … … 16 38 android:layout_width="wrap_content" 17 39 android:layout_height="wrap_content" 18 android:layout_alignRight="@+id/input" 19 android:layout_below="@+id/input" 20 android:layout_marginRight="46dp" 21 android:layout_marginTop="23dp" 22 android:text="calculate" /> 23 24 <TextView 25 android:id="@+id/output" 26 android:layout_width="wrap_content" 27 android:layout_height="wrap_content" 28 android:layout_alignParentLeft="true" 29 android:layout_below="@+id/button1" 30 android:layout_marginTop="39dp" 31 android:textSize="20sp" /> 40 android:layout_above="@+id/seekBar" 41 android:layout_alignParentRight="true" 42 android:text="Reset" /> 32 43 33 44 </RelativeLayout> -
issm/trunk-jpl/src/android/ISSM/src/com/example/issm/ISSM.java
r14089 r14109 6 6 import java.nio.ByteOrder; 7 7 import java.nio.DoubleBuffer; 8 import java.text.DecimalFormat; 8 9 10 import android.opengl.GLSurfaceView; 9 11 import android.os.Bundle; 10 12 import android.app.Activity; … … 16 18 import android.widget.Button; 17 19 import android.widget.EditText; 20 import android.widget.FrameLayout; 21 import android.widget.SeekBar; 18 22 import android.widget.TextView; 19 23 … … 28 32 private String issmFolder; 29 33 private int size; 34 private GLSurfaceView mGLView; 35 private FrameLayout frame; 36 private SeekBar bar; 37 private TextView /*txtStatus,*/ txtValue; 38 39 30 40 @Override 31 41 //------------------------------------------------------------------------------------------------ … … 41 51 } 42 52 setContentView(R.layout.activity_issm); 43 this. input = (EditText) super.findViewById(R.id.input);44 this. output = (TextView) super.findViewById(R.id.output);53 this.bar = (SeekBar) findViewById(R.id.seekBar); 54 this.txtValue = (TextView) super.findViewById(R.id.value); 45 55 Button button = (Button) super.findViewById(R.id.button1); 46 56 button.setOnClickListener(this); … … 51 61 this.createModel(); 52 62 buff = ByteBuffer.allocateDirect(size*12*8).order(ByteOrder.nativeOrder()).asDoubleBuffer(); 63 64 53 65 } 54 66 //------------------------------------------------------------------------------------------------ … … 69 81 { 70 82 issmNative.solveISSMModel(5,buff); 71 72 //for(int i=0;i< size*12;i++)73 //System.out.println(buff.get(i));74 75 83 } 76 84 //------------------------------------------------------------------------------------------------ … … 78 86 { 79 87 //factorial method 80 String input = this.input.getText().toString();88 /*String input = this.input.getText().toString(); 81 89 if(TextUtils.isEmpty(input)) 82 90 { 83 91 return; 84 } 85 long resultfromFac = issmNative.fac(Long.parseLong(input)); 92 }*/ 86 93 //example of how to fill buffer Native 87 94 this.fillBuffer(); 88 95 89 //print result from fac and the first two slot of filled buffer. 90 this.output.setText("Result = " + resultfromFac + "\n" 91 + "First slot from buffer:\n" 92 + buff.get(0) + " size " + size); 93 96 mGLView = new MyGLSurfaceView(this, buff, size); 97 frame = (FrameLayout)findViewById(R.id.frame); 98 frame.addView(mGLView); 94 99 } 95 100 }
Note:
See TracChangeset
for help on using the changeset viewer.