In
StoreType.java
, add the newly managed integer type to the enumeration:public enum StoreType { Integer, String }
Open
Store.java
and define the new integer functionalities our native store provides:public class Store { ... public native int getCount(); public native int getInteger(String pKey); public native void setInteger(String pKey, int pInt); public native String getString(String pKey); public native void setString(String pKey, String pString); }
In the
StoreActivity
class, update theonGetValue()
method to retrieve integer entries from the store when they are selected in the GUI:public class StoreActivity extends Activity { ... public static class PlaceholderFragment extends Fragment { ... private void onGetValue() { ... switch (type) { case Integer: mUIValueEdit.setText(Integer.toString(mStore ...
Android NDK: Beginner's Guide
By :
Android NDK: Beginner's Guide
By:
Overview of this book
Table of Contents (18 chapters)
Android NDK Beginner's Guide Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Free Chapter
Setting Up Your Environment
Starting a Native Android Project
Interfacing Java and C/C++ with JNI
Calling Java Back from Native Code
Writing a Fully Native Application
Rendering Graphics with OpenGL ES
Playing Sound with OpenSL ES
Handling Input Devices and Sensors
Porting Existing Libraries to Android
Intensive Computing with RenderScript
Afterword
Index
Customer Reviews