Create the Java exception
com.packtpub.exception.InvalidTypeException
of typeException
as follows:package com.packtpub.exception; public class InvalidTypeException extends Exception { public InvalidTypeException(String pDetailMessage) { super(pDetailMessage); } }
Repeat the operation for two other exceptions:
NotExistingKeyException
of typeException
andStoreFullException
of typeRuntimeException
.Open
Store.java
and declare thrown exceptions ongetInteger()
in classStore
(StoreFullException
isRuntimeException
and does not need declaration):public class Store { ... public native int getInteger(String pKey) throws NotExistingKeyException, InvalidTypeException; public native void setInteger(String pKey, int pInt); ...
Repeat the operation for all other getter prototypes (strings, colors, and so on).
These exceptions need to be caught. Catch
NotExistingKeyException
andInvalidTypeException...
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