Changeset 14109


Ignore:
Timestamp:
12/07/12 18:44:09 (12 years ago)
Author:
ltnguyen
Message:

working android prototype

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  
    22    package="com.example.issm"
    33    android:versionCode="1"
    4     android:versionName="1.0" >
    5 
     4    android:versionName="1.0"
     5    android:installLocation="preferExternal" >
    66    <uses-sdk
    77        android:minSdkVersion="10"
  • issm/trunk-jpl/src/android/ISSM/gen/com/example/issm/R.java

    r14058 r14109  
    2121    }
    2222    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;
    2830    }
    2931    public static final class layout {
  • issm/trunk-jpl/src/android/ISSM/jni/Main.cpp

    r14089 r14109  
    7979                __android_log_print(ANDROID_LOG_INFO, "Native","Solving ");
    8080
    81                 /*fill out the first two slots, extract the same way in java using get(int position)*/
    8281                jdouble *dBuf = (jdouble *)env->GetDirectBufferAddress(buf);
    8382
     
    139138                }
    140139
    141                 /*for(i=0;i<148;i++){
     140                for(i=0;i<148;i++){
    142141                __android_log_print(ANDROID_LOG_INFO, "Native","%g %g %g | %g %g %g | %g %g %g | %g %g %g\n",
    143142                                dBuf[12*i+0],dBuf[12*i+1],dBuf[12*i+2],
     
    145144                                dBuf[12*i+6],dBuf[12*i+7],dBuf[12*i+8],
    146145                                dBuf[12*i+9],dBuf[12*i+10],dBuf[12*i+11]);
    147                 }*/
     146                }
    148147
    149148                /*delete temporary data:*/
  • issm/trunk-jpl/src/android/ISSM/project.properties

    r14081 r14109  
    1212
    1313# Project target.
    14 target=android-14
     14target=android-15
  • issm/trunk-jpl/src/android/ISSM/res/layout/activity_issm.xml

    r13890 r14109  
    11<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    22    xmlns:tools="http://schemas.android.com/tools"
     3    android:id="@+id/relativeLay"
    34    android:layout_width="match_parent"
    4     android:layout_height="match_parent" >
     5    android:layout_height="match_parent"
     6    android:orientation="horizontal" >
    57
    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"
    818        android:layout_width="wrap_content"
    919        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>
    1335
    1436    <Button
     
    1638        android:layout_width="wrap_content"
    1739        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" />
    3243
    3344</RelativeLayout>
  • issm/trunk-jpl/src/android/ISSM/src/com/example/issm/ISSM.java

    r14089 r14109  
    66import java.nio.ByteOrder;
    77import java.nio.DoubleBuffer;
     8import java.text.DecimalFormat;
    89
     10import android.opengl.GLSurfaceView;
    911import android.os.Bundle;
    1012import android.app.Activity;
     
    1618import android.widget.Button;
    1719import android.widget.EditText;
     20import android.widget.FrameLayout;
     21import android.widget.SeekBar;
    1822import android.widget.TextView;
    1923
     
    2832        private String issmFolder;
    2933        private int size;
     34    private GLSurfaceView mGLView;
     35        private FrameLayout frame;
     36        private SeekBar bar;
     37    private TextView /*txtStatus,*/ txtValue;
     38   
     39
    3040    @Override
    3141  //------------------------------------------------------------------------------------------------   
     
    4151        }
    4252        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);
    4555        Button button = (Button) super.findViewById(R.id.button1);
    4656        button.setOnClickListener(this);
     
    5161        this.createModel();
    5262        buff = ByteBuffer.allocateDirect(size*12*8).order(ByteOrder.nativeOrder()).asDoubleBuffer();
     63       
     64
    5365    }
    5466//------------------------------------------------------------------------------------------------   
     
    6981    {
    7082        issmNative.solveISSMModel(5,buff);
    71 
    72                 //for(int i=0;i< size*12;i++)
    73                         //System.out.println(buff.get(i));
    74 
    7583    }
    7684 //------------------------------------------------------------------------------------------------   
     
    7886        {
    7987                //factorial method
    80                 String input = this.input.getText().toString();
     88                /*String input = this.input.getText().toString();
    8189                if(TextUtils.isEmpty(input))
    8290                {
    8391                        return;
    84                 }               
    85                 long resultfromFac = issmNative.fac(Long.parseLong(input));
     92                }*/             
    8693                //example of how to fill buffer Native
    8794                this.fillBuffer();
    8895               
    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);
    9499        }
    95100}
Note: See TracChangeset for help on using the changeset viewer.