Editing GRAndWalkthrough

Jump to: navigation, search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 169: Line 169:
 
* In the [https://github.com/trondeau/GrTemplate/blob/master/app/src/main/java/org/gnuradio/grtemplate/MainActivity.java main activity Java file], setup the JNI interface functions and call SetTMP in the onCreate function.
 
* In the [https://github.com/trondeau/GrTemplate/blob/master/app/src/main/java/org/gnuradio/grtemplate/MainActivity.java main activity Java file], setup the JNI interface functions and call SetTMP in the onCreate function.
  
* For access to the JNI call, put the following at the bottom of the activity class:
+
'''''' For access to the JNI call, put the following at the bottom of the activity class:
  
 
<pre>    public native void SetTMP(String tmpname);
 
<pre>    public native void SetTMP(String tmpname);
Line 176: Line 176:
 
         System.loadLibrary("fg");
 
         System.loadLibrary("fg");
 
     }</pre>
 
     }</pre>
* The library name is 'fg' because that's what we put into the Android.mk file's LOCAL_MODULE value.
+
'''''' The library name is 'fg' because that's what we put into the Android.mk file's LOCAL_MODULE value.
  
* In the onCreate function, just add this line:
+
'''''' In the onCreate function, just add this line:
  
 
<pre>    @Override
 
<pre>    @Override
Line 188: Line 188:
 
         ....
 
         ....
 
     }</pre>
 
     }</pre>
* This uses Java to get information about the application's cache directory, which is unknown by us or by the C++ application. We get it through these Android calls, and then pass it to the C++ part, which will set the environmental variable TMP to this directory. GNU Radio knows to look at TMP when setting up the scheduler.
+
'''''' This uses Java to get information about the application's cache directory, which is unknown by us or by the C++ application. We get it through these Android calls, and then pass it to the C++ part, which will set the environmental variable TMP to this directory. GNU Radio knows to look at TMP when setting up the scheduler.
  
 
* Similarly, let's add the flowgraph control JNI function to the MainActivity class
 
* Similarly, let's add the flowgraph control JNI function to the MainActivity class
Line 196: Line 196:
 
     public native void FgStop();
 
     public native void FgStop();
 
     public native void FgRep();</pre>
 
     public native void FgRep();</pre>
* Then in the onCreate function, add the init and start functions after SetTMP:
+
'''''' Then in the onCreate function, add the init and start functions after SetTMP:
  
 
<pre>        FgInit();
 
<pre>        FgInit();

Please note that all contributions to GNU Radio are considered to be released under the Creative Commons Attribution-ShareAlike (see GNU Radio:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel | Editing help (opens in new window)